The arrow of time

Ivan Voras' blog

Fuckup fairy narrowly avoided

The default GEOM partition slicer in FreeBSD has been changed relatively recently - now it's the unified slicer called GPART. It supports many different partition types with a consistent interface. Unfortunately, it isn't 100% compatible with previous slicers - devices can get renamed! Even though I knew this in principle, I still managed to create a ZFS file system that clobbered a partition table I really wished I didn't clobber.

In retrospection it probably wasn't as scary as I thought at the time (a few hours ago) but it's still chilling having to think in parallel where my backups are (yes, I do have them for important stuff!) and what to try to dig myself up from the mess. The partition table in question was a nested (DOS/fdisk extended) table with two partitions - a scratch partition (luckily located in front of the outer partition)  and an important work partition with the ext2 file system (which can be mounted in FreeBSD, Linux and Windows).

One of the things I couldn't get working is e2fsck to find any backup superblocks, so I searched for a utility that can brute-force scan them. I found TestDisk. I've never heard about it before, it has a user interface worse than sysinstall, but it worked. After some fiddling with it, I had my working file system back.

Except for a naming bug in gpart, it looks like my data is back to normal now.

Post your comment here!

Your name:
Comment title:
Text:
Type "xxx" here:

Comments are subject to moderation and will be deleted if deemed inappropriate. All content is © Ivan Voras. Comments are owned by their authors... who agree to basically surrender all rights by publishing them here :)