/etc/mnttab is zero length - I have done a silly thing


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users /etc/mnttab is zero length - I have done a silly thing
# 1  
Old 12-04-2007
Error /etc/mnttab is zero length - I have done a silly thing

Being the clever-clogs that I am, I have managed to clobber the contents of /etc/mnttab.

It started when I tried to unmount all the volumes in a prticular veritas disk group and neglected to include a suitable grep in my command line, thus attempting to unmount _all_ the filesystems on the server (for loop).

They all came back with a fs busy message so I was presuming no harm done. However, a df to check all was in order came back with no results, likewise running mount.

When I went to look in the mnttab itself I find it's zero length !?! Smilie

Everything appears ok in that the filesystems are still actually mounted and read/write.

If I try a mount or umount I get the message
"mount: Inappropriate ioctl for device"

I suspect a reboot would sort me out but that's a big hammer and I'd rather get to the bottom of it.

What have I done and how in the world do I fix it?

Running solaris 10 on a T2000, fairly recent patches applied. Bugger all running aside from base OS and SAN kit.
# 2  
Old 12-05-2007
I understand that /etc/mnttab is actually implemented as a screwy filesystem itself on Solaris. I read somewhere that:

umount /etc/mnttab
mount -F mntfs mnttab /etc/mnttab

might rebuild it. But I have never tried it. I guess you get to run the experiment. Smilie
# 3  
Old 12-05-2007
Quote:
Originally Posted by Perderabo
I understand that /etc/mnttab is actually implemented as a screwy filesystem itself on Solaris.
On Solaris 7 (I think) it behaved as just a file, where the mount/umount programs adjusted it, but the umount system call didn't touch it.

You could use the tried and tested Windows solution,..... reboot it.
# 4  
Old 12-05-2007
MySQL

Quote:
Originally Posted by Perderabo
I understand that /etc/mnttab is actually implemented as a screwy filesystem itself on Solaris. I read somewhere that:

umount /etc/mnttab
mount -F mntfs mnttab /etc/mnttab

might rebuild it. But I have never tried it. I guess you get to run the experiment. Smilie
Total success! Perderabo, you rule! Smilie Smilie

The umount failed (no surprise, the first thing it does is looks at the mnttab) but the mount worked perfectly - I now have a fully populated mnttab again. Smilie Smilie Smilie

That one's a completly new idea to me Smilie - I'd never heard of the mntfs filesystem type before (or the bizaare idea of having the mnttab as a virtual filesystem). Solaris is a strange animal for sure.

I'd be keen to hear anyone's theory as to how I broke it in the first place though... Smilie
# 5  
Old 12-05-2007
Quote:
Originally Posted by porter
On Solaris 7 (I think) it behaved as just a file, where the mount/umount programs adjusted it, but the umount system call didn't touch it.

You could use the tried and tested Windows solution,..... reboot it.
Yeah I had that as my backup plan but I had a little time as it was still working (sort of) so I figured I'd try and find a cleaner fix Smilie

Interesting that the system call didn't update the mnttab in the old days, I could see that creating a bit of a potential mess. I've done very little work with sol7, went straight from 2.6 to 8 with the memorable exception of trying to run some NIS+ servers on 7 (shudder).
# 6  
Old 12-06-2007
Update

Since posting the above I've found another side-effect of using this solution - it appears that if you have a filesystem not mounted that is in the vfstab, the above command will tell the mnttab that it is mounted - resulting in confusion.

I fixed it but "unmounting" all of these volumes then mounting them for real.
# 7  
Old 12-07-2007
Solaris has a lot of screwy pseudo filesystems these days. Used to be we would write pseudo device drivers to sneek code into the kernel. I'm disappointed with the Solaris mntfs, it's not as robust as I would have hoped. There always was a problem with /etc/mnttab. The system calls never updated it, instead they update tables in the kernel. This is one of several reasons why a user was supposed to always use the mount command and not just the sytem call. After a reboot, /etc/mnttab would often have garbage entries. The setmnt command was used to initialize it. I had hoped the the mntfs stuff would, in effect, make the kernel tables and /etc/mnttab different views of the same thing, but it seems this is not the case. It seems to be just a special purpose memory based filesystem. I guess it will self-reset at reboot. And you can update /etc/mnttab while / is mounted read-only. Maybe it has some some code to keep all of the other screwball filesystems invisible. But I'm disappointed that it can get out of sync with what is really mounted.

