mtab is overwritten - how is a second drive added?


Forum: HD Install
Topic: mtab is overwritten - how is a second drive added?
started by: Malc

Posted by Malc on Nov. 28 2006,10:49
On my mandrake system I can add a second hardrive by editing /etc/mtab and adding a line such as
/dev/hdb1 /home rw 0 0
When the system reboots the drive is found mounted at the location in this case /home.

How is this done with DSL?  The problem found is that the line added to mtab is lost during the next boot.  /etc/mtab appears to be rewritten.

The DSL system used is the result of an hdinstall which followed the instructions found on the DSL opening html page (with the 300Mb partition).

It boots without a problem and the additional drive can be mounted manually with
mount /dev/hdb1 /home

The reason for adding the drive this way is so that any user data is kept on a separate drive to the operating system.

What is the method for adding a drive so that it is correctly added during boot?

Thanks
Malc

Posted by ^thehatsrule^ on Nov. 28 2006,13:58
I think you meant /etc/fstab , as mtab only lists mounted devices...

If you did a traditional debian-style hd-install, editing that fstab file should work instead.

If you did some frugal installation, booting with home= should work (might also work for a debian-style install too).

Posted by roberts on Nov. 28 2006,14:03
/etc/fstab will be rewritten upon a reboot.
Use the boot option nofstab to prevent this.

Posted by Malc on Nov. 28 2006,16:35
Thanks for you replies and in reply here's what I tried.

edited /etc/fstab to add the line
/dev/hdb1 /home ext2 rw 0 0

edited /boot/grub/menu.lst, the DSL option used at boot
add 'home=/dev/hdb1' and 'nofstab' as parameters in the line
And noted that there is 'frugal' at the end of the line. (I'll look for info about frugal).

after boot
cat /etc/mtab
doesn't show /dev/hdb1 as mounted.
ls -al /home
doesn't show the user directory dsl that should be there
then
mount /dev/hdb1
finds /dev/hdb1 at /home in mtab and ls /home finds the dsl directory and files.

It seems that /etc/fstab is not used for mounting devices until after boot.  There's a script /etc/init.d/checkroot.sh that does something with mtab at the end of it.

Posted by Malc on Nov. 28 2006,16:59
Looking in the FAQs the section about VNC describes howto execute commands at boot.

Therefore add the line
mount /dev/hdb1 to the file /opt/bootlocal.sh

This was tested and now the second hard drive gets mounted at the correct mount point at boot.

Problem Solved and thanks for the the essential supporting tips.

Posted by ^thehatsrule^ on Nov. 28 2006,18:52
Well the thing is, I don't think you were supposed to use BOTH nostab and home= together.

If you did use just nofstab, and did backup/restore /etc/fstab, maybe that fstab line needed to be changed.. maybe add defaults to options.

But as long as it works :)

Posted by kamaradski on Dec. 09 2006,00:05
just have " nofstab" and edditing the fstab, will not make it mount-on-boot.
jou still have to add " mount -a"  to the boot script.
then it will work.

greets
kamaradski

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.