Dividing an existing Ubuntu installation on two physical drives

Solution 1:

Not tested, but I would do it in this way if the SSD is at least the same size or bigger than HDD:

Let's name the SSD as /dev/sda and the HDD as /dev/sdb for simplicity.

Steps:

  1. Plug in the SSD and the HDD and boot a live Ubuntu from a bootable media (CD-ROM, pendrive)

  2. issue this command in a terminal: sudo dd if=/dev/sdb of=/dev/sda

  3. when finished, mount /dev/sda and edit on it the /etc/fstab file by adding:

    /dev/sdb1 /home ext4 noatime,nodiratime,defaults 0 2

  4. Enter the /home directory of mounted /dev/sda and erase everything there.

  5. Now comes the hard part: mount /dev/sdb1 and erase everything except /home directory.

  6. When cleaned, enter /home and move out the directories to the root of mounted /dev/sdb1

  7. Erase the empty /home directory from /dev/sdb1

  8. If /dev/sda was bigger than /dev/sdb, use gparted to resize the partition to fit the disk.

  9. Reboot from /dev/sda

  10. Enjoy.