As for your problem, my best guess is that you umounted /etc/mnttab, an operation which ideally would have been disallowed. But I guess it has to be allowed to fix /etc/mnttab when it breaks. Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

/etc/mnttab empty UNIXware 7.1.3

Hi Guys New to this forum so apologies if posted in wrong place. Got a unixware 7.1.3 system (I know !). df -k produces no output which I believe is because /etc/mnttab is empty. Can /etc/mnttab be re-built ? Thanks (2 Replies)
Discussion started by: deel
2 Replies

2. Post Here to Contact Site Administrators and Moderators

Might be silly question

Hi Team, In case if i want to delete one of my posting thread.. can i delete that? Just asking to know.. (5 Replies)
Discussion started by: darling
5 Replies

3. Solaris

MNTTAB and NFS questions

SunOS 5.10 Generic_142900-15 sun4u sparc SUNW,SPARC-Enterprise I have been asked to move all file from /CV to /EABATCH looking at our mnttab I see these two entries. wdcprodhome:/eabatch/EABATCH /EABATCH nfs nodevices,bg,intr,xattr,zone=cbp011,dev=5500010 1288539528 ... (0 Replies)
Discussion started by: Harleyrci
0 Replies

4. Solaris

what is the difference between /etc/mnttab and /etc/vfstab

what is the difference between /etc/mnttab and /etc/vfstab???? what are these files used for one time i removed mnttab file from my solaris box. infact i renamed it and my solaris box was not booting properly. (12 Replies)
Discussion started by: chidori
12 Replies

5. Solaris

My /etc/mnttab file is showing ro permission for /usr

Hi All, My current /usr utilization is 100%.As i don't have another harddisk i decided to delete some unnecessary files under /usr.But,while deleteing it is giving error "it is a readonly filesystem".I checked /etc/mnttab file it is showing the following entry /dev/lofi/1 /usr hsfs ... (3 Replies)
Discussion started by: navjotmannan
3 Replies

6. UNIX for Dummies Questions & Answers

/etc/vfstab vs /etc/mnttab

what is the difference between the /etc/vfstab and /etc/mnttab? when i check both files, the content is almost the same. can you enlighten me? what i know is /etc/vfstab is used for hard mounts. (4 Replies)
Discussion started by: hrist
4 Replies

7. Linux

veritas hasf /etc/mnttab

Hi All, Where is now the /etc/mnttab if you are in veritas sfha for red hat es 4? Thanks in advance for any comments. (2 Replies)
Discussion started by: itik
2 Replies

8. UNIX for Dummies Questions & Answers

silly question

How do I go about finding the number of unique words in a file. (3 Replies)
Discussion started by: EECSDAVE
3 Replies

9. HP-UX

bdf , /etc/fstab , /etc/mnttab

Hi all, Would like to know if it is possible to rearrange the order that mounts are displayed when the 'bdf' command is issued. An example of what I mean is, currently I see the following ... $ bdf -l Filesystem kbytes used avail %used Mounted on /dev/vg00/lvol3 524288 ... (6 Replies)
Discussion started by: Cameron
6 Replies

10. Solaris

Silly question

Are GNOME or javadsktop supported of the box on Solaris 10 on Ultra (SUNBlade 1500) ? I'could switch desktops to KDE at CDE logon. But when I tried to use the JavaDesktop it simply returns me back to the log on screen of CDE. How do I conigure to the latest GNOME and.or JavaDesktop if... (3 Replies)
Discussion started by: miket
3 Replies
Login or Register to Ask a Question