How to recover from deleted /usr on Debian

December 5th, 2005

Ok, this is the second time I have lost my /usr partition. The first was due to overwriting it, and this time a hard drive crashed. Fortunately, as long as you keep /usr/local and /usr/tmp either backed up or empty, the rest can be rebuilt reasonably automatically.

A second machine is required.

On the second machine:
1. Use dselect and update the package list (/var/lib/dpkg/available)

2. Build a list of required and important packages using the Package: and Priority: lines

3. apt-get clean; apt-get –download-only –reinstall install `cat required-essential-list`

4. Use dpkg -x to unpack all of the debs in /var/cache/apt/archives into a single directory

5. Tar/gz that up and either put it on a floppy/cd, or use netcat to send it over.

6. On the target machine, unpack the files directly into /usr

7. dpkg –get-selections | cut -f1 to create a list of packages to reinstall

One by one, reinstall the packages. I do this by first reinstalling all packages that start with lib, then going through the list alphabetically. If you see some programs not running, because of missing shared libraries, dpkg -S for the library and then reinstall the package it is in before proceeding.

In order to get alternatives to reinstall, remove them first using update-alternatives –remove-all [name]. This is to get commands like 'editor' back. You may want to remove all alternatives before beginning so that they will be automatically repaired as the packages get reinstalled (for a list, look under /var/lib/dpkg/alternatives)

Some packages will not be able to be reinstalled since you don't have sources for them anymore, just purge those packages. Others will not be able to be reinstalled because they depend on a library which conflicts with another package; just purge the package for now and put it in a list of things to be reinstalled later.

Some maintainer scripts will behave weirdly if things they expect to be installed actually are not around. Edit the offending script in /var/lib/dpkg/info/package.{pre|post}{inst|rm} and prepend an 'exit 0' to the top. You should probably reinstall all such packages later in order to get things back to a consistent state.

Then once everything has been reinstalled at least once and all the dependency problems cleared up, go through and reinstall everything again.

In the end, things should be mostly back to normal.

Why I hate computers

December 4th, 2005

Within the span of a month:

– The third replacement of a Maxtor 200GB drive died in my second workstation, one month out of warranty. Data corrupt but recovered somewhat.

– A Maxtor 40GB drive in my main workstation died a click of death while running. Total loss.

– An attempted upgrade of my main workstation failed because I have a MS-6905 1.1 Rev B, the revision that happened to be recalled by MSI at some point years past. Of course, the recall is no longer honored.

– Upgrading the fileserver with a used 3ware card and 250GB Seagate drives in RAID5. Of course, it doesn't work. (6410) Fortunately, the seller refunded our money even though he claimed it worked.

– Obtained a 3ware 7504. It was working fine. Tonight the driver reported that the controller was not responding and kicked the array offline, necessitating a reboot. Of course this meant all the AFS volumes with open files need to be salvaged. And I'm certain this will happen again.

The moral of the story is to expect that anything even remotely related to a hard drive will fail in spectacular fashion at the point when it would cost you the most for it to do so.

<sarcasm>

September 5th, 2005

So-called medical marijuana users are addicted to marijuana in the same way alcoholics are addicted to alcohol or heroin users are addicted to heroin: if they do not get their “fix”, they will suffer or die. Furthermore, they are willing to do anything to secure a supply of the drug, including defying the law, and illegally manufacturing it in private. Such people are typically adamant in denying their addiction, while at the same time demonstrating an inability to cope without the drug's effects. Why would we want to encourage people to enter this cycle of drug dependency and the associated drug seeking behavior? Is the cure really better than the disease? We ought to be encouraging people to make better individuals of themselves rather than allowing them to add more problems to their situations.

computer problems

June 24th, 2005

I hate computers. Thinking it may be a good idea to consolidate some of our machines into virtual images under Xen, UML, or VServers.

Recently my workstation ran out of memory/swap at nearly 1 year uptime. It hadn't been rebooted since I moved into the house. Of course, Linux went crazy and killed the X server instead of whatever was responsible, so the console was unusable, and ssh couldn't fork a shell process, so I had no choice but to hit the reset button.

Today:
The power went out at home around 4:30 while I was at work. Eventually, the UPSes shut down, so I noticed a lack of network connectivity to my home machines at that point. The UPSes powered back on, but hardly any machine came back up correctly. The server console IBM keyboard was non-functional for some reason…

