LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-07-2006, 04:49 PM   #1
ovl
LQ Newbie
 
Registered: Aug 2005
Posts: 10

Rep: Reputation: 0
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!
 
Old 08-07-2006, 07:29 PM   #2
Penguin of Wonder
Senior Member
 
Registered: Sep 2005
Location: West Virginia
Distribution: Gentoo
Posts: 1,249

Rep: Reputation: 45
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.
 
Old 08-07-2006, 11:48 PM   #3
timrs
Member
 
Registered: Nov 2005
Location: MN, US
Distribution: openSuse 10.2
Posts: 93

Rep: Reputation: 15
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)
 
Old 08-08-2006, 12:41 AM   #4
Penguin of Wonder
Senior Member
 
Registered: Sep 2005
Location: West Virginia
Distribution: Gentoo
Posts: 1,249

Rep: Reputation: 45
timrs has the better idea this. I concede.
 
Old 08-08-2006, 12:59 AM   #5
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
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..
 
Old 08-08-2006, 01:40 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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
 
Old 08-14-2006, 11:27 PM   #7
timrs
Member
 
Registered: Nov 2005
Location: MN, US
Distribution: openSuse 10.2
Posts: 93

Rep: Reputation: 15
That sounds like the best way to go.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/home seperate partition from previous install, make it new /home in new install mipia Slackware 5 06-21-2004 10:57 PM
How to change the home? x5452 Linux - General 2 04-15-2004 08:19 AM
how to change location of /home? mark_2811 Linux - General 4 01-23-2004 06:19 AM
Partition Free Space - Move /home to the new partition gregkise Linux - General 5 12-16-2003 10:19 PM
Change the size of /home? srichter Linux - Software 5 05-30-2003 12:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration