how to recreate empty /etc/mnttab file?

  • Follow


The program shlight always creates an empty /etc/mnttab file. All
mount points are working, but some commands (like df) needs a correct
/etc/mnttab file. Booting the machine recreates /etc/mnttab, but is
there a way to recreate it without booting?
I am running Solaris 9.
Thanks in advance,

Roland Scholz
0
Reply rs 2/5/2004 3:58:30 PM

Roland Scholz wrote:
 > The program shlight always creates an empty /etc/mnttab file.

I don't understand how. On Solaris 8/9  /etc/mnttab isn't a file; it's a
thing that looks like a file but (through the magic of virtual
filesystems) is actually a direct representation of the kernel's mounted
filesystem table.  You can't edit it (or write an edited version, at any
rate), you can't remove it, you can't over-write it with /dev/null

For instance

# cat /dev/null > /etc/mnttab
/etc/mnttab: cannot create

$ rm /etc/mnttab
rm: /etc/mnttab: override protection 444 (yes/no)? y
rm: /etc/mnttab not removed: Device busy

So I wonder what this shlight thing is doing...

 > All mount points are working, but some commands (like df) needs a
 > correct /etc/mnttab file. Booting the machine recreates /etc/mnttab,
 > but is there a way to recreate it without booting?

Try unmounting it

# umount /etc/mnttab

then remounting it

# mount -F mntfs mnttab /etc/mnttab


-- 
Tony

0
Reply Tony 2/5/2004 4:12:43 PM


In article <511b2f03.0402050758.64b6c9ec@posting.google.com>,
Roland Scholz <rs@RolandScholz.de> wrote:
>The program shlight always creates an empty /etc/mnttab file. All
>mount points are working, but some commands (like df) needs a correct
>/etc/mnttab file. Booting the machine recreates /etc/mnttab, but is
>there a way to recreate it without booting?
>I am running Solaris 9.

Unless you've done awful things to your system, /etc/mnttab in 
Solaris 9 (or 8, for that matter) is a read-only view onto kernel
data. It can't be "emptied" by anyone.

So what is shlight (who he?) up to? Maybe it's done an umount(1m) 
on /etc/mnttab? (In which case, mount it again, the way it's done 
in /etc/rcS.d/S40standardmounts.sh.)

Chris Thompson
Email: cet1 [at] cam.ac.uk
0
Reply cet1 2/5/2004 4:27:17 PM

Tony Walton wrote:
> So I wonder what this shlight thing is doing...

Apparently something similar to what fle-shlight does ;-)

0
Reply Beardy 2/5/2004 5:50:25 PM

Tony Walton <tony.walton@s_u_n.com> wrote in message news:<40226B7B.7030504@s_u_n.com>...
> Roland Scholz wrote:
>  > The program shlight always creates an empty /etc/mnttab file.
> 
> I don't understand how. On Solaris 8/9  /etc/mnttab isn't a file; it's a
> thing that looks like a file but (through the magic of virtual
> filesystems) is actually a direct representation of the kernel's mounted
> filesystem table.  You can't edit it (or write an edited version, at any
> rate), you can't remove it, you can't over-write it with /dev/null
> 
> For instance
> 
> # cat /dev/null > /etc/mnttab
> /etc/mnttab: cannot create
> 
> $ rm /etc/mnttab
> rm: /etc/mnttab: override protection 444 (yes/no)? y
> rm: /etc/mnttab not removed: Device busy
> 
> So I wonder what this shlight thing is doing...

I know that /etc/mnttab is a filesystem, but everytime I run shlight (which is
used to mount SMB file systems exported by Windows), /etc/mnttab is empty.


> 
>  > All mount points are working, but some commands (like df) needs a
>  > correct /etc/mnttab file. Booting the machine recreates /etc/mnttab,
>  > but is there a way to recreate it without booting?
> 
> Try unmounting it
> 
> # umount /etc/mnttab
> 
> then remounting it
> 
> # mount -F mntfs mnttab /etc/mnttab

Thanks, that does the trick.
:)
0
Reply rs 2/6/2004 7:29:28 AM

4 Replies
1304 Views

(page loaded in 0.045 seconds)

Similiar Articles:










7/23/2012 9:50:46 PM


Reply: