Introducing fpart - a file partitioning tool

Ganael LAPLANCHE ganael.laplanche at
Fri Jan 6 10:56:47 UTC 2012

Hi everyone,

Have you ever wondered how you could split a file tree into parts of the
same size, or into parts with a limited size or file number ?

I have developed a small BSD-licensed tool called fpart that can do that
for you (see and

This small C program will crawl a given set of file or directory paths,
organize them and print resulting partitions. This can be useful to e.g.
launch several rsync(1) in parallel or store files on media of limited size.

Here are some examples :

1) Produce 3 partitions, with (approximatively) the same size and number
of files :

$ fpart -n 3 -o var-parts /var

2) Produce partitions of 4.4 GB, containing music files ready to be
burnt to a DVD :

$ fpart -s 4724464025 -o music-parts /path/to/my/music

3) Produce partitions containing 10000 files each by examining /usr and
/home :

$ find /usr ! -type d | ./fpart -f 10000 -i - /home | grep '^0:' 

The tool is already available in ports (sysutils/fpart) but has also
successfully been used on GNU/Linux.

Enjoy !

Best regards,

PS : comment and patches are, of course, welcome :)

Ganael LAPLANCHE <ganael.laplanche at> |
FreeBSD: martymac <martymac at>,

More information about the freebsd-ports mailing list