rentzsch.com: tales from the red shed

Full Disk; Delete User

Bugs
My latest trip resulted in a thousand photos and some video clips. 1.5 gigabytes all told. At the time, my data partition (which houses my iPhoto library) was getting tight on space, while my boot volume was fairly open. Thus, the files wound up on boot partition. I created a new user, "mercola", just to hold these files.

Once I got back, I ran through my data partition, deleted gigabytes of cruft, and successfully imported my photos from the boot partition to the data partition. After a backup cycle, I felt safe to delete the redundant files on the boot partition. I figured I'd just nuke the entire account. Hilarity ensues:

You can't delete user account 'mercola' because there isn't enough space on the disk to save the contents of the user's home

That's right boys and girls: you can't delete these files because you don't have enough disk space!

Okay, some background. Previous versions of Mac OS X would reassign ownership of the files. I call this the "Reassign Model". The problem, however, is that they would be ressigned to root or somesuch other weird inaccessible-from-the-Finder account. Thus, you couldn't use the Finder to delete the files that were owned by the account you just deleted. I routinely had to sudo rm -rf those blasted files. That's just begging for unintentional data loss.

Instead of actually fixing the Reassign Model code to reassign ownership to the current admin user, Apple created a wholly new model: "Disk Image Backup". Nowadays Mac OS X creates a disk image and saves off the contents of the account-in-jeporady. Then the original files are deleted, leaving behind a disk image of the old account.

I think the Disk Image Backup Model is a better user experience than the previous Reassign Model. However, it fails when you're running low on disk space (you won't be allowed to delete an account because a backup disk image couldn't be allocated). The bottom line is that Mac OS X won't allow you to deallocate a resource since additional resources must be allocated to complete the operation.

If I were in charge of this code, I'd keep the current Disk Image Backup Model. However, I wouldn't cop out if we couldn't allocate the disk image. Then, I'd fall back to the Reassign Model, which features no resource allocation overhead. Of course, this would still require Apple fix the Reassign Model code, which perhaps they're simply unable to do, and why they came up with the entire Disk Image Backup Model in the first place...

By the way, do you think it would be rude to file a RADAR bug whose entire contents is just the URL of this entry? (grin)

Tuesday, April 01, 2003
11:11 PM