Mounting partitions from disk images in Linux

I've recently been working extensively with disk image files (actually Compact Flash images, but that's not a useful differentiation). The first time I tried to mount one to work on, with a simple "mount -o loop hd.img /mnt", I was confronted with "mount: you must specify the filesystem type". Okay, then -- "mount -o loop hd.img /mnt -t ext2". Still no love. What gives? A couple of seconds of actually thinking about it gives the answer -- mount mounts partitions -- not disks.

The solution is straightforward enough, but somewhat burdensome. I'll present a shell script to make it easy.

A tip for dd: get a progress report

Many have been the times when I wished the dd utility gave progress messages. It's annoying to be some unknown percentage through some gigantic operation. Somehow, despite the fact that I must have read the help a million times, I never noticed that there was a way to do this. Maybe you didn't either.

Using Greasemonkey to disable Firefox autocomplete

Sometimes Firefox's textbox autocomplete gets in the way. WeBWorK is one example of where it's really annoying. With this Greasemonkey script, you can easily disable it on a page-by-page or site-by-site basis.

Exit codes for bash pipelines

When building a pipeline for a shell script, you may come across an unpleasant situation: some program fails and returns a nonzero exit code, but one of the subsequent programs does not register an error and returns an exit code of zero.

A tip for cygwin users

Windows becomes a remarkably more useful tool for geeks when it has cygwin installed. I basically always have at least one bash shell open. Historically, I have just used it in a normal Windows console. However, there's a cygwin package which is a Windows build of rxvt that works without X, and I recently started using that instead (rxvt is a fairly slim terminal emulator). Life is a lot better.

A tip for when dhclient mysteriously fails

If you find that dhclient (the common DHCP client for Linux) mysteriously fails -- check that the loopback interface is up. "ifconfig lo up".

Genesis of Unix

I have read a number of Unix histories which must have used this 1979 paper as a source, but I only just read the paper itself recently. It is by Dennis Ritchie himself (he is one of the fathers of Unix), and discusses the very birth of Unix from an inside perspective. While information on the hardware is not enormously interesting anymore, the bits about its incremental development and the birth of some things we take completely for granted now (modern pipelining) are fascinating.

Appropriately, the paper is hosted by Bell Labs.

Genesis of the ext3 filesystem

To quote: The ext3 filesystem is a journaling extension to the standard ext2 filesystem on Linux.

What's interesting here is that it's basically just the unjournalled ext2 filesystem, but with journalling added on. Even with journalling, it's still ext2. That is, an ext3 filesystem is still an ext2 filesystem. For that matter, an ext2 filesystem is already basically an ext3 filesystem. The matter of how and where journalling actually comes in to play is really quite interesting.

Syndicate content