12 August, 2007

The fscking problem with pretending Darwin is FreeBSD



from fsck(8) (note: No entry for fsck in section 1 of the manual)


-b Use the block specified immediately after the flag as the
super block for the filesystem. Block 32 is usually an
alternate super block.



The problem is that, of course, block 32 is no such thing. Furthermore, on some other filesystems, when you initialize them you essentially are able to tell it you wanted lots, or not a lot of superblocks. I don't have a running Linux machine here, or I'd show you. The point is, the next thing in the Darwin fsck manpage is thus:


-c Convert the filesystem to the specified level. Note that the
level of a filesystem can only be raised. There are cur-
rently four levels defined:

0 The filesystem is in the old (static table)
format.

1 The filesystem is in the new (dynamic table)
format.

2 The filesystem supports 32-bit uid's and gid's,
short symbolic links are stored in the inode,
and directories have an added field showing the
file type.

3 If maxcontig is greater than one, build the
free segment maps to aid in finding contiguous
sets of blocks. If maxcontig is equal to one,
delete any existing segment maps.



The problem herein is of course:


bling% sudo fsck -c 3 /dev/disk3s3
fsck: illegal option -- c
fsck: ? option?



And then there's the good old "block 32" fix:


bling% sudo fsck -b 32 /dev/disk3s3
Alternate super block location: 32
** /dev/rdisk3s3
BAD SUPER BLOCK: MAGIC NUMBER WRONG

LOOK FOR ALTERNATE SUPERBLOCKS? [yn] y

SEARCH FOR ALTERNATE SUPER-BLOCK FAILED. YOU MUST USE THE
-b OPTION TO FSCK TO SPECIFY THE LOCATION OF AN ALTERNATE
SUPER-BLOCK TO SUPPLY NEEDD INFORMATION; SEE fsck(8).



And of course, it tells me to check out fs(5) which is cool, except that we know that 5 is the programmer's section of the manual, and not the binaries section (or even the miscy or errata section). So while


#include <sys/types.h>
#include <ufs/fs.h>
#include <ufs/inode.h>



(yes, it says ufs because, uh, everyone on the mac uses ufs, right?) is useful to somebody, it's absolutely useless to somebody trying to figure out why the fuck their volume is toast. So I have now this silly mac Mini with four 250gb drives in a raid 0, backing up a single 640gb drive that contains all my music and other media so that I can then blow away the 640 drive and hopefully give it some better options from newfs. I don't think I can trust Disk Utility anymore.

Who QA's this shit, coming out of Apple? I mean, if people are building clusters on XServes and they're doing evil things with eight-core xeon towers, why is it we can't have a reasonable, robust filesystem with redundancy, journaling, and oh yeah, performance?

Even on OpenBSD when you had ffs and we liked it, or when we had to choose between jfs, ext2, ext2, or even XFS on Linux, we had reasonable assurances that our manual pages were correct, that our filesystems, while they may crap out, would crap out in ways that weren't "the crap fairy visited, she was pissed, and she didn't leave a note."

It's almost enough to make me think I oughtta get rid of the mini, build a shuttle pc with about a bazillion 1394 and usb2 ports, as well as an 802.11N card, and have it essentially be NAS for the media. Even run leenucks on it. At least then, when shit went splode, I'd know where to go looking. Not any of this "totally fucking wrong manpage" garbage.

Please Donate To Bitcoin Address: [[address]]

Donation of [[value]] BTC Received. Thank You.
[[error]]
Post a Comment