1833053 Members
2526 Online
110049 Solutions
New Discussion

Re: difference

 

difference

can i know the difference between mnttab and fstab files
9 REPLIES 9
harry d brown jr
Honored Contributor

Re: difference

man mnttab

live free or die
harry
Live Free or Die
melvyn burnard
Honored Contributor

Re: difference

you can if you do:
man mnttab
man fstab
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Dave Unverhau_1
Honored Contributor

Re: difference

The man page says it best:

DESCRIPTION
mnttab resides in directory /etc and contains a table of devices
mounted by the mount command (see mount(1M)). The file contains a
line of information for each mounted filesystem which is structurally
identical to the contents of /etc/fstab described by fstab(4).

There are a number of lines of the form:

special_file_name dir type opts freq passno mount_time

consisting of entries similar to:

/dev/dsk/c0d0s0 / hfs rw 0 1 537851723

/etc/mnttab is accessed by programs that use getmntent() (see
getmntent(3X)), It should never be manually edited, nor should setmnt
ever be used to create invalid entries in /etc/mnttab (see
setmnt(1M)).

mount_time contains the time the file system was mounted using mount.
Its value is the number of seconds since the Epoch (00:00:00
Coordinated Universal Time, January 1, 1970 (see time(2).

mount and umount rewrite the mnttab file whenever a file system is
mounted or unmounted if mnttab is found to be out of date with the
mounted file system table maintained internally by the HP-UX kernel.
syncer also updates mnttab if it is out of date (see syncer(1M).

Best Regards,

Dave
Romans 8:28
Robert-Jan Goossens
Honored Contributor

Re: difference

fstab -> static information about the file systems

mnttab -> mounted file system table

regards,
Robert-Jan
Anupam Anshu_1
Valued Contributor

Re: difference

Found the following on an old thread :-)
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=327206

------------------------------------------
/etc/fstab file describes all possibly mounted filesystems. The mount program uses this file to mount at startup time of the system all the necessary filesystems.

The information about all the filesystems actually mounted is kept in a file system mount table named /etc/mnttab.
------------------------------------------
fstab is the one you should care about as
its the one referenced during mounts.mnttab
is a table updated by mount (and used by bdf for example).you don't edit mnttab but edit
fstab and put each mounted directory there with
mount specific options for the filesystem.

And as suggested read the man pages for more information.
-------------------------------------------
We need to update /etc/fstab file as it keeps information which filesystems to mount on boot. Also, if you updte this file with device & mount point, at # prompt you will not need to specify device, simple mount followed by mount point will work, device information will get picked up from /etc/fstab.

/etc/mnttab gets updated by system up on mounting each filesystems. For Administrative purpose, it is used to check which filesystems are mounted.
---------------------------------------

Hope this helps,

Cheers,

Anshu

Re: difference

Thanks Dave for the explanations,

u mean to say in fstab only local mount drive are visible where as in mnttab lacal as well as remote mount drives are visible
Mark Grant
Honored Contributor

Re: difference

No Mangesh,

A simple way to look at this is /etc/fstab is the file you edit in order to specify how to mount things. /etc/mnttab is a file that the system keeps itself in order to keep track of how things are mounted.

You can mount things not in /etc/fstab but you can't mount anything that won't be listed in /etc/mnttab
Never preceed any demonstration with anything more predictive than "watch this"
Bruno Ganino
Honored Contributor

Re: difference

Bruno Ganino
Honored Contributor

Re: difference

Also this pdf file is useful (search words fstab and mnttab)

http://hp-events.hp3.nl/hp_itanium/presentaties/HP-UX%20Reference%20(11i%20v2)%20-%204%20File%20Formats%20(vol%208).pdf
HTH
Bruno
Torino (Turin) +2H