LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Trouble mounting other Linux patitions automatically. (https://www.linuxquestions.org/questions/linux-newbie-8/trouble-mounting-other-linux-patitions-automatically-460463/)

sr_25 07-03-2006 12:08 AM

Trouble mounting other Linux patitions automatically.
 
By doing some searching on this board I thought I had figured out how to mount my partitions, but I apparently need some help. It doesn't always work. Now for some background while in Slack:

Distro: Partition: Type:
FC5 /dev/hda1 Ext3
Slackware 10.2 /dev/hdb6 reiserfs
SUSE 10.1 /dev/hdb7 reiserfs
Arch .7.1 /dev/hdb8 jfs

Here is my current fstab:[HTML]/dev/hdb5 swap swap defaults 0 0
/dev/hdb6 / reiserfs defaults 1 1
/dev/hdb14 /shared vfat rw,auto,user 1 0
/dev/hda1 /FC5 ext3 rw.auto.user 1 1
/dev/hda5 /win98temp auto rw,auto,user 1 0
/dev/hdb7 /SUSE rieserfs rw.auto.user 1 0
/dev/cdrom /mnt/cdrom auto rw,auto,user 0 0
/dev/fd0 /mnt/floppy auto rw,auto,user 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0[/HTML]

This is how I went about it:
Open Konsole as root.
[HTML]mount -t reiserfs -o defaults,rw /dev/hdb7 /mnt/SUSE[/HTML]

I then opened /mnt and clicked on SUSE in Konqueror, and it allows me to browse that partition.

I then did the same thing for FC5:
[HTML]mount -t ext3 -o defaults.rw /dev/hda1 /mnt/FC5[/HTML]

When I click on FC5 in /mnt it appears as nothing is there!

So I tried it through konsole again:
[HTML]mount -t ext3 -o defaults,rw /dev/hda1 /mnt/FC5[/HTML]

Now this works until I reboot.:(
Would one of you Gurus please point me in the right direction?

/edited
For the stupid typo's you guys pointed out!

DaneM 07-03-2006 12:45 AM

Hello. I'm not exactly a Guru, but I'll try to answer your question. :-)

The first thing that I saw that looked fishy is that the partitions you mentioned in the beginning do not correspond with the partitions that you're issuing commands for. In the beginning of your post, you had FC5 at hda1, but at the end, you have it at hdb7. Is this intentional? Is sounds to me that you have more partitions than you mentioned in the initial post. Please post the output of the following command for each drive you have:

Code:

fdisk -l /dev/hdx
...so the first command should be, "fdisk -l /dev/hda", then do it for /dev/hdb, and so on. This will give you a complete listing of your partitions.

Next you will have to post which ones are the root partitions for your various Linux installations. Each one will have an fstab. You can use their fstabs to help you write your own. Keep in mind, though, THE OPTIONS WILL BE DIFFERENT depending on which partition you are booting into. For example, the /, /boot, and /home partitions of each installation will need to be checked for consistency only if they are the ones being booted from. (There will be something like, "0 1" or "0 2" at the end of the fstab line for them.) They should probably not be messed with in such a manner when you are not booting from them (although I'm not entirely sure on this point, so you might want to ask/look elsewhere). Also, for reasons that should be obvious (feel free to ask if they are not), the "/" partition for one installation will not be "/" for another.

Please post the above info and take a crack at making up an fstab based on it. (Back up your current fstab!) Let me know whether it works, or whether you still need help.

--Dane

fotoguy 07-03-2006 12:55 AM

Your /dev/cdrom and /dev/fd0 should be set to noauto instead of auto, unless you have media in them everytime you boot up your machine it may cause problems trying to mount something that is not there, Also setting all hard drive partitions to 'defaults' may also help to mount the partitons properly. Here is a copy of my fstab file:

/dev/hda1 swap swap defaults 0 0
/dev/hda2 / reiserfs defaults 1 1
/dev/hda3 /mnt/hda3 reiserfs defaults 1 2
/dev/hda4 /mnt/hda4 reiserfs defaults 1 2
/dev/hdd1 /mnt/windoze ntfs ro 1 0
/dev/cdrom /mnt/cdrom iso9660 noauto,owner,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0

With these entries in your fstab file you should not need to type them in manually, when the system boots up it reads the fstab file to mount the partitions and devices to load the OS.

rhoekstra 07-03-2006 01:54 AM

DaneM is hitting the nail I guess.

There is indeed some inconsistency in your story.. The way I interpret what you did was mount /dev/hda1 at /mnt/FC5 which appeared to be empty, is FC5 installed?
Next you tried to mount /dev/hdb7 on /mnt/FC5, which worked.. your story starts with telling that /dev/hdb7 has SUSE on it, are you sure you see SUSE now or FC5 ?

when you want to know what is currently mounted, just type 'mount'. this is the accurate mount state and not the configured state. so when you mounted /dev/hda1 to /mnt/FC5, what did 'mount' tell you, in relation to /mnt/FC5 ?

if you are sure that /mnt/FC5 contains FC5 files on hdb7, make adjustments to your fstab to read
Code:

/dev/hdb7        /FC5                ext3          rw.auto.user        1  1
You might want to reconsider where your SUSE partition is, then.

Does this point you in a better direction?

PS. with 'fdisk -l' without device specification, all devices will be shown.. :)

sr_25 07-03-2006 05:06 PM

Thanks to everyone, I was probably just really tired when I typed that. I will double check what I have done and make sure I was issuing the correct commands. If I still have trouble I'll post again. Thanks fotoguy I'll make the corrections you suggested.

sr_25 07-04-2006 12:03 AM

Here is my fstab:
[HTML]
/dev/hdb5 swap swap defaults 0 0
/dev/hdb6 / reiserfs defaults 1 1
/dev/hdb1 /shared vfat rw,auto,user 1 0
/dev/hda1 /FC5 ext3 rw.auto.user 1 1
/dev/hda5 /win98temp auto rw,auto,user 1 0
/dev/hdb7 /SUSE reiserfs rw.auto.user 1 0
/dev/cdrom /mnt/cdrom auto rw,noauto,user 0 0
/dev/fd0 /mnt/floppy auto rw,noauto,user 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
[/HTML]

This line enables me to browse the '/' FC5 partition:
[HTML]mount -t ext3 -o defaults,rw /dev/hda1 /mnt/FC5[/HTML]

This line enables me to browse the '/' SUSE partition:
[HTML]mount -t reiserfs -o defaults,rw /dev/hdb7 /mnt/SUSE[/HTML]

Here is the fdisk -l output:
[HTML]
Disk /dev/hda: 10.2 GB, 10254827520 bytes
255 heads, 63 sectors/track, 1246 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 997 8008371 83 Linux
/dev/hda2 998 1246 2000092+ f W95 Ext'd (LBA)
/dev/hda5 998 1246 2000061 c W95 FAT32 (LBA)

Disk /dev/hdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 1 8001 c W95 FAT32 (LBA)
/dev/hdb2 2 9729 78140160 5 Extended
/dev/hdb5 2 98 779121 82 Linux swap
/dev/hdb6 99 969 6996276 83 Linux
/dev/hdb7 970 1840 6996276 83 Linux
/dev/hdb8 1841 2711 6996276 83 Linux
/dev/hdb9 * 2712 3582 6996276 83 Linux
/dev/hdb10 3583 4453 6996276 83 Linux
/dev/hdb11 4454 5324 6996276 83 Linux
/dev/hdb12 5325 6195 6996276 83 Linux
/dev/hdb13 6196 7066 6996276 83 Linux
/dev/hdb14 7067 9729 21390516 c W95 FAT32 (LBA)
[/HTML]

My question is shouldn't I be able to automatically browse these partitions, because they are listed in my fstab with the 'auto' option? If not how do I accomplish this?
Please forgive the typo's in my first post as I am sure this made it impossible to figure out!

DaneM 07-04-2006 12:56 AM

Hello.

I noticed that you have what appear to be some more typos in your fstab. Try changing it to this (but back up your old one!):

Code:

/dev/hdb5  swap  swap  defaults  0  0
/dev/hdb6  /  reiserfs  defaults  0  1
/dev/hdb1  /shared  vfat  rw,auto,user  0  0
/dev/hda1  /mnt/FC5  ext3  rw,auto,user  0  2
/dev/hda5  /win98temp  auto  rw,auto,user  0  0
/dev/hdb7  /mnt/SUSE  reiserfs  rw,auto,user  0  0
/dev/cdrom  /mnt/cdrom  auto  rw,noauto,user  0  0
/dev/fd0  /mnt/floppy  auto  rw,noauto,user  0  0
devpts  /dev/pts  devpts  gid=5,mode=620  0  0
proc  /proc  proc  defaults  0  0

The changes I made (which you can also check using the "diff" command) are,
(1) replacing some periods with commas in the option lists;
(2) changing the mount directories to better reflect the working commands you gave;
(3) changing all the 1s in the 5th field to 0s (you only need 1s there if you backup your drives using the "dump" command; see "man fstab" and "man dump");
(4) changing the 1 in the 6th field on the FC5 line to a 2, so that it will be checked AFTER the root partition is checked, and not at the same time or before; and
(5) changing (in the 3rd field of the cdrom and floppy lines) "auto" to "noauto". Unless you always boot with a CDROM and a floppy in the drives, this is only slowing down boot time.

Give that a try and let us know if it works for you.

--Dane

Edit: corrected as per the following two posts.

rhoekstra 07-04-2006 01:19 AM

DaneM, what is the reason for the /mnt/cdrom to set the filesystem from 'auto' to 'noauto' ?? I have 'auto' as well... (not mentioning the option noauto, what stands for no automatic mount)

DaneM 07-04-2006 02:10 AM

Whoops, edited the wrong field. You're right; the filesystem should be "auto". The option should say "noauto" (which it does). Sorry.

--Dane

sr_25 07-04-2006 02:30 AM

Thanks for your post DaneM. I don't like the font I am currently using. I guess I better find one that's a little clearer, My comma's and periods look the same unless you look real close!

/edit
I turned on anti-aliasing, and it is a little clearer now!


All times are GMT -5. The time now is 08:42 PM.