From owner-freebsd-questions@FreeBSD.ORG Fri Nov 3 14:42:12 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B317916A40F for ; Fri, 3 Nov 2006 14:42:12 +0000 (UTC) (envelope-from greenwood.andy@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.232]) by mx1.FreeBSD.org (Postfix) with ESMTP id F048D43D73 for ; Fri, 3 Nov 2006 14:42:10 +0000 (GMT) (envelope-from greenwood.andy@gmail.com) Received: by wr-out-0506.google.com with SMTP id 71so55459wri for ; Fri, 03 Nov 2006 06:42:03 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=FuOy68N46ON2lEEyDB46t8ZgzdaJDXHmT8aga8z19933f+THvQcFJ03vGFnmSW2Hx3iychTvUWkvUCjEqLatqkvyaCWy7VotcmVksreCII3URZukGkDR9CC6QJ9hEenjUXirNwCTp7cYYTv6WiFHyuj7J6l0xYcRFECJiHGnVp0= Received: by 10.78.70.4 with SMTP id s4mr2865387hua.1162564921997; Fri, 03 Nov 2006 06:42:01 -0800 (PST) Received: by 10.78.139.10 with HTTP; Fri, 3 Nov 2006 06:42:01 -0800 (PST) Message-ID: <3ee9ca710611030642pa40318bl5412badda93aebfc@mail.gmail.com> Date: Fri, 3 Nov 2006 09:42:01 -0500 From: "Andy Greenwood" To: "Eric Schuele" In-Reply-To: <454AC644.3080201@computer.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1162399232.4866.25.camel@ugly> <4548D3DC.3060902@orchid.homeunix.org> <454A0699.2000904@computer.org> <454AC644.3080201@computer.org> Cc: freebsd@orchid.homeunix.org, "illoai@gmail.com" , freebsd-questions@freebsd.org Subject: Re: /var corrupted..... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Nov 2006 14:42:12 -0000 couldn't you do something like this? 1) install all your "big" ports (leafs with lots of dependancies) 2) run this to get a list of depedancy ports which should already be there, just not in /var/db/pkg # pkg_info -ar | awk '/Dependency:/ {print $2}'|sort|uniq 3) "install" these ports so that they get added to /var/db/pkg. Seems like this should work, am I missing something? On 11/2/06, Eric Schuele wrote: > On 11/02/2006 10:21, illoai@gmail.com wrote: > > On 11/2/06, Eric Schuele wrote: > >> 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. > > . . . > >> >> 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? > > . . . > >> > 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! > > > > You might be able to force mount the dirty filesystem via > > mount -f > > You can also try > > dd if=/dev/ad0s1d of=some_dang_file_name* > > And then using mdconfig to play with the resulting file. > > mdconfig -t vnode -f some_dang_file_name -u 0 && \ > > mount -f /dev/md0c /mnt (maybe?) > > If you can get the /var/db/pkg dir off nicely, good luck. > > Thanks. Good ideas. I'll play with this when I have time. But after > using mtree to recreate the structure in /var (off the / filesystem), > things came back online pretty well. I'll most likely get things put > back together and then just recreate the /var filesystem and copy > everything back into it. > > > > > *(Note that this could take a long time on a 1 or 2G /var > > as it reads all of the empty blocks as well, you might want > > to hand it a bs= and a count= if you know about how much > > of /var was full at the time, man dd for more details. Also > > note that I have had faster results using sdd from ports) > > > > I had a similar problem a while back and both methods > > were able to read some of the data from the former /var, > > however the /var/db/pkg directory was trashed and I ended > > up having to fall back on the "reinstall everything" method. > > My method ended up consisting of: > > 1) reinstalling portupgrade > > 2) reinstalling several high level programs (opera, mplayer, > > gnumeric, any window managers, & so on) > > 3) pkgdb -F which one at a time reinstalls everything depended > > on. Make sure you have backups of any important files in > > /usr/local/etc as they may get overwritten. > > > > I'm presently doing this now. I have reinstalled most, if not all, top > level ports and will be running through `pkgdb -F` tomorrow. I suspect > that will take a fair amount of time. > > Thanks. > -- > Regards, > Eric > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > -- I'm nerdy in the extreme and whiter than sour cream