maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   N900: tar broken? (https://talk.maemo.org/showthread.php?t=62291)

ME2g 2010-09-14 21:06

N900: tar broken?
 
I am using Maemo 5, Version 10.2010.19-1 on N900.

When I am using tar to pack files with
tar -cvzf /media/mmc1/backup.tar.gz /
or
tar -cvf /media/mmc1/backup.tar /
onto the SD card as root user I am getting
"tar: short read"
and the tar file is garbage.
:-(

What can I do?
(I am used to Linux so if there is an alternative I can try please tell me, but normally tar should work on a Linux system!)

slender 2010-09-14 21:13

Re: N900: tar broken?
 
What filesystem on mmc1? How big file?

ME2g 2010-09-14 21:45

Re: N900: tar broken?
 
Quote:

Originally Posted by slender (Post 816260)
What filesystem on mmc1? How big file?

/media/mmc1 is mounted as vfat.

But the error also occurs when doing it on /home which is ext3.

file is ~ 232MB which should be no problem for vfat or ext3

Internet only says:
http://www.mail-archive.com/busybox@.../msg04880.html
tar -v says "BusyBox v1.10.2"
:-(

lma 2010-09-14 21:58

Re: N900: tar broken?
 
Quote:

Originally Posted by ME2g (Post 816252)
When I am using tar to pack files with
tar -cvzf /media/mmc1/backup.tar.gz /

The output of tar just before the error message should be a big hint ;-)

Quote:

What can I do?
You need to exclude /sys & /proc at the very least. You probably also want to exclude other filesystems like /media/mmc1 and python bind mounts.

clasificado 2010-09-15 05:55

Re: N900: tar broken?
 
Quote:

You need to exclude /sys & /proc at the very least. You probably also want to exclude other filesystems like /media/mmc1 and python bind mounts.
You can do that by bind mounting root (/) into a subfolder.

Try this
Code:

sudo gainroot
mount --bind / /mnt
tar -cvzf /media/mmc1/backup.tar.gz /mnt

This way, you will have in /mnt the clean root filesystem, without all that complex mounts that your system needs

lma 2010-09-15 08:41

Re: N900: tar broken?
 
Or just tar -X.

egoshin 2010-09-15 19:28

Re: N900: tar broken?
 
Is it joke?

I mean - recursive write of tar file. Commands like "tar cvf somefile /" will never ends until the space on somefile file system is exhausted. Because tar will try to write somefile into somefile!

If you want to make a copy of root file system you should use a full tar (install it from repository) and use a parameter "-l" (or "--one-file-system"). By default tar will go through mount points and write all stuff from it including "somefile" content too.

MohammadAG 2010-09-15 19:33

Re: N900: tar broken?
 
BusyBox is one f'd up tool, install tar-gnu and use gtar instead.

lma 2010-09-15 20:54

Re: N900: tar broken?
 
Quote:

Originally Posted by egoshin (Post 817185)
I mean - recursive write of tar file. Commands like "tar cvf somefile /" will never ends until the space on somefile file system is exhausted. Because tar will try to write somefile into somefile!

Nah, it's smart enough to figure that particular trap out by itself and skip the tarball it's in the process of writing.

Quote:

Originally Posted by MohammadAG (Post 817187)
BusyBox is one f'd up tool, install tar-gnu and use gtar instead.

GNU tar will also get into helical underwear syndrome if you try to archive /sys, just in a different way. A lot of the files in there lie about their size and you're not meant to tar them up anyway, so just don't.

egoshin 2010-09-15 23:09

Re: N900: tar broken?
 
Quote:

Originally Posted by lma (Post 817273)
Nah, it's smart enough to figure that particular trap out by itself and skip the tarball it's in the process of writing

It doesn't work sometime, especially on mounted FS etc.


All times are GMT. The time now is 19:13.

vBulletin® Version 3.8.8