Subject: more /var/mail wierdness
To: NetBSD-current users <current-users@NetBSD.ORG>
From: Rob Deker <deker@digex.net>
List: current-users
Date: 02/14/1997 07:21:28
First off, please let me apologise for the length of this message, I 
just want to make sure that all pertinent info is included.

A quick recap for those that missed my first message. Accidentally
performed the command "mount magnus:/var/spool/mail /var/mail" w/o
having nfsiod running. It consequently munged /var/mail so that it is now
doing really wierd stuff. look at the following:

nosferatu# cd /var
nosferatu# ls
account   crash     games     msgs      run       tmp
at        cron      log       preserve  rwho      yp
backups   db        mail      quotas    spool

pretty normal, now look at this:

nosferatu# cd /var
nosferatu# ls -l
ls: mail: Permission denied
total 17
drwxr-xr-x   2 root   wheel      512 Sep 26 15:46 account
drwxr-xr-x   4 root   wheel      512 Sep 26 15:46 at
drwxr-xr-x   2 root   wheel     1536 Jan 30 02:29 backups
drwxrwx---   2 root   wheel      512 Jan  5 18:55 crash
drwxr-xr-x   3 root   wheel      512 Feb 14 04:00 cron
drwxr-xr-x   3 root   wheel      512 Feb 14 07:01 db
drwxrwxr-x   6 games  games      512 Jan 13 08:26 games
drwxr-xr-x   3 root   wheel     1024 Feb 13 23:00 log
drwxr-xr-x   2 root   wheel      512 Nov 30 17:32 msgs
drwxr-xr-x   2 root   wheel      512 Sep 26 15:46 preserve
drwxr-x---   2 root   operator   512 Sep 26 15:46 quotas
drwxr-xr-x   2 root   wheel      512 Feb 14 07:01 run
drwxr-xr-x   2 root   wheel      512 Sep 26 15:46 rwho
drwxr-xr-x  11 root   wheel      512 Sep 26 15:46 spool
drwxrwxrwt   3 root   wheel      512 Feb 13 02:30 tmp
drwxr-xr-x   3 root   wheel      512 Jan 13 08:15 yp

also:

nosferatu# cd /var/mail
/var/mail: Permission denied.

Have tried fsck, it finds nothing wrong. At the suggestion of another 
-current user, I tried using fsdb. here is what I did and what hapened:

nosferatu# fsdb -f /dev/rsd0f
** /dev/rsd0f (NO WRITE)
Editing file system `/dev/rsd0f'
Last Mounted on /var
current inode: directory
I=2 MODE=40755 SIZE=512
        MTIME=Jan 13 04:26:30 1997 [70000000 nsec]
        CTIME=Jan 13 04:26:30 1997 [70000000 nsec]
        ATIME=Feb 14 07:05:46 1997 [208000000 nsec]
OWNER=root GRP=wheel LINKCNT=19 FLAGS=0 BLKCNT=2 GEN=32a0b424
fsdb (inum: 2)> ls
slot 0 ino 2 reclen 12: directory, `.'
slot 1 ino 2 reclen 12: directory, `..'
slot 2 ino 2496 reclen 16: directory, `account'
slot 3 ino 4992 reclen 12: directory, `at'
slot 4 ino 12480 reclen 16: directory, `backups'
slot 5 ino 14976 reclen 16: directory, `crash'
slot 6 ino 17472 reclen 16: directory, `cron'
slot 7 ino 22464 reclen 12: directory, `db'
slot 8 ino 4993 reclen 16: directory, `games'
slot 9 ino 19969 reclen 12: directory, `log'
slot 10 ino 3 reclen 16: directory, `mail'
slot 11 ino 2498 reclen 16: directory, `msgs'
slot 12 ino 4994 reclen 20: directory, `preserve'
slot 13 ino 7490 reclen 16: directory, `quotas'
slot 14 ino 9986 reclen 12: directory, `run'
slot 15 ino 12482 reclen 16: directory, `rwho'
slot 16 ino 14978 reclen 16: directory, `spool'
slot 17 ino 22467 reclen 12: directory, `tmp'
slot 18 ino 7 reclen 248: directory, `yp'
fsdb (inum: 2)> rm mail
Name `mail' removed
fsdb (inum: 2)> ls
slot 0 ino 2 reclen 12: directory, `.'
slot 1 ino 2 reclen 12: directory, `..'
slot 2 ino 2496 reclen 16: directory, `account'
slot 3 ino 4992 reclen 12: directory, `at'
slot 4 ino 12480 reclen 16: directory, `backups'
slot 5 ino 14976 reclen 16: directory, `crash'
slot 6 ino 17472 reclen 16: directory, `cron'
slot 7 ino 22464 reclen 12: directory, `db'
slot 8 ino 4993 reclen 16: directory, `games'
slot 9 ino 19969 reclen 12: directory, `log'
slot 10 ino 0 reclen 16: unknown, `mail'
slot 11 ino 2498 reclen 16: directory, `msgs'
slot 12 ino 4994 reclen 20: directory, `preserve'
slot 13 ino 7490 reclen 16: directory, `quotas'
slot 14 ino 9986 reclen 12: directory, `run'
slot 15 ino 12482 reclen 16: directory, `rwho'
slot 16 ino 14978 reclen 16: directory, `spool'
slot 17 ino 22467 reclen 12: directory, `tmp'
slot 18 ino 7 reclen 248: directory, `yp'
fsdb (inum: 2)> exit
*** FILE SYSTEM MARKED DIRTY
*** BE SURE TO RUN FSCK TO CLEAN UP ANY DAMAGE
*** IF IT WAS MOUNTED, RE-MOUNT WITH -u -o reload
nosferatu# mount -u -o reload /var
ffs: /dev/sd0f on /var: Operation not supported

being that it didn't want me to unmount and reload the fs, I rebooted
the machine to force a fsck and remount the fs. After the reboot it looked
exactly the same.

Any ideas? I'm kind of stuck w/o being able to do anything mail related on
this host now and it kinda bites....

thanks

rob


------------------------------------------------------------------------------
"Off the keyboard, through the CPU, | deker@digex.net 
out the transceiver, down the rj45  | Systems Engineer
line, across the router, through    | 
the Hub, out the gateway.           |  
        Nothing but net."           | 
-----------------------------------------------------------------------------