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. -- MELVILLE THEATRE ~ Real D 3D Digital Cinema ~ www.melvilletheatre.com
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> ... https://www.gnu.org/software/tar/manual/html_node/Multi_002dVolume-Archives.html 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>
> On Jan 10, 2020, at 1:33 AM, Frank Cox <theatre at sasktel.net> 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. >I only can think of vaguely resembling thing: multi-volume tar archives, as in: https://mynixworld.info/2014/04/13/creating-multi-volume-tar-bz2/ Valeri> -- > MELVILLE THEATRE ~ Real D 3D Digital Cinema ~ www.melvilletheatre.com > _______________________________________________ > CentOS mailing list > CentOS at centos.org > https://lists.centos.org/mailman/listinfo/centos++++++++++++++++++++++++++++++++++++++++ Valeri Galtsev Sr System Administrator Department of Astronomy and Astrophysics Kavli Institute for Cosmological Physics University of Chicago Phone: 773-702-4247 ++++++++++++++++++++++++++++++++++++++++
Once upon a time, Frank Cox <theatre at sasktel.net> said:> 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.I remember using a program like that. I'm not sure if something like that is available for Linux, and if it would handle USB (you'd have to actually look at each stick since they aren't always exactly the same size). If it helps your search, what you are looking for is an application of the knapsack algorithm. -- Chris Adams <linux at cmadams.net>
On Fri, 10 Jan 2020, Chris Adams wrote:> If it helps your search, what you are looking for is an application of > the knapsack algorithm.Actually bin packing. -- Michael hennebry at web.cs.ndsu.NoDak.edu "Sorry but your password must contain an uppercase letter, a number, a haiku, a gang sign, a heiroglyph, and the blood of a virgin." -- someeecards
On 1/10/20 2:33 AM, Frank Cox wrote:> Back in the days of DOS I had a program that I obtained from somewhere > called FILL. ... 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?This would, in my opinion, be a useful thing.? I found several simple knapsack implementations; one of which is at https://github.com/vaeth/knapsack What would be very useful is to dynamically load the knapsack based on size of whatever USB drive you just plugged in; so if you have say 4 32GB drives, a 128GB drive, and a 64GB drive, the filling would be efficient no matter which order you plug the drives in. There have been several times I have wished for such a utility; I had one for the old TRS-80 LS-DOS 6 when I ran a TRS-80 Model 4 with a 20MB hard drive to copy to floppies, even when the floppies might have a different amount of free space. I've done the multi-floppy tar thing back in Xenix days, and that was painful to say the least.