Wednesday, November 9, 2011

Cloning Ubuntu to a smaller disk

1. Boot Ubuntu LiveCD. Photobucket

2. Run Gparted.

3. The source Ubuntu partition is in /dev/sda5 which is 27GB. Photobucket

4. Create partition in the destination drive. In this illustration, we created a 20GB disk in /dev/sdb1. It was labelled as "mydisk1".

5. Set the Boot flag on /dev/sdb1. Then close Gparted.
Photobucket

6. Mount the 2 partitions by click Places and the 2 partitions. Photobucket

7. Open Terminal.

8. ls /media The 2 partitions are listed: Source partition: ec5e7532-894e-439d-846f-a5f797d9cb2c Destination partition: mydisk1 Photobucket

9. sudo rsync -av --progress /media/ec5e7532-894e-439d-846f-a5f797d9cb2c/ /media/mydisk1/ Photobucket

10. Run Gparted.

11. Find the destination partition's UUID by right-click /dev/sdb1 and select Information. Copy the UUID and close Gparted. In this case, the UUID is 97524d3c-1b60-4338-b626-98e797df2959 Photobucket

12. On the Terminal, sudo gedit /media/mydisk1/boot/grub/grub.cfg

13. Search and Replace "ec5e7532-894e-439d-846f-a5f797d9cb2c" to "97524d3c-1b60-4338-b626-98e797df2959"

14. Reboot to the new disk.

15. On a Terminal, sudo update-grub