C-Command Software Forum

Make sparsebundle read-only

Every few years I move all my files into a disk image and start from scratch. I need the image to be (mounted) read-only for safety and searchable.

So far I used sparseimage, made Spotlight index them and then locked the file.

This time I tried sparsebundle as it was “recommended for 10.6” and can put images on file systems that don’t support tens of gigabytes in a single file. However I can’t find a way to make them read-only, no matter what permissions I assign to the bundle or the bands folder inside.

I suggest that you use a disk image format that’s inherently read-only, rather than trying to change the file permissions. For example, you could convert your .sparsebundle to a .dmg that uses bzip2 compression. This will save disk space, protect your files with a checksum, and also ensure that they’re not modified. If the maximum file size is a concern, you could create a segmented .dmg.

Unfortunately that step breaks Spotlight. I can open the image before and after conversion side-by-side and only get (fast) filename matches for the .dmg but content matches for the sparsebundle.

Well, this is strange. I’ve verified that even if the read-only disk image contains the Spotlight index files, Spotlight still won’t search it. Does anyone know what’s going on here?

I guess you could set all the folders on your mounted sparsebundle to read-only.

I guess whatever process handles the index just dies if it can’t open the file for writing.

Workaround: hdiutil mount compressed.dmg -shadow

Aha. In that case the shadow feature is a good workaround. This might make a good addition to DropDMG.

It’d be nice to double click a DMG and have it be mounted with -shadow automatically if there’s a .shadow file next to it.

DropDMG 3.1 adds a feature for mounting read-only disk images with shadow files.