/var corrupted.....

Karol Kwiatkowski freebsd at orchid.homeunix.org
Wed Nov 1 17:06:03 UTC 2006


On 01/11/2006 17:40, Eric Schuele wrote:
> Hello,
> 
> [Running 6.2-PRERELEASE as of Oct 30th]
> 
> My /var filesystem on my laptop died this morning.  I had just
> installed/enabled gdm.  I exited my wm and the machine spontaneously
> rebooted.  Upon coming back up it said there was a bad superblock and to
> try the one at offset 32.  It then said that one was bad.  'newfs -N'
> tells me the next alt-superblock is at 160.  fsck says to run 'fsck -b
> <alt-superblk>'.  However when you do that it says -b is an unknown
> option.  So so googling leads me to fsck_ufs.  Which then says there are
> more "softupdate inconsistencies" than I can say yes to.  Plus some
> other issues.  I suspect something is very wrong in what I'm doing...
> but I'm a trooper... so I forge ahead.  :)  I eventually end up doing a
> 'fsck_ufs -y' on it... and it bails out giving me something like
> "-73827348927342458734 BAD I=213423" many many times.  So....
> 
> I may have totally destroyed my /var filesystem at this point. So my
> questions are:
> 
> 1) If not... pointers on what to do next would be *greatly* appreciated.
> 
> 2) If I have destroyed it what can I do at this point?  I have no full
> backup of /var.  I had nothing of any real importance on there.  Some
> MySQL data... but I've got that.  My package database comes to mind.
> but nothing of any personal value... just stuff to keep the OS on its
> feet.  So... if its gone... is there anyway to create a functional /var
> filesystem that will allow me to "get back to work as usual"?  Or is my
> only option a complete reinstall of everything?

I'm not sure if option 1 is out of question (wait for other replies)
but to recreate /var directory tree you can use mtree(8) on newly
created partiton, something like:

# /usr/sbin/mtree -du -p /var -f /etc/mtree/BSD.var.dist

The downside of this (option 2) is you'll loose some important
information about your system, /var/db/pkg comes first to my mind. If
you don't have any backups try to recover anything you can first. Good
luck!

> Thanks,
> Eric

HTH,

Karol

-- 
Karol Kwiatkowski  <freebsd at orchid dot homeunix dot org>
OpenPGP: http://www.orchid.homeunix.org/carlos/gpg/0x06E09309.asc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20061101/7d7769a1/signature.pgp


More information about the freebsd-questions mailing list