This Time Self-Hosted
dark mode light mode Search

Sometimes bad experiences let you learn something

Like having to rebuild one’s /usr/lib64 tree helps to learn that there are quite a few duplicated files installed in a system.

The first thing I have to suggest to anybody who happen to have my problem is: make sure you remove the debug info files before starting the procedure: they are big and a lot, and if you, like me, still have partial directories present, it’s simple to find them and remove them altogether, will save you from a lot of md5sum calls. The script I’m using (actually it’s a oneliner, albeit having two while statements in it) is still a test run with echo rather than the commands themselves, but when I’ll be sure it works as intended, I’ll see to post it here, in case someone else might need it.

Then there are the tricky parts: the script being what it is, it will create a bit of a stir when a given file is present with the same md5sum in different places. This is easier to see with empty files or files containing just ‘n’ having the same MD5SUM (.keep files are the most common offenders on this); to avoid having to copy those files back all over (especially since mtime will be changed, and that is bad), I’ve added a simple -size +1 to skip over files of 1 byte or less. Hopefully should take care of it.

But of course there are duplicated files. PHP is a major offender on this: not only it installs a copy of config.guess and config.sub files, it also have some duplicated libpcre header files, but the absolute winner of the “let’s bloat a system” contest is vmware-server, as it comes with a copy of Perl itself, and some of the files are the same to the MD5SUM!

In addition to this, my script shown that there are packages installing stuff in /usr/lib when they shouldn’t. The multilib-strict warning usually allows to find these packages, but in the case of xc, for instance, there are no arch-dependent files, so multilib-strict does not trigger (obviously). It is not really a problem, as arch-independent files are fine in /usr/lib, but as far as I can see, those files should instead go to /usr/share/xc.

* scribbles something on his TODO list about this *

Comments 6
  1. I can’t resist to ask:Wouldn’t proper backup/restore make things much easier?Restore /usr/lib64 from tape/snapshot/whatever and go on with your life.Just a suggestion ;-)Stefan

  2. Considering I rebuild my system almost every other month, software wide, and that it easily go over 10/20G, it would be quite a cost on the long run. I’d need tapes, and those costs too much for me to afford them regularly. I do back up the important data, but that’s about it.Plus, if the problem is with the hardware disk, just reinstalling is not an option, I would face the same problem in a few weeks.

  3. A DDS-3 changer is about 50 EUR on ebay, and a DDS-3 tape is at about 4 EUR or so.The tapes can be reused for sure so with about 100 EUR investition it is possible to set up a proper backup-setup which would enable you to backup your 10/20G daily, even when things change rapidly.Comparing this to the time needed for your described restore it would easily pay off regarding what I charge for my workhour ;-)Just a suggestion, it’s your time and fun 🙂

  4. Might be worth it for the server, but for the main workstation, I’m not sure about it: if there is no hardware fault, I can usually just get everything up and running in two days without major trouble, the main thing that runs on that box is Gentoo work, so it usually doesn’t get a problem. if it’s an hardware fault, that is something different and no backup would help me putting the system back online in no time.But I’ll look into it, last time I checked last year, tapes were about €20 for 10GBs and that was way over the line, if you say there are models at €4, that might be worth looking into.

  5. Example:I backup laptop and main workstation to a server in the basement by using amanda. This is serious backup.For quick restores I rsync the laptop’s partitions /boot and / to that server as well from time to time (the more often you do it, the faster it goes). This has helped me 2 or 3 times to get my laptop restored from bare metal by just booting the gentoo-live-cd, partitioning and run some rsync … then grub, you know.Maybe 2 hours of time brutto, most of it letting the rsync do its job.Never even near 2 days! And this without any tape (and heavy brainwork and fiddling) involved.

  6. OT: I think your RSS-setup is somehow broken, I get multiple new entries her while content doesn’t change. Uncertain how to communicate this to you without doing it here.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.