svlug-supressing_errors_on_compressed_tar_to_floppy

This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.



From: Robert Hajime Lanning <lanning@lanning.cc>
Subject: Re: [svlug] Weird problem with tar (w/ floppy only)
To: lists@cyclades.com (Ivan Passos)
Date: Wed, 26 Sep 2001 15:10:15 -0700 (PDT)

Ivan Passos wrote:

> I'm trying to "compress tar" a directory into a floppy, with the following
> command:
> 
> 	tar czvf /dev/fd0 dir_name
> 
> This works fine. However, when I try to extract the floppy contents with
> the command:
> 
> 	tar xzvf /dev/fd0
> 
> , I get the following error in the end:
> 
> gzip: decompression OK, trailing garbage ignored
> tar: child returned status 2
> tar: error exit delayed from previous errors
> 



This is because the floppy does not know to stop and the end of file.

Floppies are not like tape where there is an end of file marker.

When you read from the floppy (without a filesystem) you will read the
complete 1.44MB of it.

What you can do to limit the warning message is pipe the data to tar
from something like dd.

If the tar file is 300KB then something like this would work:

$ dd if=/dev/fd0 bs=1k count=300 | tar xzvf -

===

Date: Wed, 26 Sep 2001 15:22:26 -0700
From: "Karsten M. Self" <kmself@ix.netcom.com>
To: svlug@svlug.org
Subject: Re: [svlug] Weird problem with tar (w/ floppy only)


One thought would be to create gzipped output of precisely 1440 bytes
(or the size of storage).  Doing this is a bit tricky as you have to
predict the compressed size of the output.

I've tried zero-filling the floppy disk, this appears to be sufficient:

    $ dd if=3D/dev/zero of=3D/dev/fd0 bs=3D1024 count=3D1440
    $ cd /etc
    $ tar czvf /dev/fd0 init.d
    $ cd /tmp
    $ mkdir foo
    $ cd foo
    $ tar xzvf /dev/fd0

===

Date: Wed, 26 Sep 2001 15:23:34 -0700
From: "Karsten M. Self" <kmself@ix.netcom.com>
To: svlug@svlug.org
Subject: Re: [svlug] Weird problem with tar (w/ floppy only)

Robert Hajime Lanning (lanning@lanning.cc) wrote:

> What you can do to limit the warning message is pipe the data to tar
> from something like dd.

> If the tar file is 300KB then something like this would work:

> $ dd if=3D/dev/fd0 bs=3D1k count=3D300 | tar xzvf -

Note the disadvantage of this method:  the user needs to know the size
of the file being extracted.  By null-filling the floppy first, this is
avoided.

===

Date: Wed, 26 Sep 2001 15:37:10 -0700 (PDT)
From: Ivan Passos <lists@cyclades.com>
To: <svlug@svlug.org>
Subject: Re: [svlug] Weird problem with tar (w/ floppy only)


On Wed, 26 Sep 2001, Karsten M. Self wrote:
>
> I've tried zero-filling the floppy disk, this appears to be sufficient:
>
>     $ dd if=/dev/zero of=/dev/fd0 bs=1024 count=1440
>     $ cd /etc
>     $ tar czvf /dev/fd0 init.d
>     $ cd /tmp
>     $ mkdir foo
>     $ cd foo
>     $ tar xzvf /dev/fd0

This was my first thought too (actually this was exactly my suggestion to
the developer doing the floppy). However, although it did work in my
system (Debian Potato 2.2r3), it did NOT work on his (Red Hat 6.2),
neither did it work in some other systems (Red Hat 7.0, Slackware 6.2).
I have no idea why ...

I guess there is no solution in this case (no easy one, anyway).

Anyhow, thanks for your suggestion!

===

From: Aaron Lehmann <aaronl@vitelus.com>
To: Ivan Passos <lists@cyclades.com>
Cc: svlug@svlug.org
Subject: Re: [svlug] Weird problem with tar (w/ floppy only)

On Wed, Sep 26, 2001 at 02:50:45PM -0700, Ivan Passos wrote:
> I'm trying to "compress tar" a directory into a floppy, with the following
> command:

Without an FS you're asking for trouble. Why don't you use a
compressed filesystem like cramfs? It's read-only, the files are are
compressed, and you won't have problems like this. Plus, you can
actually browse the files and directories on the disk since the
compression is transparent to userspace.

===

Date: Wed, 26 Sep 2001 18:00:22 -0700 (PDT)
From: Ivan Passos <lists@cyclades.com>
To: Aaron Lehmann <aaronl@vitelus.com>
Cc: <svlug@svlug.org>
Subject: Re: [svlug] Weird problem with tar (w/ floppy only)


On Wed, 26 Sep 2001, Aaron Lehmann wrote:

> On Wed, Sep 26, 2001 at 02:50:45PM -0700, Ivan Passos wrote:
> > I'm trying to "compress tar" a directory into a floppy, with the following
> > command:
>
> Without an FS you're asking for trouble. Why don't you use a
> compressed filesystem like cramfs? It's read-only, the files are are
> compressed, and you won't have problems like this. Plus, you can
> actually browse the files and directories on the disk since the
> compression is transparent to userspace.

This floppy is supposed to go to customers. Your solution has two
problems:

1) Customers need to have support for cramfs in their systems in order
   to access the floppy;
2) Customers need to mount the floppy before accessing its contents, which
   means running more than one command. If it's to have more than one
   command, one solution is to:
	- tar czvf file.tgz dir_name
	- tar cvf /dev/fd0 file.tgz

   , which means that the customer would need to run:
	- tar xvf /dev/fd0
	- tar xzvf file.tgz

   in order to extract the floppy contents (it's two commands as well, but
   it doesn't have problem (1)).

I just wanted to be able to provide a floppy to my customers that's
readable by any system _and_ that has its contents accessible by means of
one single command. This was possible, until I needed to compress the
directory ... :(

Oh well.


===

Date: Wed, 26 Sep 2001 18:02:52 -0700
From: Jeffrey Siegal <jbs@quiotix.com>
To: "Karsten M. Self" <kmself@ix.netcom.com>
Subject: Re: [svlug] Weird problem with tar (w/ floppy only)

"Karsten M. Self" wrote:
> Note the disadvantage of this method:  the user needs to know the size
> of the file being extracted.

If you aren't concerned about expanding the size of the file somewhat,
you could use uuencode:

tar czvf - dir_name | uuencode t.tar.gz >/dev/fd0

uudecode </dev/fd0 -o /dev/stdout | tar xzf -

There is probably some other file format that contains an internal
end-of-file mark but expands less than uuencode.

===

the rest of The Pile (a partial mailing list archive)

doom@kzsu.stanford.edu