Ask Your Question

Is there a way to mount hard drive to /home after install?

asked 2013-10-24 10:59:36 -0500

zedd2006 gravatar image

So heres my issue. I have Ubuntu 13.04 right now... I'm fed up with their BS. I want to switch to fedora. When i try to boot up the live cd i get a grey screen. I need to turn intel setting off in grub. First i need to know how i do that AFTER install to make it permanent. Second. My current hard drive has A LOT of data. about 750GB of 1TB. I have nothing to back up too. So i was thinking of a installing to a 160gb HDD i have laying around. But after install i was wanting to know if i could mount my 1TB as my home folder to have a seamless look to my media. My wife uses this PC also and she isn't exactly the brightest light bulb in the box when it comes to computers, if you get my drift.

I know i can mount the hdd to home during install but to my knowledge that requires a format. Again, i cant format this 1TB drive. Does anyone have any solutions?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2013-10-24 11:52:26 -0500

cobra gravatar image

updated 2013-10-24 14:40:48 -0500

I don't know about the grub change you want to make, but mounting /home after the event is easy. Here's how you do it.

Before you start you want to ensure that after install, when you create the new user, you re-use the UID and GID that your previous system assigned to your username. The reason you do this is because it's easier than using 'find' to go change the UID and GID of files in your existing home to new values (you don't have to do that, of course, you can still go ahead with using 'find' if you want).

Install your new OS without the old drive attached, and after its reboot create your new user credentials using your old UID/GID (if you're doing that). Shut down the computer, connect the old hard disk and restart.

When it boots up, log in to the text console as the root user. Remove any constructed /home/<username> directory, and add an entry to the file /etc/fstab that looks a bit like this:

/dev/sdb1     /home    ext4   defaults  1 1

Your newly-connected old disk might not be at /dev/sdb1, and it might have a different filesystem to ext4. But I'm sure you can work out the right incantation.

Save out the fstab file, and you should be able to mount the drive with mount home.

You should now be able to flip back to your X display and log in as your old user. One final test is to reboot and ensure you can still log in - you newly-connected drive should be automatically mounted and you should be able to log in again normally.

edit flag offensive delete link more



You’ve got /home and /dev/sdb1 the wrong way round in your /etc/fstab example. Also, it may be worth suggesting UUID=… instead of /dev/sdb1, using blkid /dev/sdb1.

Gareth Jones gravatar imageGareth Jones ( 2013-10-24 12:24:40 -0500 )edit

You know what... you're absolutely right. Good spot! I've fixed it now. I typed that from memory, perhaps my memory isn't what it used to be ;) Using the UUID is fine if you know what it is, but if you're typing it by hand in vim, then it's easy to get it wrong.

cobra gravatar imagecobra ( 2013-10-24 14:40:14 -0500 )edit

There's a much better, safer way to do this. First, use the complete install DVD, not a LiveCD because this way you can customize as you install instead of only getting whatever's on the CD. When you do, you can select that partition to be /home, but specify that you don't want it reformatted. This will get the proper entry in /etc/fstab, and I know it works, because I've done it several times. Last, if you find that the UID/GID for the new system doesn't match the old, look up, a script to get everything back in sync.

sideburns gravatar imagesideburns ( 2013-10-24 16:53:49 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2013-10-24 10:59:36 -0500

Seen: 2,066 times

Last updated: Oct 24 '13