From owner-freebsd-current@FreeBSD.ORG Mon Oct 11 17:56:01 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1235A16A4CE for ; Mon, 11 Oct 2004 17:56:01 +0000 (GMT) Received: from smtp1.server.rpi.edu (smtp1.server.rpi.edu [128.113.2.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9D2B643D45 for ; Mon, 11 Oct 2004 17:56:00 +0000 (GMT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.netel.rpi.edu [128.113.24.47]) by smtp1.server.rpi.edu (8.13.0/8.13.0) with ESMTP id i9BHtuWS005077; Mon, 11 Oct 2004 13:55:57 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <200410111123.56526.kirk@strauser.com> References: <200410111004.05203.kirk@strauser.com> <200410111601.i9BG1VE1084870@apollo.backplane.com> <200410111123.56526.kirk@strauser.com> Date: Mon, 11 Oct 2004 13:55:55 -0400 To: Kirk Strauser , freebsd-current@freebsd.org From: Garance A Drosihn Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-CanItPRO-Stream: default X-RPI-SA-Score: undef - spam-scanning disabled X-Scanned-By: CanIt (www . canit . ca) Subject: Re: How to safely clean out /lib, /usr/lib? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2004 17:56:01 -0000 At 11:23 AM -0500 10/11/04, Kirk Strauser wrote: >On Monday 11 October 2004 11:01, Matthew Dillon wrote: > > > (this assumes you don't use 'tar' or 'cp' to backup your > > system, which would skew the results, and that you haven't > > already blown it by doing something right aweful in /usr/lib > > to open and read all the files. :-). > >Unfortunately, I do in fact use tar (via Amanda) for backups. :-/ I assume you're running 5.x or 6.x (since this is the mailing list for freebsd-current). One of the really useful features in 5.x is the ability to take snapshots of a disk partition. So, you could take a snapshot of / and /usr, mount those snapshots read-only, and then do backups of the files as they appear in the snapshots. I *think* that won't update the last-reference times on any of the files, but you might want to check that to be sure. Secondly, if you have a snapshot, you could leave the snapshot mounted and then remove the original lib files (once you decide which ones are safe to remove!). If the removal of some file does cause a problem, you can then copy the file back from the matching snapshot. This allows you to fix the problem without having to reference your backup tapes. Two things to remember if you try this: Mount the snapshots *before* you start removing lib files, and remember that /rescue has statically-linked versions of several key commands in case you mistakenly remove a critical lib file. >Now, I just did an installworld and "portupgrade -fa" yesterday. >Under these particular circumstances, does it seem reasonably >safe to trust libchk's idea of what's referenced and what isn't? At least for me, on my systems, that would not be completely safe. While you have rebuilt all your ports, you have not necessarily *run* all of them. I think that leaves open the possibility of some programs which will reference libraries when run, but which did not need to open those libraries during the build process. (they may check that the library exists, but not actually open the library to read anything). I am not sure about that, though. But in my case, I also have plenty of other programs on the system which did not come from the ports collection. Rebuilding all of my installed ports will not do anything with those other programs. And since those programs were not built via ports, it is much more likely that they have not been rebuilt in a long time, and are therefore referencing some ancient libraries. -- Garance Alistair Drosehn = gad@gilead.netel.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu