Reply
Thread Tools
ME2g's Avatar
Posts: 168 | Thanked: 58 times | Joined on Aug 2010 @ Vienna
#1
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!)
 
Posts: 2,829 | Thanked: 1,459 times | Joined on Dec 2009 @ Finland
#2
What filesystem on mmc1? How big file?
 
ME2g's Avatar
Posts: 168 | Thanked: 58 times | Joined on Aug 2010 @ Vienna
#3
Originally Posted by slender View Post
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"
:-(
 
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#4
Originally Posted by ME2g View Post
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 ;-)

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.
 

The Following User Says Thank You to lma For This Useful Post:
clasificado's Avatar
Posts: 466 | Thanked: 180 times | Joined on Feb 2010
#5
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

Last edited by clasificado; 2010-09-15 at 05:58.
 

The Following User Says Thank You to clasificado For This Useful Post:
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#6
Or just tar -X.
 

The Following User Says Thank You to lma For This Useful Post:
Posts: 992 | Thanked: 995 times | Joined on Dec 2009 @ California
#7
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's Avatar
Posts: 2,473 | Thanked: 12,265 times | Joined on Oct 2009 @ Jerusalem, PS/IL
#8
BusyBox is one f'd up tool, install tar-gnu and use gtar instead.
 
Posts: 2,802 | Thanked: 4,491 times | Joined on Nov 2007
#9
Originally Posted by egoshin View Post
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.

Originally Posted by MohammadAG View Post
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.
 
Posts: 992 | Thanked: 995 times | Joined on Dec 2009 @ California
#10
Originally Posted by lma View Post
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.
 
Reply


 
Forum Jump


All times are GMT. The time now is 06:23.