This is a reduced-jargon version of an episode from a longer document
about my love affair with a Linux laptop computer.
When the Power of GNU Failed Me
Once upon a
time, not long ago, I changed something or other and rebooted--and got no
sound when I logged in. The audio system couldn't start up because
its named pipe already existed in the /tmp directory. "That's
strange," I thought, "why doesn't Linux clear /tmp on boot like
other Unix-derived systems?" So I added a command to clear it and tried
again. Oops! Now X11 doesn't work. So I changed my command
to delete all files over 1 day old and rebooted again. Now obviously
I wasn't thinking clearly (there's already a cron job to delete old /tmp
files), so I just wrote the same sort of command I always write:
· find
. -mtime +1 -print | xargs rm
Unfortunately,
this command doesn't delete all temp files
over 1 day old; it deletes all
files over a day old! During the reboot,
I got a message like "/boot: Directory not empty". So
I hit the power switch, which saved my personal data files,
but meanwhile the core system files had been deleted, along
with their directories. On the next boot, I got a "grub>"
prompt.
So
now what do I do? I reached for my FSF membership card,
which is also a bootable CD-ROM that runs LNX-BBC. The power of GNU will save
me! Unfortunately, the power of GNU can't help unless the user
has a clue, and I didn't know anything about Grub. Anyway, LNX-BBC
works just fine. It auto-recognizes all my hardware and comes with
a serviceable web-browser, so I could go out on the web and search for
knowledge. Not bad for a tax-deductible card that
fits in my wallet and promotes Programmer's Freedom!
It seemed
that I needed to restore the /boot/grub directory
and reset the hard drive's Master Boot Record to point
to it, but there were several partitions that had grub
directories--which one should I use? I tried them
all, but none worked. Eventually, I tried "setup
(hd0,3)" or some such thing, which overwrote the extended
partition and deleted what was left of the OS. What
a thing to happen on Father's Day to a machine whose hostname
is "Daddy"! Taking a deep breath, I declared the system
a total loss.
Thankfully
I had replaced the /root directory with a soft
link to /home/root, which was on a primary partition
and was not destroyed. I fired up ftp
and transferred my data files to the Windows machine, put the
RedHat distro into the CD-ROM drive, guessed which packages to install,
and started afresh. As days passed, I would remember
a customization I had done and figure out how to do it again.
It took over a week to get everything back to rights. To
avoid having to go through this again, I would either have to
be very careful with root logins or I would need a solid backup
system. I decided to make the backup system a top priority.
-- Pyesetz
the Dog