[CentOS] copying files to fill flash drives

Fri Jan 10 14:32:16 UTC 2020
Jonathan Billings <billings at negate.org>

On Fri, Jan 10, 2020 at 01:33:23AM -0600, Frank Cox wrote:
> Back in the days of DOS I had a program that I obtained from
> somewhere called FILL. 
> FILL would take the name of a directory and then start writing files
> from that directory onto a series of floppy disks in such a way that
> each disk was made as full as possible, but without modifying the
> files that it was writing. 
> So you might end up with disk 1 having files A B and D on them since
> D fitted but C was too big so it went onto Disk 2 along with files E
> and F. 
> Before I re-invent the wheel here, does someone already have a way
> to do this with Linux so you can write a series of flash drives and
> fill them with the contents of a specified directory without
> modifying the files that get written?  The reason that I specify
> without modifying the files is that I could do this easily with tar
> and split, but then I end up with a tar file and can't just look on
> disk 1 and copy file A off of it later on.

GNU tar (and older BSD versions too) have always supported writing to
multiple tapes.  You can set a multi-volume tar file with
tar -M -L <tape length> ...


I suspect if you got the right length it'll work pretty well.  It
might work without specifying it, if it detects the end of the device
correctly, but I'd test it first.

Jonathan Billings <billings at negate.org>