Operating System - HP-UX
1822204 Members
4175 Online
109640 Solutions
New Discussion юеВ

order of mounting in /etc/fstab

 
Andrew_4
Honored Contributor

order of mounting in /etc/fstab

Hi everyone...

I've got a loopback FS setup as the last entry in /etc/fstab, but it mounts before the 'special directory' gets mounted (which is listed earlier in the /etc/fstab... !

I always thought that I could alter the order of mount by changing the /etc/fstab... but it seems that it not always the case.

I've noticed in the man 1m mount :

"File systems are not necessarily mounted in the order listed in /etc/fstab."

Is there a way to change the order, if I can't rely on /etc/fstab ? What are the 'internals' of this mount procedure reading the /etc/fstab ?

Thanks for your help! points will be awarded.

Andrew

The Unix Programmer's Manual, 2nd Edition, June, 1972: "The number of Unix installations has grown to 10, with more expected."
9 REPLIES 9
Animesh Chakraborty
Honored Contributor

Re: order of mounting in /etc/fstab

Hi Andrew,
Good question!
Try man page of getmntent and getfsmnt.

This may give some idea.


best of luck
Animesh
Did you take a backup?
Ravi_8
Honored Contributor

Re: order of mounting in /etc/fstab

Hi, Andrew
nice question.
file systems are not necessarily to mount as shown in fstab file. when the system boots the required file systems are mounted according to necessity, as for as i know / will be mounted first, followed by /usr,/tmp rests of the file systems are afterwards.
never give up
eran maor
Honored Contributor

Re: order of mounting in /etc/fstab

Hi

i look at the man page of the fstab and over there the said :
The order of entries in /etc/fstab is important only for entries
without a pass number field. Entries without a pass number are
sequentially checked by fsck (see fsck(1m)) after the entries with a
pass number have been checked.

i didnt found any guideline how the order need to be but i recomment that all the nfs and cdrom filesystem will be and the end of the file .
love computers
Victor BERRIDGE
Honored Contributor

Re: order of mounting in /etc/fstab

Hi,
I used to use a sequence number, if I remember right Id say its the last number you see on each line of fstab which used to be the priority (HPUX 9 ? ) so I would put give a 2 to the one you want mounted first and 4 for the one that shoud be mounted after, lest me check...
/dev/r5vg01/lvol1 /opt/oracle vxfs rw,suid,delaylog,datainlog 0 2
/dev/r5vg01/lvol2 /opt/oracle/product/7.2.3 vxfs rw,suid,delaylog,datainlog 0 3

Nerver failed yet...

All the best
Victor
harry d brown jr
Honored Contributor

Re: order of mounting in /etc/fstab

Victor, we use the same method, by adding a "mount order" (PASS NUMBER for fsck) number at the end of the fstab entries and it hasn't failed us either (yet ?).
Live Free or Die
harry d brown jr
Honored Contributor

Re: order of mounting in /etc/fstab

Also, if you use the "Pass Number", make sure you do not set any to zero, because fsck will ignore those.
Live Free or Die
Andrew_4
Honored Contributor

Re: order of mounting in /etc/fstab

Thanks you all for your suggestions.. but the 'pass' option in the /etc/fstab only affects the order of the fsck'ing, and doesn't affect the mount order.

I understand that it will take a fraction of a second longer to mount a large file system, than it will to mount a loopback... which means this problem could be experienced by many who use loopback filesystems. But it doesn't seem that loopback file systems have any functionality to delay the mounting...

Doesn't look like there is an solution to this problem !!

Looks like i'm going to have to script in the mounting of loopback into the RC scripts.

Andrew
The Unix Programmer's Manual, 2nd Edition, June, 1972: "The number of Unix installations has grown to 10, with more expected."
jago_1
New Member

Re: order of mounting in /etc/fstab

I need to know this because....

I am mounting

/ hda6
/usr sdb3
/usr/portage sda1

So they need to go in that order.

I'm amazed this can't be done!!
Bill Hassell
Honored Contributor

Re: order of mounting in /etc/fstab

The actual order is indeterminate (see the man page for mount_vxfs and fstab). However, mount seems to be consistent so you can move the dependent entries around (usually towards the top, above the parent directory's mountpoint) until it mounts in the right order.

The alternative is to use the noauto option in fstab and use a startup script to mount it in the right order.


Bill Hassell, sysadmin