0

I have a whole disk mounted at /home. I am upgrading the computer (and the OS drive, so fresh install), and I would like to retain the /home directory (disk) as it is. How complex is this process? Is it worth doing it this way, or should I just start fresh and restore all the user files from backup?

Nothing on the drive is encrypted. Current and target OS are both Ubuntu Desktop 14.04 x64

Other answers I've found do not address /home being located on a separate disk.

Jerbot
  • 75

2 Answers2

1

Yes, you can. Just don't forget to NOT format it, and you'll need to mount it as /home/ in the new OS. Just add a line to /etc/fstab.

Daniel
  • 3,446
  • Can I point /home to the existing /home drive during OS installation, or do I run it through with default partitioning, then replace the /home on the OS drive with my existing /home mount via fstab? – Jerbot Sep 12 '15 at 02:14
  • You may be able to set it in the installation to use that partition as /home, just make sure you DO NOT FORMAT it or else you will lose it all. You'll have to do manual partitioning, or automatic with review and edit. – Daniel Sep 12 '15 at 17:05
  • This worked mostly. I have 2 users on the /home disk. I set up the primary user during install to match the primary one for the previous install, and that worked just fine. Once Ubuntu was installed I set up the 2nd user, but when logging in, it only flickered the screen and brought me back to the login page. There may be issues with the fs/disk, because there were a couple hiccups when backing up this user, so this issue may not be related. Thanks for the help! – Jerbot Sep 12 '15 at 20:38
  • OK. good luck then! – Daniel Sep 13 '15 at 00:34
0

Note: This is changed after installation of Ubuntu!

To make a more specific answer, do this (change it to your desired text editor, I'll be using emacs)

sudo emacs /etc/fstab

And at the end there should be something that looks like this:

/dev/sda1       /home      ext4    defaults  0   0

Now simply replace /dev/sda1 with your desired partition. To find all of your connected harddrives do

df -a

And there you can find it's /dev/sd(variable name.) After you do that, save exit, and do

mount -a

You're done and your home directory should be moved!

David
  • 3,367
  • Excellent. I'll be trying this tomorrow. – Jerbot Sep 12 '15 at 04:15
  • df? Why df? If the partition isn't mounted, the command is useless to get information for a non-mounted partition. – A.B. Sep 12 '15 at 09:12
  • I've seen other answers state that it is recommended to mount /home during install if it is simply on another partition. I'm wondering if this is possible/recommended for when it has a dedicated disk. – Jerbot Sep 12 '15 at 16:40
  • @SuperJer I have 3 hard drives. 1 for my boot, one for my /home folder and 1 for videos. I installed Ubuntu onto the boot, and that's where the Home directory was until I changed it, with no errors. So no, at the beginning, I would say do not try to partition a separate disk for home. Do it once you have a better GUI, and AI to use like gparted for example – David Sep 13 '15 at 03:00