Subject: Re: /var CORRUPTED : remote fix ?
To: None <netbsd-users@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: netbsd-users
Date: 07/13/2005 16:08:52
In article <e0cef0cc050711235222200375@mail.gmail.com>,
Asmodehn Shade  <asmodehn@gmail.com> wrote:
>Hi all,
>
>I just had a weird network problem on a remote server, and after all
>the update I have done, my var got corrupted. Here is the "fsck -f
>/var" result :
>
>** /dev/rsd0f (NO WRITE)
>** Last Mounted on /var
>** Phase 1 - Check Blocks and Sizes
>INCORRECT BLOCK COUNT I=12103 (2 should be 0)
>CORRECT? no
>
>INCORRECT BLOCK COUNT I=12229 (2 should be 0)
>CORRECT? no
>
>INCORRECT BLOCK COUNT I=12276 (2 should be 0)
>CORRECT? no
>
>** Phase 2 - Check Pathnames
>** Phase 3 - Check Connectivity
>** Phase 4 - Check Reference Counts
>** Phase 5 - Check Cyl groups
>FREE BLK COUNT(S) WRONG IN SUPERBLK
>SALVAGE? no
>
>SUMMARY INFORMATION BAD
>SALVAGE? no
>
>BLK(S) MISSING IN BIT MAPS
>SALVAGE? no
>
>2793 files, 42878 used, 21890 free (346 frags, 2693 blocks, 0.5% fragmentation)
>
>How can I fix that remotely (ssh) ? This computer is overseas, and
>there is no way for me to get there and use the single user mode...
>
>While /var is mounted I am unable to fix it as fsck access only to
>/dev/rsd0f which is read only. And when I try to unmount /var my
>systems hangs, and I have to get someone overseas to push the power
>button... and the raw reboot doesn't seem to fix that..
>
>Please help! I don't really know what to do...

There are many ways to accomplish this. The easiest one is to add
fsck_flags=-y to /etc/rc.conf. If that does not work because your
NetBSD is too old, then umount -f /var, and then fsck -y it.

christos