Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Nov 2006 11:56:14 -0600
From:      Eric Schuele <e.schuele@computer.org>
To:        freebsd@orchid.homeunix.org
Cc:        freebsd-questions@freebsd.org
Subject:   Re: /var corrupted.....
Message-ID:  <1162403774.4866.27.camel@ugly>
In-Reply-To: <4548D3DC.3060902@orchid.homeunix.org>
References:  <1162399232.4866.25.camel@ugly> <4548D3DC.3060902@orchid.homeunix.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 2006-11-01 at 18:05 +0100, Karol Kwiatkowski wrote:
> 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

Ok... good tip thanks.  That would definitely leave my db/pkg out of
whack.  I wonder if a 'portupgrade -af' would fix that up?  

I'll wait for others to weigh in as well on option 1 before going this
way.

Thanks.

> 
> 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
> 




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