[Gllug] Large files

Les Till les_till at cableinet.co.uk
Fri Sep 21 16:03:06 UTC 2001


Simon Stewart wrote:
> 
> On Fri, Sep 21, 2001 at 04:34:30PM +0100, will wrote:
> >
> > Something sort of related to this.  If I do:
> >
> > #split -b 1.4m big-file.tar.gz
> >
> > to get a file down to floppy diskable sized files, can I just cat them
> > together at the other end or is there something else I need to do?
> 
> catting the files together works just fine: used to use the same
> method to hoik large archives from uni on to my home machine.
> 
> Cheers,
> 
> Simon
> 
> --
> Real Programmers don't write specs -- users should consider themselves
> lucky to get any programs at all, and take what they get.
> 
> --
> Gllug mailing list  -  Gllug at linux.co.uk
> http://list.ftech.net/mailman/listinfo/gllug
Got this from my notes. Don't remember where it came from
*********************************************************
-------------- next part --------------
 Splitting large files over several Floppies.
  
   Every Linux comes with the
GNU utilities. One of these is "split" which will do the job. Read man
split or info split.

 To split a file into floppy sized files

 	split -b1440k a_whopping_big_file chunk
 which produces chunkaaa, chunkaab, chunkaac etc.

Use mcopy to copy to/from floppy. To re-create a_whopping_big_file do

 	cat chunk* &gr; a_whopping_big_file

   Method 2.

 The required task is rather easy to be achieved if both source and
 target system are linux and have GNU tar installed.

 Assume floppy drive is a 3.5" drive at /dev/fd0

 Copy to disk:
tar -c -f /dev/fd0 -L1440K -M <File-Name>

 Copy from disk:

tar -x -f /dev/fd0 -L1440K -M <File-Name>

 tar will prompt the user to enter a new disk when ever it made one full.

 Note:
The floppy disks will be overwritten without warning. Any old content is
lost. No useable file system is installed. The disks are treated as a
"tape" containing a set of blocks. For any later use with an operating
system (DOS, Linux) the disks need to be reformatted.


   Short explanation:
  If you use the 'split' command, you can split a file up into
chunks. Once onto a floppy, you can transport the file. When you want to
reclaim the files, you can simply copy them back to hard drive and use
'cat' to put them back together.

    Long (full) explanation:
   I have a 292529 byte file named lasg-0-0-9.pdf on my hard drive, and
I want to save it in chunks (or less) so I can put it on floppy for
saving...
   You can see that no chunk is larger than 1K, as specified by the -C1k
option to 'split'. The second option un this example is the name of the
original file, and the third option in this example is the name of the
output file prefix.
  The prefix is followed up by a unique string which ensures that when
concatenated in a sorted order that you get the same file back. I tested
this with the command 


cat lasg-0-0-9.pdg[a-z][a-z]* > tmp.lasg-0-0-9.pdf 

and the resulting file tmp.lasg-0-0-9.pdf was
identical to the original file.



% split -C1k lasg-0-0-9.pdf lasg-0-0-9.pdf
%ls -al 
Total 655
drwxrwxr-x   2 vocalist users        9216 Aug 21 08:53 .
drwxr-xr-x  20 vocalist users        2048 Aug 21 08:50 ..
-rw-rw-r--   1 vocalist users           0 Aug 21 08:53 data
-rw-rw-r--   1 vocalist users      292529 Aug 21 08:50 lasg-0-0-9.pdf
-rw-rw-r--   1 vocalist users         898 Aug 21 08:52 lasg-0-0-9.pdfaa
-rw-rw-r--   1 vocalist users         738 Aug 21 08:52 lasg-0-0-9.pdfab
-rw-rw-r--   1 vocalist users        1024 Aug 21 08:52 lasg-0-0-9.pdfac
-rw-rw-r--   1 vocalist users        1024 Aug 21 08:52 lasg-0-0-9.pdfad
[Lots and lots of lines not shown. -Ed.]
-rw-rw-r--   1 vocalist users        1020 Aug 21 08:52 lasg-0-0-9.pdfno
-rw-rw-r--   1 vocalist users        1000 Aug 21 08:52 lasg-0-0-9.pdfnp
-rw-rw-r--   1 vocalist users         118 Aug 21 08:52 lasg-0-0-9.pdfnq


You can find out more by typing "man split" or "info split".

 But in your case you'd probably want to try

$ split -b 1380k your.file your.file

So it'll split the file "your.file" into files of 1.38m in size (ideal for
floppies), named your.file.aa, your.file.ab and your.file.ac (etc if you use
a different size).

 You can rejoin them with

$ cat your.file.aa your.file.ab your.file.ac & your.file



 dd will do the trick.

 Use it in the form:

dd if=your-input-file of=first-out-file skip=0 count=2840
dd if=your-input-file of=second-out-file skip=2840 count=2840
dd if=your-input-file of=third-out-file skip=5680 count=2840


...and so on.

 Assuming blocksizes are 512 bytes, so the count of 2840 is approx. 1.4 Mb
To get the file back just use cat command:

cat first-out-file > your-file
cat second-out-file >> your-file

... and so on

 of course it will be a bit easier if you make a shell script of it.

 Thats it.

 3) Zip the file and use zipsplit to split it into files that will fit
on a floppy.
.=========================================================================


More information about the GLLUG mailing list