live and learn

Neal Murphy neal.p.murphy at
Tue Jun 8 16:55:06 PDT 2010

On Tuesday 08 June 2010 16:54:52 Mike McCarty wrote:
> piper.guy1 wrote:
> > One more thing. Seeing that this is a very risky thing to be advising
> > in LFS 6.6, can I suggest that the authour(s) add some caveats around
> > this instruction?

The best way to do LFS is to pretend you are the computer, executing each 
command and understanding what each command does. In short time, you'll come 
to recognize what is happening and learn to pause before you hit the <ENTER> 

Been there, done that. Hmmm. May I produce a t-shirt that proclaims, "Member 
of the 'I hosed my Linux system building LFS!' club" ??

> Besides, porking your main machine to the point where it won't
> boot, and figuring out how to get it back is half the fun, isn't
> it? :-)

It's fun the first couple times. :) Then it just becomes tedious and a pain to 
figure out how to avoid it in the future. :D

In a way, LFS is instructionary (as intended). If you do *exactly* what the 
book says, the probability is high that you will succeed and not hose your 
host system. I started playing with UNIX in 1986, and Linux in the 
mid-nineties. And just a couple weeks ago, I overwrote a disk that contained 
half of a couple striped MD filesystems. Lost nearly 10 years of pics and 
history. Another time, while redesigning the Smoothwall build system, I 
overwrote large bits of my host system because the build system did what I 
*told* it to do, not what I *wanted* it to do. Sigh. I *meant* to copy an 
external drive's image to a partition, *not* the whole drive.

So if all you did was wipe out a link to a shell, you haven't tried hard 
enough. :) Almost any Linux distro that has a rescue mode (even Debian's 
netinstall CD will work, and its much quicker) will allow you to boot into a 
usable Linux and repair such minor damage.
  - boot the live or rescue system
  - don't use your host's FS as root
  - mount your host's root FS and/or /usr FS, as needed
  - find what you hosed and any alternatives
  - create a symlink from that which you lost to an alternative
For example, if you deleted the symlink to dash, you can create a new link to 
dash. If you wiped out dash itself, you can create a symlink to just about 
anything that will act as a shell. Tclsh would do in a pinch; even perl or 
php would work.

At the worst, you might have to find and download the bash/dash/csh/tcsh 
package, learn to unarchive it, and replace only what you deleted. You could 
get lucky and find the package cached in a package archive area, as you'd 
find in at least Debian or Ubuntu (an ancient African word meaning "can't 
install Debian").

And, yes, I have done 'rm -rf *' when in the root directory on my old AT&T 
UNIXPC. I've since learned to be more careful. But, clearly, not careful 
enough. :) 

Just remember, it's only a computer. It can be restored to proper operating 
condition. In time, you'll learn to keep your personal data on a separate 
filesystem. You'll learn to pause before hitting <ENTER>. And in time you'll 
wonder why you stuck with Winders or Mac so long.

'97-02, I used BeOS as my primary system. For a short time, I used Windows 
after, until Debian Etch was release. I've been using Linux as my primary 
system ever since.

As Mike says, LFS is not for newbies. Though I might allow that it is not for 
newbies who have only one computer. Keep a computer, any computer, handy for 
internet access to search for the mistakes you make and how others have 
recovered. At least technically, we humans learn from our mistakes and are 
usually willing to help teach others to avoid and/or recover from theirs. 
Often you'll get a respone that details how to recover. Other times, you get 
a response like, "There, there. This, too, shall pass."

So welcome to the world of virtual reality, where the all that exists are 
meaningless bits. It is all virtual; none of it is tangible. It is there to 
be moulded to our own individual desires.

In the future, pay close attention to *each* step of LFS. And be sure to 
follow each step *exactly*.

[Fest3er steps off his soapbox and puts it away.]

A possible future enhancement to 'the book' might be to incorporate checkboxes 
that a newbie would check off as she performs each step. Extra work? Yes. But 
worth it to make each step clearer? Yes again.

More information about the lfs-support mailing list