router: Couldn't bring up the network because of a malformed interfaces file that it had previously accepted. DNS server was non-functional, upgraded to latest version and re-did config files, seemed to fix it.
hydra: Can't find kernel. Of course, this machine has a non-functional PS/2 keyboard/mouse bus, so a console is impossible to use on it. The hard drive will have to be examined in another machine.
dbz: Couldn't log in because pam_krb5 couldn't find krb5.conf – even though pam_krb5 is optional! Sigh. I have the same problem on laptops since they are frequently disconnected from the network. Filed a bug.
zephyr: Came back up and auto-fscked after the outage. Spewing ATA errors all over the console because the Maxtor drive is all of a sudden dying, fsck continues blindly and “fixes” whatever it finds, probably trashing whatever I might have otherwise been able to recover. A SMART test on the drive fails out immediately. Applied for advance RMA. May have to send this one to a recovery house. fsck should not be so braindead when there is obviously a failing hardware. It should also not attempt to fsck partitions which are set 'noauto'. Just in case, I will be getting a new power supply for this machine because this is the third Maxtor drive which has failed within two years with it.
fileserver: Rebooted into 2.6 kernel with no RAID. ide-generic is not depended on by any IDE drivers, so it had to be entered into the initrd modules list or no hard drive was accessible. Apparently RAID and udev don't get along, so mdadm needs to create the md device nodes. CPU fan alarm was on, but this time it was not a false alarm – CPU2 fan had become clogged and noisy. Took it off the heatsink, blew both pieces off with compressed air, and oiled the fan, plugged the hole with lithium grease since it was previously capped with hard plastic. We will see how long it lasts.

blizzard,aurora,syrinx: since fileserver and DNS were down, these machines were very confused.
laptop: CD drive no longer responds correctly to ATA identify commands, so the drive is impossible to use.

I definitely need a supply of spare fans as well as a big enough hard drive to back up my 200 gig, two 40 gigs and 20 gig. Hard drive failures are ridiculously annoying.

the pulpit

March 31st, 2005

Society is not defined by what is right and wrong, and legislators would be best off leaving that question to the pulpit. When people form a society, they share a set of values which are used to define the rights which that society will protect for its citizens. The legislative concept of right and wrong should have its basis in these rights, not in the subjective morality of individual desires. “What rights are we protecting through this legislation?” “What rights would this legislation potentially impinge upon?” are the questions legislators should be asking, not “How will this promote my agenda” or “What would Jesus do?”

truth

March 31st, 2005

What is truth? Truth is a consensus. We can only judge reality through our perceptions, and those perceptions are demonstrably fallible. So truth is only what we can agree on. In the scientific method, evidence is paramount in demonstrating truth. The scientific method is the best mechanism we have for finding truth. It is tempting thus to implicitly accept all information as truth from persons who refer to themselves as scientists. This leads to an argument from authority fallacy. It is possible, after all, for someone who refers to themselves as a scientist to not practice the scientific method. Therefore, we introduce credibility to replace authority as a metric for evaluating a claim. Credibility is determined by examining all past claims of this person and judging whether or not the provided evidence supports their claim.

Credibility is domain specific. Judging a claim includes both judging the individual as being fundamentally intellectually honest and a steward of truth as opposed to one who is subject to biases or who makes exceptions to truth seeking in special cases, and also judging whether the credibility domain of the individual includes the claim they are making.

It is possible for even credible sources to be wrong though. So we cannot just implicitly accept the claims of credible sources, they still must be evaluated ourselves. Using credibility, we can establish an order in which we evaluate claims, since we have no time to evaluate them all. In an instance where two claims are equivalently supported but contradict each other, we will go with the claim of the more credible source until the less credible provides more evidence to overcome the credibility gap.

Information overload is the big problem of this age. We need efficiency in sorting through the barrage of information that bombards us from all angles.Determining a source's overall credibility as well as his domain credibility is the most important thing we can do to ensure that we are not deceived. Weeding out junk claims in this fashion will force people to provide more solid evidence and reasoning to gain our attention, which means less of our time is spent entertaining claims which lack truth.

clarification

March 29th, 2005

DRM = Copy protection
Trusted computing = Treacherous computing = Hardware DRM
Trustworthy computing = Microsoft trying to fix its insecure software

The difference? Trustworthy computing benefits the user. Trusted computing removes the user's capability to exercise fair use rights.

Theory of ethical legislation in the US

March 28th, 2005

Presumptions:
Life, liberty, and property are the only concerns of the law.
Legislation should prioritize life, liberty, and property in that order.
Legislators should omit individual agendas.

Felony:
An act which is heinous; causes measurable harm to another's life or liberty. Always results in a prison sentence. No disenfranchisement – a check against overzealous legislators. Causes loss of “responsibility required” civil liberties, unless the law is later overturned. Prosecutors cannot plea bargain into a felony charge from a non felony charge.

Misdemeanor:
– Acts which would have been felonies in a causal chain of events, if a third party had not intervened.
– Acts which constrain another's life or liberty without measurable damage.
– Acts which involve theft or destruction of another's property.

Misdemeanors can be assigned community service, fines, or restricted jail periods.

All other acts which some party claims victimization in are tried in civil court. This prevents encoding subjective morals into criminal law, because ultimately the law must have a basis in protecting at least one of life, liberty, or property to avoid being thrown out. Civil court thrives on case law, and case law which becomes archaic can be overturned by new rulings.

