Wednesday, May 12, 2010

How to move Ubuntu 9.10 to bigger USB drive

Tired again. Tired searching, tired reading all tutorials found on the net. So I've discovered my own solution, combined from many sources. It took me 20 mins to move my Ubuntu from old pendrive to the new one. And it works - that's the most important.
Old pendrive (sdy): 4GB, fat32 formatted (1 partition), casper-rw (3GB) persistent file
New pendrive (sdx): 8GB
sdx1: fat32, 880 MB (flag boot on)
sdx2: ext2, 5,79 GB (label: casper-rw)
sdx3: ext2, 1 GB (label: home-rw)
The whole process was made using Puppy Linux (booted from SD card)
1. Mount casper-rw file from old pendrive: mkdir /mnt/usb mount -o loop /mnt/sdy1/casper-rw /mnt/usb
2. Mount all sdx partitions
3. Copy casper-rw file content to casper-rw sdx partition cp -avR /mnt/usb/* /mnt/sdx2
4. Copy home directory content to home-rw partition cp -avR /mnt/usb/home/ubuntu /mnt/sdx3
5. Copy content of old pendrive to the first partition of sdx omiting casper-rw file (this part you can do using midnight commander file manager)
6. Make new usb bootable: syslinux /dev/sdx1
That's all