LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   mount point for second hard drive (http://www.linuxquestions.org/questions/linux-hardware-18/mount-point-for-second-hard-drive-747910/)

zogthegreat 08-16-2009 08:45 AM

mount point for second hard drive
 
Hi everyone,

I am trying to mount a second hard drive on a clean install. Here is my hardware;

Gigabyte MA770-UD3 w/ Phenom 9950 BE
6 gig Corsair 800 mhz DDR2
1 x 40 gig Seagate SATA
1 x 500 Seagate SATA
Fedora 11

What I want to do is install my OS on the 40 gig and mount the 500 gig as my /home.

If I mount it after I install, I my home directory is deleted. I know I can just create a mount point and mount it there, but I would really prefer to mount it as /home.

Any suggestions?

Thanks

weibullguy 08-16-2009 08:59 AM

Guess I don't really understand what you mean your "home directory is deleted." A line similar to the following in /etc/fstab will get your second drive mounted at /home
Code:

/dev/sdb1        /home      ext3        defaults      0  1
If there are already directories and files under /home (e.g., you've already created a non-root user), mount your second hard drive somewhere (e.g., /mnt/sdb) and copy everything under /home to the second drive. Unmount the second drive from the temporary mount point and re-mount it at /home. You should see everything that was in /home.

zogthegreat 08-16-2009 09:11 AM

Hi weibullguy,

What I mean by deleted is that the profile for any user is deleted form the home directory, i.e., if the user "test" is installed, then "test's" home directory is deleted when I mount the drive. I have tried the following mount points:

/dev/sdb1 /home ext3 defaults 0 0
/dev/sdb1 /home/test ext3 defaults 0 0

with the same results.

I am trying what you suggested, however, Nautilus is telling me that it is copying 195 gig form a 40 gig hard drive?!?! (I copied the hidden files also).

The problem with fedora is that it won't let you log in as root after the install, instead it forces you to create a user account, then log in as that user.

weibullguy 08-16-2009 10:14 AM

That's what I thought you might have meant. Obviously, as you have figured out, the data is not really deleted. When you mount the second HDD at /home, there is nothing to "see" because there is nothing on the second HDD. Copying what exists under /home on the first HDD to the second HDD will resolve the problem.

Even if you can't login as root from GDM, you should be able to switch user (su) to root in a terminal. Open a terminal and try this
Code:

su -l
mkdir /mnt/sdb
mount /dev/sdb1 /mnt/sdb
cp -Rpv /home/* /mnt/sdb
umount /dev/sdb1
mount /dev/sdb1 /home
vim /etc/fstab
exit

You will prompted for the root user password after the first command. Replace /dev/sdb1 and vim with the appropriate device and your favorite text editor. When you edit /etc/fstab, add a line similar to the one in my first post to make sure your second HDD mounts at /home every time you boot.


All times are GMT -5. The time now is 07:57 AM.