[comp.sys.next] Gnu tar multivolume floppy disk operation

pierce@cantrell.tamu.edu (Pierce Cantrell) (05/17/91)

Has anyone gotten the multivolume feature of Gnu tar to work with the floppy  
disk? This feature works great over the network to tape, but I have been unable  
to get it to work correctly to the floppy disk.

For example, with a command like
	tar -c -v -V "Whatever" -f /Disklabel/file.tar -M
tar fills up the disk and the OS returns a file system full error message.
Then tar puts out an error message that it can't close the file. Tar next  
prints a message telling you to load the next volume. In listing the archive  
using the the -t and -v options, tar prints an error message that the second  
volume is out of order when you try to load it. Looking at that volume alone,  
you can see a continued file.

Using /dev/rfd0a or /dev/fd0a causes tar to simply give up when the disk is  
full, and tar does not prompt for a second volume.
--
Pierce Cantrell                                cantrell@ee.tamu.edu
Department of Electrical Engineering        
Texas A&M University                           tel: (409) 845-7441
College Station, Texas 77843-3128              fax: (409) 845-6259

pierce@cantrell.tamu.edu (Pierce Cantrell) (05/19/91)

In article <16297@helios.TAMU.EDU> pierce@cantrell.tamu.edu (Pierce Cantrell)  
writes:
> 
> Has anyone gotten the multivolume feature of GNU tar to work with the floppy  
> disk? This feature works great over the network to tape, but I have been  
> unable to get it to work correctly to the floppy disk.

Since there were several people that were interested in this, I will respond to  
my own post. Version 1.09 of GNU tar (I got the version that Kim Simmons posted  
on sonata.cc.purdue.edu) will work with the NeXTStation internal floppy drive  
if the following parameters and precautions are used:

	(1) Don't insert floppy disks into the drive until you receive a window prompt  
If you do, the automounter will grab the floppy, and if you have tar'd to the  
disk, you will not be able to get everything back. When GNU tar prompts for the  
next volume, you can type   ! <CR> to escape to a sub-shell, and then do a 
/usr/etc/disk -e /dev/rfd0a to eject the current disk. Next, exit from the  
sub-shell, and then type a <CR>. Finally, insert the disk when you see the  
window prompt. (This is hard to get used to at first. I have screwed up several  
tar files by inserting the floppy before I typed return. Perhaps read  
protecting the disks after you have tar'd to them is the way to avoid this  
problem). 

	(2) Use a blocksize of 4, i.e., on the tar command line -b 4.
The default blocksize for tar is 20. The way tar currently checks for the end  
of the disk is apparently not compatible with the way the NeXT floppy driver  
returns status on a write. (BTW: I initially tried blocksizes of 1 and 2 once I  
figured out what the problem was, but tar has an error in handling these  
sizes). For -b 4  to work, the disk has to have (# sectors) mod 4 = 0. I have  
used 1.4 MB floppies without any problems.

	(3) Use -f /dev/fd0a. Out of the box, these devices are protected so you will  
need to be logged in as root.

I have tested this across three volumes and made sure that I could recover the  
files that tar splits between the volumes. Note that you cannot use compression  
with the -M (multi-volume) switch. Everything else about multivolume tar seems  
to work as advertised in the manual. The only thing I found confusing is how to  
extract a file that is split between volumes 2 and 3 without reading volume 1.  
To do this, don't include the -V switch. If you include the -V (volume header),  
it will force you to load volume 1.

It would be useful to know if this technique is compatible with writing the  
floppies and transporting from a Sun (Paul Verket described data exchange via  
tar using a single floppy between a Sun and a NeXT in a recent post. He makes a  
similar point about not inserting the floppy until prompted).
--
Pierce Cantrell                                cantrell@ee.tamu.edu
Department of Electrical Engineering        
Texas A&M University                           tel: (409) 845-7441
College Station, Texas 77843-3128              fax: (409) 845-6259