Operating System - HP-UX
1822566 Members
3308 Online
109642 Solutions
New Discussion юеВ

/etc/fstab and /etc/mnttab have been edited with vi. Do I have a problem?

 
SOLVED
Go to solution
Leon Allen
Regular Advisor

/etc/fstab and /etc/mnttab have been edited with vi. Do I have a problem?

G'day,

/etc/fstab and /etc/mnttab have been edited with vi (lines re-orderedvi yy p ZZ)

Subsequent to doing this, I have read somewhere (now where was that again?) that these file must (or should) not be edited!

Am I facing a disaster when I next reboot? If so, is there a way to 'fix' this problem?

Many Thanks

Leon
Time's fun when your having flys (ancient frog saying)
5 REPLIES 5
Vijaya Kumar_3
Respected Contributor
Solution

Re: /etc/fstab and /etc/mnttab have been edited with vi. Do I have a problem?

Editing /etc/fstab is not a disaster if you do it correctly. Make sure you have all necessary file systems for the system to boot like /, /usr etc.

/etc/mnttab is a file to keep records of file systems mounted. the manual page says

"/etc/mnttab should never be manually edited. Any manual changes made to /etc/mnttab are overwritten without warning by syncer, mount, and umount"

so running syncer command will overwrite your manual changes to /etc/mnttab.

Hope this helps
Vijay
Known is a drop, unknown is ocean - visit me at http://vijay.theunixplace.com
T G Manikandan
Honored Contributor

Re: /etc/fstab and /etc/mnttab have been edited with vi. Do I have a problem?

There is no problem with editing /etc/fstab unless the entries are not valid.

THe only thing is that the /etc/mnttab holds the information of the mounted file system and should not be edited.

#mv /etc/mnttab /etc/mnttab.old
#mount -a
which should read the /etc/fstab and rebuild the mnttab file

Revert
Mark Grant
Honored Contributor

Re: /etc/fstab and /etc/mnttab have been edited with vi. Do I have a problem?

Editing /etc/fstab doesn't matter at all. In fact, it is often edited to add filesystems and remove them so that is not a problem.

You'll be pleased to know that /etc/mnttab gets re-written if it is not in sync with what the kernel thinks as soon as something is mounted or unmounted. I beleive syncer will re-write it too if required.

In other words, you should be OK.
Never preceed any demonstration with anything more predictive than "watch this"
Leon Allen
Regular Advisor

Re: /etc/fstab and /etc/mnttab have been edited with vi. Do I have a problem?

Thank you Vijayakumar for your prompt reply. My fears have been allayed.
Time's fun when your having flys (ancient frog saying)
Ravi_8
Honored Contributor

Re: /etc/fstab and /etc/mnttab have been edited with vi. Do I have a problem?

Hi Leon

editing fstab doesn't cause any problem, where as editing mnttab causes,

remove the mnttab and use 'mount -a' command which will rebuild the mnttab file

never give up