Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 Nov 2006 08:54:17 -0600
From:      Eric Schuele <e.schuele@computer.org>
To:        freebsd@orchid.homeunix.org
Cc:        freebsd-questions@freebsd.org
Subject:   Re: /var corrupted.....
Message-ID:  <454A0699.2000904@computer.org>
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 11/01/2006 11:05, 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
> 

This worked well.  I have left my failed filesystem alone for now (on 
the off chance someone offers a fix).  I simply used mtree to 
reconstruct things in /usr/var/*.  A few straglers (cups, sendmail, etc) 
complain in the logs and I create their directories as needed.  But was 
a quick easy soln.  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. 

With respect to the package database...
I've seen plenty of threads from folks having lost theirs in some form 
or fashion, and the solution always seems to be "reinstall everything". 
  Well, ok... sounds like a PITA, but how hard can it really be.  I only 
had 30-40 "apps" installed anyway.  With their deps it weighs in around 
350 ports total.  So I started to do just that.  Figured I'd reinstall 
in the order I originally installed in the first place.  Starting with 
Xorg.  I go to the port dir and `make install`, thinking it would 
reinstall it and all its deps.  No go.  It does in fact reinstall Xorg, 
but none of its deps because it finds them present.  Reinstalling 30-40 
apps is one things, having to manually go in and do 350... now thats a PITA!

How can I force a reinstall of a port and all its deps.

Thanks.

> If
> you don't have any backups try to recover anything you can first. Good
> luck!
> 
>> Thanks,
>> Eric
> 
> HTH,
> 
> Karol
> 


-- 
Regards,
Eric



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