Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 23 Sep 2005 14:59:17 +0100
From:      Brian Candler <B.Candler@pobox.com>
To:        Mikhail Teterin <mi+mx@aldan.algebra.com>
Cc:        current@freebsd.org
Subject:   Re: using bzip2 to compress man-pages
Message-ID:  <20050923135917.GA97140@uk.tiscali.com>
In-Reply-To: <200509221652.54123.mi%2Bmx@aldan.algebra.com>
References:  <200509220446.j8M4kBPA019823@blue.virtual-estates.net> <20050922182104.GC990@galgenberg.net> <CF4FBAB7-791D-41E0-B59B-9D78C6E4381F@mac.com> <200509221652.54123.mi%2Bmx@aldan.algebra.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Sep 22, 2005 at 04:52:53PM -0400, Mikhail Teterin wrote:
> The space-saving potential can substantial, however -- see below. Being able 
> to stick us useful root filesystem (with /usr) onto a USB key can be useful 
> for some applications.

Of course, if space is that critical you don't need to install the
'manpages' distribution set in the first place.

However I have another suggestion. For USB pen drives, if you don't mind
your /usr filesystem being read-only then you can get a big benefit from
using geom_uzip. I've just tried it on the manpages:

# du -sk /usr/share/man
17978   /usr/share/man
# dd if=/dev/zero of=test.ufs bs=1k count=50k
# mdconfig -a -t vnode -f test.ufs -u 0
# bsdlabel -w md0 auto
# newfs -m 0 -i 1024 md0c
# mount /dev/md0c /mnt
# tar -C /usr/share/man -cf - . | tar -C /mnt -xf -  # note, lots of hard links
# df -k
Filesystem                 1K-blocks     Used   Avail Capacity  Mounted on
...
/dev/md0c                      44526    17980   26546    40%    /mnt

# umount /mnt
# mdconfig -d -u 0
# mkuzip test.ufs
# ls -l test.ufs.uzip
-rw-r--r--  1 root  brian  12966912 Sep 23 14:42 test.ufs.uzip

# mdconfig -a -t vnode -f test.ufs.uzip -u 0
# mount -r /dev/md0.uzip /mnt
# df -k
...
/dev/md0.uzip                  44526    17980   26546    40%    /mnt

That's a reduction from 17978K to 12663K, or 30%, even though all these
files are already compressed (apart from /usr/share/man/whatis, which is
only 210K). I expect that's due to the partial sectors at the end of all
these small files.

I've never tried booting from a geom_uzip filesystem, but I don't see why it
shouldn't work :-)

Regards,

Brian.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050923135917.GA97140>