LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Setting up /home on another drive (https://www.linuxquestions.org/questions/linux-newbie-8/setting-up-home-on-another-drive-103690/)

Gomi 10-14-2003 01:56 AM

Setting up /home on another drive
 
I've just reinstalled Win98 & RH9.

With Win98 I have 2 partitions C & D.
With RH9 I want / /var and /home. The first two were done when I installed RH9, but I couldn't do /home at that time because I wanted D and /home to be the same drive.

Would I set up /home to hda? in fstab, and is there anything I need to watch out for?
Or is it done with GRUB, and how do I edit things in GRUB?

Slacker_Rex 10-14-2003 06:27 AM

You can set up home on your D drive. I don't know how RH will feel about settingit up on a Win partition (linux does not get along real good with NTFS as I understand it). All you have to do is make an empty directory (monut point) in your / with the command mkdir home. Once you have done that, add the line below to your /etc/fstab (or wherever RH puts it'st fstab).

/dev/hda2 /home vfat rw,umask=000,noexec 1 0

The example above mounts a Fat32 Filesystem. I beleive instead of vfat, you would use ntfs for the ntfs.

Good Luck

maroonbaboon 10-14-2003 07:47 AM

Or do you have a linux partition on your second drive you want to make /home? That should be really easy. Just mount that partition somewhere e.g.

# mount /dev/hdb2 /mnt

Then copy the files across:

# cd / ; tar cf - home | ( cd /mnt ; tar xvf - )

Watch the files whizz past. You should now have all you /home stuff also in /mnt/home

Then edit /etc/fstab to show the new location of /home, and reboot. Wait a while to see if everything is OK, then you can delete your old /home.

P.S. Before you reboot better rename /home to something else (like /oldhome) and make a new empty /home. Otherwise the new partition will mount on top of the old /home and you won't be able to access/delete it.

aqoliveira 10-14-2003 08:47 AM

Howzit

do all the above just one more thing if u want to have /home and not /mnt/home do the following delete old /home after moving everything to /mnt/home then create ln -s /mnt/home /home. this cmd will create a link to /mnt/home and all the users on the system will work on /home but this is actually pointing to /mnt/home making it oblivious to them.

chow

maroonbaboon 10-14-2003 09:58 PM

Yes I guess aqoliveira is right, you can just link to the new copy of home. But you still have to mount /mnt/home in /etc/fstab, and you might as weil mount it as /home rather than use the link. There was something wrong with my file copying command tho'. Mounting /home/someuser on /home puts it at /home/home/someuser, so I guess you should not copy the 'home' directory itself, and instead do

# cd /home ; tar cf - * | ( cd /mnt ; tar xvf - )

to transfer all the directories in /home to the new partition. Then rename original /home to /oldhome, make a new empty /home on the first disk and add a line in fstab to mount the new partition over the empty /home.

Gomi 10-15-2003 06:00 PM

Quote:

Originally posted by Slacker_Rex

/dev/hda2 /home vfat rw,umask=000,noexec 1 0

I had a look at fstab last night and the entry for /var was
LABEL=/var /var auto ...... 1 2


I'm just wondering what the last two numbers on the fstab entry mean. (I couldn't find much in the man pages)

Thanks for your help.

michaelk 10-15-2003 07:30 PM

the first number is used by the dump command.
http://www.ussg.iu.edu/usail/man/linux/dump.8.html

The second number is a priority number used by fsck for filesystem checks during boot. If you see a maxium mount check and fsck running messages thats what determines which ones to check and what order. 1 is for root and 2 is for any other linux partition. Use 0 for non linux partitions like ntfs, vfat and CDs etc.

Gomi 10-26-2003 01:26 AM

is there somewhere else?
 
Thanks for all your replies. I've on setup fstab with for the home directory, and I now have the internet oworking at home. So I'm feeling good this weekend.

But I had another look at fstab...

LABEL=/ / ext2 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
LABEL=/var /var ext2 defaults 1 2
/dev/hda7 swap swap defaults 0 0
/dev/hda5 /home vfat defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
/dev/hda1 /mnt/Win98 vfat defaults 0 0
/dev/hda5 /mnt/temphome vfat defaults 0 0

and it's the two lines with LABEL= I don't understand. Given what I've seen so far why wouldn't /var be
/dev//hda? /var .....
like I've done for /home.

It seams to me that / & /var are both defined else were, possibly in grub. Does any one know, because I don't know where to start.

Thanks,
Gomi

michaelk 10-30-2003 07:16 PM

You can assign labels to ext2 partitions just like in windows. When Redhat boots it looks for the label and not the partition ID. Of course you can still use /dev/hdxy to assign mount points.

The command is e2fslabel. I think you can also use tune2fs too.

The advantages to this method would be if you moved partitions around you wouldn't have to always edit the fstab file. The disadvantage would be if you had more then one RH version loaded you would get errors with multiple partitions with the same label.


All times are GMT -5. The time now is 09:54 PM.