LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   how do I set /home on another partition? (https://www.linuxquestions.org/questions/linux-general-1/how-do-i-set-home-on-another-partition-906609/)

newbiesforever 10-05-2011 12:50 PM

how do I set /home on another partition?
 
I recently started keeping /home on a different hard drive partition. But on my latest reinstallation of one of the distros I use (heavily modified antiX), I forgot to specify where /home would be located, so it was of course installed on the same partition. Now that installation is complete and I am running the installed distro, how can I change the location of /home to the partition where I wanted it? I tried "adduser" with --home /sda1, but that didn't work (I didn't think it would)...

Snark1994 10-05-2011 01:00 PM

If I understand you correctly, you would need to create a partition on sda (if that's your new drive), copy all the files from /home into that partition, then edit your /etc/fstab file to mount /dev/<new partition> as /home. For example, my fstab:

Code:

#
# /etc/fstab: static file system information
#
# <file system>        <dir>        <type>    <options>          <dump> <pass>
devpts                /dev/pts      devpts    defaults            0      0
shm                    /dev/shm      tmpfs    nodev,nosuid        0      0
/dev/sda12 /boot ext4 defaults 0 1
/dev/sda5 swap swap defaults 0 0
LABEL=ARCH / ext4 defaults 0 1
/dev/sda6 /home ext4 defaults 0 1

Here, I'm mounting /dev/sda6 onto /home with the ext4 file system - you'd replace sda6 with whatever the name of your new home partition is.

Hope this helps,

newbiesforever 10-05-2011 01:18 PM

The partition is already prepared. So I just add "/home" to the relevant line in fstab? I see, thanks.

TobiSGD 10-05-2011 01:30 PM

You also should move over (not copy) the files in your actual /home to the partition you want to use for /home, so that your users configuration files will be there.


All times are GMT -5. The time now is 11:56 AM.