[Gllug] Email programs and mbox format

Doug Winter doug at pigeonhold.com
Mon Mar 15 16:58:44 UTC 2004


On Mon 15 Mar Sharon Kimble wrote:
> Unfortunately I'm stuck with this ext3 format as that is what the distro
> set up its '/' folder system as. But as its a 30 gig drive and i've
> still got 12gig left I'm not too worried about it.

Well this might be an utterly insane idea (I'm almost sure it is in
fact), but you could always create a new filesystem inside a file on
your current disk, and make that new filesystem use a smaller blocksize,
and then mount it loopback.  And then put your mail in there.  

That way you get the nice efficient small blocks for your maildirs/mh
but you don't need to reformat any disks.

    $ dd if=/dev/zero of=/var/tmp/mail count=8192
    $ /sbin/mkfs -t ext3 -b 1024 /var/tmp/mail
    $ sudo mount /var/tmp/mail /mnt -t ext3 -o loop=/dev/loop1

Now on /mnt you have a 4Mb virtual filesystem with a blocksize of 1024.

Obviously you'd want a bigger count= if you want a larger filesystem.
And you'd want to put the file somewhere sensible.

If you make it ext2 instead of ext3, then you can even resize it using
ext2resize:

    $ dd if=/dev/zero of=/var/tmp/mail count=8192
    $ /sbin/mkfs -t ext2 -b 1024 /var/tmp/mail
    $ sudo mount /var/tmp/mail /mnt -t ext2 -o loop=/dev/loop1
    $ df -h /mnt
    Filesystem            Size  Used Avail Use% Mounted on
    /var/tmp/mail         3.9M   13K  3.7M   1% /mnt
    $ sudo umount /mnt

    $ dd if=/dev/zero of=/var/tmp/new_extent count=8192
    $ cat /var/tmp/new_extent >> /var/tmp/mail
    $ /sbin/ext2resize /var/tmp/mail 6M
    $ sudo mount /var/tmp/mail /mnt -t ext2 -o loop=/dev/loop1
    $ df -h /mnt
    Filesystem            Size  Used Avail Use% Mounted on
    /var/tmp/mail         5.9M   13K  5.6M   1% /mnt

You could even use a different filesystem better suited to lots of tiny
files (reiser is the obvious one, but lots of people say it sucks and
I'll believe them).

This is probably a really terrible idea, however I can't see any reason
why it wouldn't work :)

doug.

-- 
6973E2CF: 2C95 66AD 1596 37D2 41FC 609F 76C0 A4EC 6973 E2CF
Being a good writer is 3% talent, 97% not being distracted by the
Internet.

-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list