0

I recently purchased a 120GB SSD, and I would like to do a clean install of ubuntu on it, while keeping my current /home. My current configuration is the following (I am running Ubuntu 14.04 LTS) :

sda      8:0    0   1,8T  0 disk
├─sda1   8:1    0   977K  0 part
├─sda2   8:2    0  46,6G  0 part /
├─sda3   8:3    0     4G  0 part [SWAP]
└─sda4   8:4    0   1,8T  0 part /home

Here are my questions :

  1. Will it work if I install ubuntu on the SSD and during the installation select my current home (without formatting ?)

  2. Then, will I be able to format the old / partition (/dev/sda2) and merge it to /home to get the extra-space back ?

  3. Finally, should I put part of the /home directory (the config files) on the SSD to speed up the computer ?

1 Answer 1

0

Yes, this is all possible.

Firstly, it is a good idea to take a backup of your home directory, just in case - it's all too easy to make a silly mistake & be sorry!

Next, install the SSD & reboot from install media, do a normal installation, don't tell Ubuntu about your current SDA drive - be aware, the SSD may well go in as SDA so check carefully when you select the destination drive!

You can allocate /home during the install, but I always prefer not to (just paranoia!) - it's only one tick-box away from formatting it, and it keeps it safe..

Having got your new system up & running, mount the old drive; just double-click it's desktop icon - check the ownership of your old home directory matches - it probably does, unless you have multiple users. If it doesn't, shopt -s dotglob ; chown -R you:you /media/you/wherever will fix it so it does. The shopt command makes it include hidden files, & the chown changes ownership to your new UID & GID.

Now, use `blkid /dev/sdx4' to get the UUID for your home partition, add it to /etc/fstab -

sudo vi /etc/fstab or whatever editor you prefer UUID=78995654kjhgjyt7896 /home ext4 defaults 0 1 - obviously, using your UUID & filesystem type here.

mount -a should now replace your home directory with the old one, although a reboot is a better idea as you may get some odd effects if you just remount.

You can then delete your old system - /dev/sdx1, and sdx2 -others beware as that is sometimes an extended partition and may hold your home directory! Use gparted to expand into the free space.

1
  • Thanks for the answer. I did just as you said, and it worked fine (I did not erase my old / partition yet, but I will do it shortly) :)
    – lodahu
    Feb 7, 2015 at 13:42

You must log in to answer this question.

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