Migrating from live USB to internal HDD
So now I need to clone my live USB install of Ubuntu to an internal HDD.
- Install HDD drive
- Boot from live Ubuntu CD
- Create partitions. Use the builtin Disk Utility in System > Administration > Disk Utility Create 256MB swap (0.256 GB) Create the remainer as Linux EXT4. Set EXT4 to bootable.
- Install gddrescue sudo aptitude install gddrescue
- Plug in the USB drive and unmount it
- Determine which is the source and which is the destination sudo fdisk -l
- Copy the contents from source to dest sudo ddrescue -v /dev/sda1 /dev/sdb2 This messes with the partition table - so we fake a resize.
- Expand the clone to fill the partition Use gparted from System > Administration > GParted and Partition > Resize / Move. Fiddle around shrinking and enlarging the partition. Get GParted to update the table even though it complains that nothing will change.
- Repair Grub2 (Method 3 - CHROOT) https://help.ubuntu.com/community/Grub2
- While chrooted edit /etc/fstab to enable swap /dev/sdb1 none swap sw 0 0
- Reboot and test. You might find that what was sdb is now sda - so update fstab swap and root entries.