sigh I have my moments, of course, where I proudly proclaim how much Windows irritates me, what a steaming bag of crap it is, etc., so I’m just as guilty of being a participant in the “OS religion wars” as anyone else, but there are still some brands of advocacy that seriously annoy me …
You expect a certain amount of advocacy (and an appropriate reduction in relevance) from a site devoted to one brand of Unix (in this case, they just love Apple’s flavor of BSD), and while the article itself takes more jabs at Windows than it does all those “regular Unix” installations, it still fires off a few dirty shots at an OS that has been around a lot longer than Apple’s BSD wrapped in its plastic, shiny finish.
Of particular amusement are lines like these:
But what happens when your disk is becoming a doorstop? As long as it continues to spin, even with physical damage on the drive, dd and Mac OS X will get you out of the fire.
Yeah, because only MacOS X has the magic dd command … oh, wait, no, every Unix out there has it. I’m just running Linux on a dumpy little PC … I’d better check to make sure:
will@phoenix:~$ dd --version
dd (coreutils) 5.93
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software. You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.
Written by Paul Rubin, David MacKenzie, and Stuart Kemp.
Hmmm. Looks like I do have it after all. Oh goodie. Maybe I can rescue bad disks too.
Here’s where your Mac OS X box is far and away the best thing to have. In this example, the dd output file is foo.dmg. You have to realize that this is an exact copy of a busted drive, but the “holes” are filled with nulls. As long as the damage isn’t to the boot sector, though, when you double-click on it, Mac OS X mounts it without breathing hard … who cares if it’s FAT32, NTFS, whatever.
…or your FreeBSD box, Linux box, NetBSD box, and so on, and so on. Just about any Unix can mount a disk image “without breathing hard.” It’s called a “loopback” device, and this little miraculous innovation has been around, since, well, a lot fucking longer than MacOS X.
The best part is the explanation of how “as long as the damage isn’t to the boot sector,” you’re okay. Bzzzzt. The boot sector contains — wait for it — boot information. On a PC, that little strand of 512 bytes tells the machine not only the layout of the disk’s partition(s), but how to load a program from it (a smarter boot loader or a kernel) and where that program is.
On less crippled platforms (hey, I never said PCs didn’t suck; I’m just railing against this MacOS X worship
) the boot block and partition table can be bigger/more complex, but generally it tends not to matter too much.
Moving right along, a filesystem doesn’t live on the “boot sector” of a disk. The boot code (if any) and partition tables do. Because all modern filesystems (even NTFS) have recognizable fingerprints, you don’t technically even need the partition tables to find and mount a filesystem on a bad disk as long as you can scan the disk and find the superblock fingerprint. The superblock tells you where all the files and structures live on disk.
What the article meant to say was that as long as there’s at least one good copy of the superblock, you’ve at least got yourself a roadmap in figuring out where the hell all your files have gone.
Unfortunately, since the superblock is definitely bigger than the boot sector, there’s more chance for something to go wrong.
Due to the size of the image that we were copying, we put it on a RAID array, and had to access the image over the network — it still mounted fine. In straight UNIX, if you try to mount a disk image, it complains that there is “no block device” and fails.
…unless your installation is running with an understanding of the remarkably standard notion of a network block device. Or if your kernel supports loopback devices (they almost all do nowadays). Yet another mindless shot fueled by ignorance.
Finally, since your disk is actually dying, once you have your image, you can drop it to tape or something and you’ve not only recovered your files, you’ve made a viable backup as well.
A viable backup? Of a corrupted filesystem read from a failing disk? Yeah. Stick that tape into a brand new system and image it from that tape immediately. We’ll have ourselves a flawless system! Except for the holes…
Then again, a good fifteen fucking years ago, in a pinch at a lab in Fort Collins we dumped an entire disk to tape, moved the tape over to another machine, and booted the system straight from tape. Apart from being a somewhat slow boot, it was quite impressive to see a machine bootstrap itself from a fucking tape. It didn’t have that shiny blue plastic feel to its interface though, so it must not have been nearly as cool.
Once again, that which destroys a Windows box becomes a play thing to a Mac OS X box.
This is a classic example of an unpopular nerd picking on a disabled kid in school to try to look cool to his peers … everybody gets to kick Windows around, even the Mac zealots, because Windows sucks. We get it. You’re oh-so-cute in your plastic-coated sandbox making “play things” out of ailing hard disks while the rest of us are getting real work done.
It’s not big news, folks — the “trick” described here is standard-issue to any decent Unix admin from the past twenty or so years (if not longer). Just because your machine can type “mount /path/to/my/bad/disk.img /place/to/mount/it” for you when you click an icon doesn’t mean it’s doing some seriously magical things. It’s just being Unix.
She turned away from me and then turned back and said, “Did I get it?
I said, “Yeah. Well, I mean, most of it, but hey, you know, don’t sweat it.”
— Trapped in the Drive-Thru, Weird Al Yankovic
Comments
Let's be fair
Let’s be fair here for a moment. The majority of people I work with (at a fairly large IT firm) and the majority of people that I know personally have switched to OS X recently from Linux/Solaris/FreeBSD/Windows/etc. simply because it is the best overall system out there. While the tools inherent in OS X are generally UNIX-based, nobody is claiming otherwise. But, to be fair, Linux and other UNIX-like OS’s (besides OS X) never have and probably never will be usable to the mainstream general public. And honestly, with how great OS X is for both hard-core development and everyday use, it doesn’t look like that will ever change. So, if these kinds of articles are out on the internet, exposing a broader and more diverse audience to the power of UNIX-based tools, then more power to them. And you should be supporting these kinds of articles, not bashing them. You are only shooting yourself in the foot.
Gimme that gun, I missed my foot the first time :)
Indeed — let’s be fair. Which makes more sense when a disk breaks — go buy a Mac (at least five hundred bucks), bug a friend to help (with whatever computer he’s running — be it Mac, PC, Sun, HP, IBM, etc.), or boot a free Linux disc to run through these same instructions?
I’m not bashing the article’s contents. I’m annoyed at the article’s “revelation” that you just couldn’t do this before MacOS X came along, because it’s entirely not true.
Linux is equally good for “hard-core development and everyday use.” More and more people are switching to it. Win32 is nice and flaky, and there’s lots of other alternatives (MacOS included).
Articles like this are a good start but they need to actually say “oh, yeah, you don’t have to buy a new computer to get this kind of power — you can just download and burn a Linux live CD, boot it up, and do this same stuff to fix it, all without having to install it or delete your Windows installation.” The article doesn’t describe anything new. If anything, it’s pointing out that the Macintosh brand has moved out of the stone age of computing by migrating its users onto Unix.
Post new comment