An exception to criminal law is the reflexive case. In other words, it is impossible for an individual to victimize himself by definition. Therefore, suicide and many other current “immoral” acts cannot be illegal. In the case of suicide, the body is left to the victim's estate.

Acts that do some nebulously defined harm, such as things that harm “society”, where a victim cannot be identified, are strictly for civil courts.

“Responsibility required” civil liberties: Liberties which a citizen of a free society enjoys, but which have potential for harm to others in certain circumstances. Handgun carry; recreational drugs; prostitution, etc. Providers of such are regulated by the state to ensure that ex-felons do not have access to these. Existence of regulated providers should keep black markets out of business.

ad hominem

March 14th, 2005

Ad hominem attacks at the source of a statement do not serve in place of refuting the statement. Certainly, when a bias or interest in the topic is exposed, that may call the person's reasoning into question. But until the statement is refuted, it stands, regardless of who stated it.

Wise words from a fool's mouth are still wise words – or more succinctly – a broken watch is still right twice a day.

double standard

March 14th, 2005

There is a supposed double standard in the political views of freedom of information types. It goes that, on the one hand we expect the GNU General Public License to be enforced, but on the other hand we complain when the RIAA sues people who are sharing music online.

There are a few gaping holes in this supposed contradiction. First of all, the RIAA is suing end users for disproportionate sums compared to the supposed damage they have done, in some cases $100,000 per user. They assume that they price of their CD is the value of that CD, in calculating the damages, which is an economic fallacy when a monopoly (such as any copyright industry) is involved. The RIAA also uses this money to lobby and/or bribe politicians for copyright enforcement rights that are in contempt of due process and unreasonable searches, and for arbitrary copyright privileges and lengths. In contrast, the GPL crusaders simply want the source code that they are entitled to by the license, not any sum of money to appease them – the freed information is the goal of the license and its adherents, not revenues.

The other problem with this is that the complaint involves the RIAA going after _nonprofit_ file sharers. Note that commercial pirates are not exempted from criticism. Of course, you could just accuse the freedom of information types of being communists, but also note that the GPL does not prohibit selling the software. GPL defenders equally lambast both freeware and commercial authors who are benefiting from the work of open source authors who were motivated because of the GPL, but refuse complying with the GPL by reciprocating the benefits to the community, which removes incentive for the authors of the GPL software to continue to develop it.

Copyright is supposed to be an exchange. In accordance with the Constitution, the federal government is authorized to provide “temporary” monopolies “to promote progress of the sciences and useful arts”. 100 year copyrights are not temporary by any definition that takes human life expectancy into account (is a 100 year sentence a “temporary” imprisonment?). Furthermore, it is arguable that such indefinite copyright lengths are actually counter to the promotion of progress. It is a myth that new works are borne entirely of some inspiration of genius. Every new work is both a combination of inspiration and standing on the shoulders of those who previously innovated. For an example, look at jazz to see how a healthy innovative environment functions, and compare the level of innovation to the humdrum commercial music that the RIAA promotes.

Another related problem is that the GPL crusaders are directly defending authors who are actually creating new material, while the RIAA is not. The RIAA claims to have the artists' interests in mind, but nowhere have they shown that they share the dividends of these suits with the artists. Copyright privilege already extends to the life of the author plus 75 years, so if the artist's contract assigns the copyright to an RIAA member company (as is frequently the case), they get 75 years of royalty-free mooching off an artist's life work. That's not a good deal for the public at all.

The original 14 year term is far more reasonable. To the GPL, this would mean that the source code is required by copyright to be shared for 14 years until the software becomes public domain. That certainly seems reasonable given the length of the typical software life cycle. To the RIAA, this means that artists would have to continue to innovate, and that the RIAA would have to support an enviroment that fosters innovation, instead of simply living off the fat of previous works.

So while the RIAA lobbies for and continues to obtain arbitrary copyright powers, I feel that nonprofit sharing of their work in violation of their copyright is justified.

Some compare this to Robin Hood and claim that it's just like trying to justify stealing from the rich just because they have something you don't. The fallacy there is that Robin Hood was not simply stealing from the rich, he was challenging the arbitrary authority of King John and the Sheriff of Nottingham, and returning freedom to the people that was removed from them when they had done no harm. Nonprofit sharing harms no one except producers of shoddy or trivial works. When shoddy or trivial works become the norm, nonprofit sharing helps those who produce innovative works, because they can be identified before purchase as opposed to the purchase being a gamble for the consumer. Nonprofit sharing thus promotes progress, and you'd think it should be a constitutionally protected right. Note that the authors would not be required to provide the mechanism for doing this – they are free to invoke whatever copy controls they want, but the consumer is free to bypass them at whatever expense or hassle it takes him.

As for who holds the moral high ground, the GPL advocates want the free dissemination of information and the legal ability to modify it to their own desires and share the result with others. The RIAA wants money for their executives, shareholders, and their legal war chest. Into whose hands would you rather place the reins of legislating incentives for innovation in society? Whose goals include the long term benefit of the most people?