8

I am planning to add an SSD drive on my Ubuntu machine. At the moment the computer has a single hard drive, containing the whole install. What I would like to do, is to move the existing installation to the SSD (/ mount), excluding the /home folder, which I would like to keep on the current hard drive. The reason for this is, that the home folder would not fit on the SSD.

Is there a way that I could just copy everything except the /home folder to the SSD and then mount the current hard drive's home folder to /home (of course deleting all that stuff, that was copied on the SSD). Has anyone tried this? Do you think it's possible?

I would not like to make a new installation, as it will take a long time to reconfigure everything.

1
  • Copying the data for / will not be a problem; I see the main problem here in the GRUB/boot configuration. I will add the tag, hope someone can help with the boot bits I am not expert at. By the way, as it is now you have two partitions (/ and /home) or just one? It would be useful to know. Please add the result of a df -h on your post.
    – Rmano
    Nov 6, 2014 at 9:19

3 Answers 3

2

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.

0

The following link is a very good answer on having /home on a separate partition, it also works for having /home on a separate drive.

https://help.ubuntu.com/community/Partitioning/Home/Moving

So I would do a fresh install on the SSD, then using the link above, tell it to use /home on the HDD. You will have to reinstall your programmes but they will pick up the settings from /home.

-1

first, you should partition your ssd using the existing system (fdisd) Do not create filesystems on the newly created partitions, just use dd to copy the existing partitions to the partitions on the ssd. for example:

dd if=/dev/sda1 of=dev/sdb1

Fstab should be updated as wel to point to the new partitions. and I would suggest to keep /var on your hdd if possible as it is frequently written to.

1
  • You can use dd only on exactly identical drives/partition. The main problem in the OP question is the boot configuration.
    – Rmano
    Nov 6, 2014 at 9:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .