Ubuntu: Porting an installed partition of Ubuntu on a USB stick for the road



Question:

I wanted to know if anybody knows of a way to "take away" on a bootable USB key my own installed partition from my laptop (currently 13.04) for use on the road. The goal is to have my own fully configured and highly securized environment "on the go" and be able to use it in internet cafés (highly insecure environments) by booting my very own system through the USB stick instead of the stock Windows OS Internet cafés usually have. I have already invertigated several solutions but all were ackward and unnervingly slow... For example using a live-USB with a stock Ubuntu install image and persistent option enabled, is incredibly slow at startup; as it seems to have to "reinstall" everything saved in the persistent memory space atop the original OS image at boot-up...For the complicated environment I have, this is not an option because hundreds of programs and security updates have to reinstall themselves each time at boot up...this takes forever. So, isn't there a way to just sort of copy a working and configured partition on the key and have it boot externally onto any computer allowing it via USB ?


Solution:1

I ported Ubuntu 12.04 server from disk to USB stick successfully a year ago. The steps is as following:

  1. Use parted or fdisk to make partitions in your USB stick, make sure the layout must be similar with your hard disk.
  2. Create LVM if it is on your hard disk.
  3. Make filesystem for each partition in USB stick by mkfs.*
  4. mkdir /target and mount root filesystem onto it.
  5. Synchronize files on each partition in your hard disk to the corresponding partition in your USB stick.
  6. chroot /target and performance grub-install

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »