Bahut

Friday, February 25, 2005

The other day, I needed to clone a Linux system again. I had done cloning before, to an identical drive in the same computer. The dd command makes that boringly easy:

dd if=/dev/sda of=/dev/sdb

Wait a while, and your second SCSI disk (/dev/sdb) is an exact copy of the first (/dev/sda): boot record, partitions, everything. And by the way, the system on /dev/sda need not be Linux. If it is Windows or whatever else, just reboot to some Live Linux CD to make the copy.

But this time, the problem was a little different: I wanted the copy to go to an identical disk, but on another (also identical) computer. Not only did I not want to stop the system during the copy, but I didn't even have the cable to attach my disk to the "master" computer. Well it turned out to be almost as boringly easy than the previous example.

This page (from which this blog entry got it's title) goes into a lot of details, but to sum it up for the impatient, my simple problem was solved like this:

Boot the machine (which we will call Slave) with some Linux media like a Knoppix live CD. My DHCP server assigned it the IP address 192.168.1.220.

On Slave, runnc -l -p 9000 | dd of=/dev/sda(note that it is important to start with Slave)

On Master, rundd if=/dev/sda | nc 192.168.1.220 9000

Go have a drink

That was it. If you enjoy drinks and want to also take a nap or something, replace your Gigabit switch with an old 10-Base-T hub between the 2 machines.

Don't forget to disconnect the network cable before rebooting Slave into it's brand new system, or you will have an IP address conflict if Master uses fixed IP addresses. And find more interesting names for the poor machines before the PC police gets you.

Update: now that I have used this method several times, I would like to do it with multicast to several machines at once. If you know how to do that, please leave a comment...

Thursday, February 24, 2005

I'm getting really mad at that braindead "Browse For Folder" dialog box which many applications seem to like using. I guess the dialog is really a Microsoft invention supposed to make life easier for braindead users. Maybe it does for them, but I doubt it. Anyway, for any normal person, it only makes it extremely difficult to create a new folder. What is particularly disheartening is that it seems to be mainly the open source apps which use it.

This example shows the dialog when installing Firefox. But I have had to endure it with many other apps.

So, let's say I would like firefox installed in D:\firefox instead of C:\Program Files\Firefox. I click on "Browse..." and what I expect is having a choice of browsing to there, or just typing or pasting into an edit box, which is usually much faster and easier.

When I click "Browse...", I see something like this (well, not really; but you don't need to see my Program Files folder):

So instead of painfully clicking my way through the maze of disks and folders while trying to avoid the traps of all the stupid virtual folders which Windows helpfully scattered around, I just type ahead into the edit box ...

... and press enter.

Well, guess where Firefox is about to install itself:

Was this supposed to be "user-friendly" and "intuitive"? I have only one explanation: the developers expect me to be too stupid to use my keyboard, and think it's better if they ignore the random characters I could accidentally have typed when putting my beer on the keyboard (what is a keyboard anyway? some legacy device from before Apple invented mice?) ...