From: Chris Jones on
I'm playing with the idea of copying my laptop's debian lenny partition
to a USB stick that I can take with me when traveling.

Since I can't be sure I'll have a machine with available space on the
HDD or be allowed to partition the drive, what I thought was that I
could have a bootable system on the USB stick and boot into it pretty
much as I would off of a live CD.

What I had in mind was as simple as:

.. clone the lenny partition to /dev/sda1
.. install grub to /dev/sda
.. make adjustments to the contents of /dev/sda1

The trouble is that I don't have a machine that can boot off of a USB
stick to test ahead of time.

Adjustments that I had in mind:

.. /etc/fstab
.. /boot/grub/menu.lst (grub.cfg with grub2)

Naturally, reconfiguring network & internet access, Xorg, printers, etc.
will be necessary, but they cannot be done ahead of time - although it
may be possible to make it less of a pain with some preparation and a
bit of scripting.

Since I'm running the stock lenny kernel, I shouldn't have problems with
differences in hardware, but I'm a little concerned that udev might not
cooperate.

I'm sure there are other issues, but unfortunately, I can't take the
trial and error approach.

So, I was wondering if anyone had done anything comparable, and would
care to point out possible gotchas?

Thanks,

CJ



--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
From: Rob Owens on
On Sat, Nov 28, 2009 at 05:19:56PM -0500, Chris Jones wrote:
> I'm playing with the idea of copying my laptop's debian lenny partition
> to a USB stick that I can take with me when traveling.
>
> Since I can't be sure I'll have a machine with available space on the
> HDD or be allowed to partition the drive, what I thought was that I
> could have a bootable system on the USB stick and boot into it pretty
> much as I would off of a live CD.
>
> What I had in mind was as simple as:
>
> . clone the lenny partition to /dev/sda1
> . install grub to /dev/sda
> . make adjustments to the contents of /dev/sda1
>
> The trouble is that I don't have a machine that can boot off of a USB
> stick to test ahead of time.
>
I'm not sure that what you're planning won't work, but if I were you
I'd do it like this:

Create a live USB system (see my instructions in the "live cd/usb
projects" thread). Install all the same software as your current laptop
ha. Then transfer over your data.

Supposedly you can test your USB image using Qemu, although I've never
done it myself.
http://live.debian.net/manual/html/ch03s03.html#id2911160

-Rob


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
From: Chris Jones on
On Sat, Nov 28, 2009 at 08:59:21PM EST, Rob Owens wrote:
> On Sat, Nov 28, 2009 at 05:19:56PM -0500, Chris Jones wrote:

> > I'm playing with the idea of copying my laptop's debian lenny
> > partition to a USB stick that I can take with me when traveling.
> >
> > Since I can't be sure I'll have a machine with available space on
> > the HDD or be allowed to partition the drive, what I thought was
> > that I could have a bootable system on the USB stick and boot into
> > it pretty much as I would off of a live CD.

[..]

> I'm not sure that what you're planning won't work, but if I were you
> I'd do it like this:
>
> Create a live USB system (see my instructions in the "live cd/usb
> projects" thread). Install all the same software as your current
> laptop ha. Then transfer over your data.

What I had in mind was more like a "bootable backup". I tried Debian
Live before and it does not do that.

IIRC, ubuntu has something that does this, but I don't remember the name
right now, and it probably would not work for a debian system.

> Supposedly you can test your USB image using Qemu, although I've never
> done it myself.

> http://live.debian.net/manual/html/ch03s03.html#id2911160

I tried qemu when I was trying to get Debian Live to work but all it did
was it went to 100% and stayed there doing nothing. I didn't have the
time to investigate, but I have a feeling you need more RAM than I have
to run a VM under qemu - just to boot one, even.

Thanks,

CJ


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
From: Emanoil Kotsev on
Rob Owens wrote:

> On Sat, Nov 28, 2009 at 05:19:56PM -0500, Chris Jones wrote:
>> I'm playing with the idea of copying my laptop's debian lenny partition
>> to a USB stick that I can take with me when traveling.
>>
>> Since I can't be sure I'll have a machine with available space on the
>> HDD or be allowed to partition the drive, what I thought was that I
>> could have a bootable system on the USB stick and boot into it pretty
>> much as I would off of a live CD.
>>
>> What I had in mind was as simple as:
>>
>> . clone the lenny partition to /dev/sda1
>> . install grub to /dev/sda
>> . make adjustments to the contents of /dev/sda1
>>
>> The trouble is that I don't have a machine that can boot off of a USB
>> stick to test ahead of time.
>>
> I'm not sure that what you're planning won't work, but if I were you
> I'd do it like this:
>
> Create a live USB system (see my instructions in the "live cd/usb
> projects" thread). Install all the same software as your current laptop
> ha. Then transfer over your data.
>
> Supposedly you can test your USB image using Qemu, although I've never
> done it myself.
> http://live.debian.net/manual/html/ch03s03.html#id2911160
>
> -Rob

Hm, not necessary to install from scratch.

Just copy over to the usb and put in fstab and relevant files (grub,etc) the
disk id instead of /dev/sda (you need udev for this), so you can be sure to
use the same device no matter which id it sd id it gets assigned to.
recreate initrd and possibly hack it. For me I needed to add manually
command for inserting dm-mod and triggering vgscan/vgchange on a crypted
partition with lvm.
After playing a bit I managed it to get a working initrd. It's all mater of
initrd to get it running.

A major issue is that there are different machines on around with different
chipsets cpus etc, so you'll need more generic kernel and drivers ... may
be 386 to be sure it will run on each system, or get some 386, 586 and 686.

regards


--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org
From: Chris Jones on
On Sun, Nov 29, 2009 at 07:00:55PM EST, Emanoil Kotsev wrote:

[..]

> Hm, not necessary to install from scratch.

> Just copy over to the usb and put in fstab and relevant files
> (grub,etc) the disk id instead of /dev/sda (you need udev for this),
> so you can be sure to use the same device no matter which id it sd id
> it gets assigned to.

Good point: UUID= in /etc/fstab and grub.cfg

> recreate initrd and possibly hack it.

I don't see why at this point, but that's the problem when you cannot
test. I already have a custom initrd and recreating it is not going to
make any difference.

Actually, since I can't get qemu to work, I'm thinking of copying the
system on the USB stick to a DVD and see if I can boot off of that. If
it doesn't it could mean different things, but if it does boot then I'll
know that the USB stick is problably going to do likewise.

> For me I needed to add manually command for inserting dm-mod and
> triggering vgscan/vgchange on a crypted partition with lvm. After
> playing a bit I managed it to get a working initrd. It's all mater of
> initrd to get it running.

> A major issue is that there are different machines on around with
> different chipsets cpus etc, so you'll need more generic kernel and
> drivers ... may be 386 to be sure it will run on each system, or get
> some 386, 586 and 686.

Good point, although machines that can boot off of a USB device are
likely to be fairly recent and should be happy with a 686 kernel.

Thanks for you comments.

CJ



--
To UNSUBSCRIBE, email to debian-user-REQUEST(a)lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster(a)lists.debian.org