Date: Wed, 13 Sep 2023 12:57:14 +0100 From: Frank Leonhardt <freebsd-doc@fjl.co.uk> To: questions@freebsd.org Subject: Re: Mount bzip2 disk image Message-ID: <96ce2d8b-f310-96bc-394c-007541401c57@fjl.co.uk> In-Reply-To: <d29db23f-d20a-7e03-1498-4ff02344243d@netfence.it> References: <d29db23f-d20a-7e03-1498-4ff02344243d@netfence.it>
next in thread | previous in thread | raw e-mail | index | archive | help
On 13/09/2023 09:56, Andrea Venturoli wrote: > > I've got a bzip2-compressed quite big HD image. Is there a way to > mount it (read-only) without uncompressing it first? I don't care > about performance as I only need to recover a single file. > Uncompressing it would probably take days, provided enough space is > available (which I'm not sure is the case). > > The idea would be: > _ mdconfig -a -f xxx.img.bz2 > _ .... use something over /dev/md0 to get /dev/xxx > _ mount /dev/xxxp4 /mnt/tmp. > > Does such a thing exist? > Such a thing does exist, sort-of. It's the GEOM_UZIP driver from FreeBSD 13 onwards. However I'm pretty sure it only works in images compressed by its own mkuzip utility (and that doesn't include bzip2 having just RTFM). Never tried it myself. If you unpack it to a ZFS dataset with compression enabled, the compression ZFS uses is pretty good so you might find that the disk space isn't the problem you think it might be. In other words, if you put xxx.img.bz2 on to tape and unpack it as a stream to a disk file it may use about the same as having the file online. ZFS dataset compression has persuaded me to not bother with file-level compression formats for many years - a PITA eliminated. If your tape handler does compression (most do) then everything is compressed for free and you never have to worry about the format. Regards, Frank.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?96ce2d8b-f310-96bc-394c-007541401c57>