On Sat, Feb 13, 2010 at 08:44:59AM EST, Germana Oliveira wrote: > Well, no, what i really want is a portable Debian, so i can, for > example, build a web app and show it everywhere without need a web > server.... and just have my own configuration and run it every where Is this what you are talking about? http://osdir.com/ml/debian-user-debian/2009-12/msg00004.html I did something similar and started documenting it in the attached draft. CJTitle: The quick and Dirty LiveUSB
Table of Contents
Chris Jones <firstname.lastname@example.org>
After cloning my debian lenny system to another partition on my hard drive in order to safely upgrade to debian testing, I realized that I could use the same technique to create a bootable copy of my current system that I could carry around on a USB stick, and hopefully boot any PC I might run into, as long as it had one free USB port, thus saving myself the headaches and backaches of taking my laptop with me, and yet have both all my data and my highly specific desktop everywhere I go.
Well, here’s how it went.
The entire procedure was tested on a Dell Inspiron 7500 laptop, whose BIOS is not capable of booting off of a USB device. The USB stick is an 8GB Sandisk Cruzer Micro, acquired from my local Radio Shack at the reasonable cost of about USD 20.00. Since the laptop only supports USB 1.1, running linux off of the USB stick turned out to be very slow, with a very noticeable lag when starting applications.
There are other tools, but since there were parts of my debian lenny file system I did not wish to copy to the USB stick, I found that rsync was fitted well this particular task. Since I had never used rsync, it was also well worth the extra effort to gain some familiarity with rsync, since once the clone is finalized, it will be imperative to keep the two systems in sunc', something that rsync does efficiently, and that other tools do not appear to do out of the box.
One useful aspect of rsync is that it supports dry runs via the -n | --dry-run flags, which lets you verify ahead of time that your carefully carved rsync command is doing what you expect.
It seems to be indispensable to run rsync as the superuser, since my personal user does not have read access to all the files that need to be copied to the target system.
Some directories were not copied to the target system, either because their content is specific to the source system, such as /proc, /tmp, /sys, or because their usefulness on the target system was questionable, such as my collection of debsrc’s for instance, and would both use up space on the USB stick, and greatly increase the time it takes to clone the system.
It appears that the main difficulty with rsync is to understand exactly how to specify the directories that need to be excluded from the cloning.
Here are the commands that I issued:
# mount -t ext2 /dev/sda1 /media/memstick # rsync -av / /media/memstick # rsync -av /usr /media/memstick # rsync -av /home/myuser/ /media/memstick/home # rsync -av /var /
the idea was to verify that at least on the same hardware as the cloned system everything worked
the bug, and how I was advised to work around it for now (debug=uhci,ohci,usbms + insmod uhci & usbms and the orange light came on)
adding 2 stanzas to /etc/grub.d/40_custom + update-grub
obviously /etc/fstab must be adjusted to mount the file system on the USB stick
network aspects - the laptop has a pcmcia nic - what happens with a regular PCI nic, how about WiFi.. what of funny
ISP issues: I have cable, what about DSL.. ISDN.. good old POT modems..
udev - avoid creating new devices for ethx or cdrom’s etc. on each new machine
Xorg - I love native resolutions .. I hate black screens
need to make the USB bootable
need to burn a grub rescue CD for those systems whose BIOS cannot boot off of a USB device
Be prepared! it may not be convenient to travel back to the main system to fix stuff.. and it may likewise not be easy to fix them locally. Bring along a copy of a decent rescue CD just in case
need as generic a config as possible need to separate private data from programs
is it a good idea to have one partition for the the system and another for /home?
security & privacy issues - at least be aware of the fact that USB sticks are small and it’s easy to lose them, or forget them on some public PC somewheres..
Slowness of the system
All done with mirrors .. rsync I mean.
This needs to be optimized and easy as peach .. since it is imperative to do it immediately upon booting into the main system and before leaving on an errand - no exceptions
easy does it
there are really three families of files: executables, configuration files, private data
a better strategy might be to install a system with all the useful software as the laptop on the USB stick and copy over the customization - mainly config files but not only (scripts, e.g.). See Rob Owens’s instructions.