LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   change /home to another partition (https://www.linuxquestions.org/questions/linux-newbie-8/change-home-to-another-partition-471724/)

ovl 08-07-2006 04:49 PM

change /home to another partition
 
hello,

my partitioning looks like this

Code:

Filesystem            Size  Used Avail Use% Mounted on
/dev/hda1            989M  160M  779M  17% /
none                  502M    0  502M  0% /dev/shm
/dev/hda5            4.9G  1.3G  3.7G  26% /usr
/dev/hda7              62G  1.1G  61G  2% /var
/dev/hda6            4.9G  148K  4.9G  1% /home

i want to change that /home is accessing the 62G Partition, it should share it with /var

is this possible? when yes, someone can tell me how please!

Penguin of Wonder 08-07-2006 07:29 PM

Yes, it should be possiable. You need to rewrite your fstab to make /home the 62G parition. I'd just switch them if I were you, make sure you cut and paste everything off of one and onto the other.

timrs 08-07-2006 11:48 PM

Fstab
 
I think the fstab may get reverted back --- wouldn't it be better to copy /home to /var/home and then delete /home and do something like
Code:

ln -s /var/home /home
(maybe backwards)

Penguin of Wonder 08-08-2006 12:41 AM

timrs has the better idea this. I concede.

b0uncer 08-08-2006 12:59 AM

Some thoughts on this..

I myself would do the job using a LiveCD. This ensures there are no files open so no data loss is coming. Symlinking shouldn't be needed as far as I know, just moving the data and editing fstab to point to the correct location should be possible. In your case you could possibly even switch /var and /home since /var seems to be small enough to fit into hda6, and /home might need the space at hda7 at some point. Though if /var grows big some day, you need to do some tricks.

Unfortunately I have no experience on how multiple mountpoints on the same partition work (well I have some, actually, but it was unintended and I didn't study that much), but on the other hand I see no problem there. Switching /var and /home partitions would be my choice here.

Keep in mind, also, that if you're using LVM (Logical Volume Group), you'd better read how it reacts if you do a sudden change. LVM makes it possible to do some nice stuff but I've got no idea how it works in this case (sorry, haven't had time to get deeper into that yet).

If you were on a regular "good old" system, you could probably just (using a LiveCD, perhaps) move the /var directory contents to hda6 and /home to hda7, then switch these two in fstab, reboot and see if it worked. But nowadays with all these fancy systems around, taking care of your partitioning and mounting for you, it just might need a bit more care.

Good luck anyway, it shouldn't (no matter what it sounds) be a difficult task. After all it's all just about telling the operating system where the data resides..

jschiwal 08-08-2006 01:40 AM

You could simply create a /var/home partition, and then copy the contents of /home/ to /var/home. Then change the /etc/fstab entries so that everyones home directory is in /var/home.

So you would change an entry like:
jim:x:1001:100::/home/jim:/bin/bash
to
jim:x:1001:100::/var/home/jim:/bin/bash

timrs 08-14-2006 11:27 PM

That sounds like the best way to go.


All times are GMT -5. The time now is 02:37 AM.