LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Any way to change what partitions /home is on without reinstalling? (https://www.linuxquestions.org/questions/slackware-14/any-way-to-change-what-partitions-home-is-on-without-reinstalling-292675/)

DraaX 02-20-2005 01:40 PM

Any way to change what partitions /home is on without reinstalling?
 
Hey slackers.

I am just curious if there is any way to change which partition my /home directory is on without reinstalling. I put my /home directory on a partition with very little space and want to put it onto the same partition as my root directory. Is this possible without a reinstall?

Thanks in advance.

draAx

michaelk 02-20-2005 02:33 PM

Sure,
As root, unmount /home and mount it somewhere else like /mnt/oldhome. Using the cp command
cp -dpR /mnt/oldhome/* /home/

DraaX 02-20-2005 02:58 PM

Quote:

Originally posted by michaelk
Sure,
As root, unmount /home and mount it somewhere else like /mnt/oldhome. Using the cp command
cp -dpR /mnt/oldhome/* /home/

Excellent, this sounds like what I want to do. I will try this as soon as I get home.

Will this command make sure that my /home remains on the other partition even after a reboot?

Thanks a billion

draAx

btmiller 02-20-2005 03:16 PM

No, you'll need to edit /etc/fstab to give the correct location of the new partition to be mounted as /home.

michaelk 02-20-2005 03:20 PM

Oops... btmiller is correct I forget a step. But all you need to do is delete the entry in the /etc/fstab file for the /home partition. Since your copying the files to the / partition you do not need another entry.

If you remove the /etc/fstab for /home the original data will remain intact. You can always mount it to another directory.

coffeedrinker 02-20-2005 03:23 PM

You can also move it and then link it. FreeBSD did this (does this?) by default (back when I used it).

So you could mount your other drive/directories anywhere you wanted and then make links in /home to the whole thing or particular users directories.

I did something like this once for ftp on a separate drive.

DraaX 02-20-2005 06:53 PM

Thanks for the replies!!

So if I understand this correctly I should copy my whole /home folder to say /mnt/homeold by using the command

Code:

cp -dpR /mnt/homeold/* /home/
Then I should remove the /dev/hda6 from my fstab below:

Code:

/dev/hda8        swap            swap        defaults        0  0
/dev/hda7        /                reiserfs    defaults        1  1
/dev/hda6        /home            reiserfs    defaults        1  2
/dev/hda1        /win-c          vfat        defaults        1  0
/dev/hda5        /win-d          vfat        defaults        1  0
/dev/hdc        /mnt/cdrom subfs fs=iso9660  users,ro        0  0
/dev/cdrom      /mnt/cdrw subfs fs=iso9660  users,ro        0  0
/dev/fd0        /mnt/floppy      auto        noauto,owner    0  0
devpts          /dev/pts        devpts      gid=5,mode=620  0  0
proc            /proc            proc        defaults        0  0

Now what should I do so my data in /mnt/homeold is recognized as being in /home?

gnashley 02-21-2005 12:01 AM

remove or comment out the line for /dev/hda6 so that the data you see is what is in /home and not that in /hda6

kornerr 02-21-2005 11:32 AM

type:
man fstab


All times are GMT -5. The time now is 08:00 AM.