[Cialug] Linux equivalent to OS X hdiutil

Zachary Kotlarek zach at kotlarek.com
Sat Jun 20 12:37:06 CDT 2009


On Jun 20, 2009, at 8:03 AM, David W. Body wrote:

> I want to be able to create backups of directories in a reasonably  
> efficient compressed format.  I don't need to be able to add data  
> after the backup is created.  Under OS X, I've found that hdiutil  
> does a decent job of this with the added bonus that the disk images  
> it creates are convenient to work with because they can easily be  
> mounted and unmounted, transferred to other media, etc.  I'm looking  
> for something similar on Linux.  My fallback will be gzipped tar  
> files, but that feels like a step backward.


I'd suggest squashfs -- a read-only file system that automatically  
does de-duplication and compresses with gzip or lzma. Once you've  
created a squashfs you can then mount the image via the loopback  
driver to access it as a live file system.


Assuming you have the squashfs tools installed it's as simple as:
	mksquashfs /your/source/dir /output/image.sqsh

And to mount it:
	mount /output/image.sqsh /mnt/whatever -t squashfs -o loop

It's not quite the same as the Apple disk images in that the file  
system is indistinct from the fake block device, but it should be  
sufficient for making backups and whatnot, and it's certainly easier  
to use than tar if you want to pull out just a couple of files.

--

You've actually got me wondering if I could adapt my backup process to  
use fs images instead of tarballs. It seems that mksquashfs does  
support an excludes file, which is about the only other feature I  
need. While I'd lose the ability to restore directly from linear media  
it would make backups browsable, which is probably a more useful  
feature.

	Zach

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2746 bytes
Desc: not available
Url : http://cialug.org/pipermail/cialug/attachments/20090620/6bea2b94/attachment.bin 


More information about the Cialug mailing list