Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Nov 2006 18:05:32 +0100
From:      Karol Kwiatkowski <freebsd@orchid.homeunix.org>
To:        e.schuele@computer.org
Cc:        freebsd-questions@freebsd.org
Subject:   Re: /var corrupted.....
Message-ID:  <4548D3DC.3060902@orchid.homeunix.org>
In-Reply-To: <1162399232.4866.25.camel@ugly>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
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


[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFSNPjezeoPAwGIYsRCBXnAJ4g4Aa09artelRYMtcvrNEDEhz5RQCfct2r
31iGYDgv4lnHt/7k0r8Mdfc=
=ceIV
-----END PGP SIGNATURE-----
help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4548D3DC.3060902>