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.

lma 2010-09-15 23:21

Re: N900: tar broken?
 
Strange, it detects it by checking device & inode (and so does GNU tar btw). Is there some weird filesystem out there where these are not reliable?

egoshin 2010-09-15 23:25

Re: N900: tar broken?
 
Quote:

Originally Posted by lma (Post 817360)
Strange, it detects it by checking device & inode (and so does GNU tar btw). Is there some weird filesystem out there where these are not reliable?

It is difficult for me to answer. But I remember the situations then I got this problem for sure. May be - symlinks?

EDIT: But anywhere, good to listen that some protection is now in tar.

lma 2010-09-16 09:41

Re: N900: tar broken?
 
The only situation I can think of is when tar is separated from the final output file by one or more processes (eg "tar cf - . | gzip > foo.tar" vs "tar czf foo.tar .") in which case it can't be reasonably expected to detect it.

Ironically GNU tar is a bit more fragile in this respect, it can't detect even the second case.

atilla 2010-12-07 22:30

Re: N900: tar broken?
 
1 Attachment(s)
have a problem with tar-gnu too.
i can't update it to a newer version,and if i try to remove it via terminal it gives me this error code-
any hints?

atilla 2010-12-09 22:17

Re: N900: tar broken?
 
sooo any help guys?
problem is still there

RobbieThe1st 2010-12-09 23:06

Re: N900: tar broken?
 
One, try a reinstall:
apt-get install --reinstall tar-gnu

Two, I suggest looking into BackupMenu(link in my signature) - It does exactly what the OP is trying to do. At the very least, you can take the exact tar command I used and copy it.

Captwheeto 2010-12-10 10:48

Re: N900: tar broken?
 
You could put that xterm out of it's misery for a start ;) look at it! It's colour and fonts burn my eyes


All times are GMT. The time now is 00:04.

vBulletin® Version 3.8.8