[SOLVED] How to extract *.tar.bz2 files on Pandora


peca

Active Member
Joined
Jan 10, 2008
Messages
895
Location
Jičín city; CZ
Website
Visit site
I want extract pandora-rootfs.tar.bz2 from file on 2nd SD card to 1st SD card. I have only Windows 7 machine and not yet fs-driver installed on it. Anyway, it is my employer's machine, so I would like use only Pandora in future. I'm use Linux only rarely and I'm still not familiar with it (Actually it is rather problem with small cut down device (display, keys, no man,...)).
I try open tar.bz on Pandora just by double-click. But OS ask me to choice SW for handling this filetype - as I don't see any handy, I press ESC. In that moment OS associate tar.bz with Abiword.

So I beg for some simple instruction how to handle archives on Pandora. Even command line example will be good enough. I don't even know if appropriate SW is presented in current OS image nor what SW use for it at all.

Thank in advance.
 
^Tell me to shut-up if I've misunderstood you, but I think what you want to do is extract it with 'squeeze' by right clicking on the file and selecting said program.

edit: Alternatively you can find 'squeeze' under Accessories.
 
peca said:
I want extract pandora-rootfs.tar.bz2 from file on 2nd SD card to 1st SD card. I have only Windows 7 machine and not yet fs-driver installed on it. Anyway, it is my employer's machine, so I would like use only Pandora in future. I'm use Linux only rarely and I'm still not familiar with it (Actually it is rather problem with small cut down device (display, keys, no man,...)).
I try open tar.bz on Pandora just by double-click. But OS ask me to choice SW for handling this filetype - as I don't see any handy, I press ESC. In that moment OS associate tar.bz with Abiword.

So I beg for some simple instruction how to handle archives on Pandora. Even command line example will be good enough. I don't even know if appropriate SW is presented in current OS image nor what SW use for it at all.

Thank in advance.
Do you have ext2 FS on the card you're going to extract to? (If not I'll teach that, too, but..) I'm assuming yes.
The open up a terminal, and fill in the details here etc (eg. think before you type) (My comments = // comment):
Code:
$ sudo su
// Will ask for your password, you will be root now.
$ cd /media/label-of-1st-card
$ tar xvf /media/label-of-2nd-card/pandora-rootfs.tar.bz2
// Files will be listed as they're being extracted, so lots of lines here
This was fastly written but known to work. I'm using sudo su because I know it will work 100% reliably this way (dunno, but sudo <command> is not always 100% equivalent to sudo su + command... duh). And you need to be root to extract the files with proper owner & permissions (and to create device nodes) which is important with the rootfs.

If you just want to extract some other (source code or whatever) .tar.bz2 just cd to target folder and tar xvf <file> as yourself.
 
Last edited by a moderator:
urjaman said:
Code:
   $ tar xvf /media/label-of-2nd-card/pandora-rootfs.tar.bz2
If you just want to extract some other (source code or whatever) .tar.bz2 just cd to target folder and tar xvf <file> as yourself.
A quick tar command-line help :
x : extract
c : compress
v : verbose
f : file (next argument is the file to extract)
j : file is in the tar.bz2 format (default tar)
z : file is in the tar.gz format (default tar)

So your command-line expect the file to be in tar format, which is not.
Code:
$ tar xjvf /media/label-of-2nd-card/pandora-rootfs.tar.bz2
would be better :D


EDIT : you could also us "-C destdir" to extract to "destdir" :
Code:
$ tar xjvf /media/label-of-2nd-card/pandora-rootfs.tar.bz2 -C /media/label-of-2nd-card
but "squeeze" will do fine :)
 
Last edited by a moderator:
This is it! Thank You guys :)
Now I recall that I spot word "squeeze" somewhere in this forum, but forget that it archive tool meanwhile.
EDIT: And Yes, my 2nd card is formatted to ext2fs already.
 
sebt3 said:
So your command-line expect the file to be in tar format, which is not.
Code:
$ tar xjvf /media/label-of-2nd-card/pandora-rootfs.tar.bz2
would be better :D
tar will autodetect (dunno how, maybe filename?) compression types (GNU tar atleast), so xf will work with .tar .tar.gz and .tar.bz2 so I dont bother with specifying z or j nowadays at all when extracting.
 
Last edited by a moderator:
urjaman said:
sebt3 said:
So your command-line expect the file to be in tar format, which is not.
Code:
$ tar xjvf /media/label-of-2nd-card/pandora-rootfs.tar.bz2
would be better :D
tar will autodetect (dunno how, maybe filename?) compression types (GNU tar atleast), so xf will work with .tar .tar.gz and .tar.bz2 so I dont bother with specifying z or j nowadays at all when extracting.

I didn't knew that. Thanks :)
About detection, the file command do this well :)
 
Last edited by a moderator:
Just trying. Squeeze really long time reading archive and when extract it type "cannot make a folder". I set permission at root to 777 (sudo chmod 777 /media/sdcard1/) and get chance to tar - now extracting. Don't know if 777 in card's root directory is evil or not. Anyway it is just for trying and messing with OS image, opkg and so - to keep NAND untouched. I buy 8GB card for this, so I hope that it is enough :)
EDIT: Mods, add [solved] to topic name please.
 
peca said:
Just trying. Squeeze really long time reading archive and when extract it type "cannot make a folder". I set permission at root to 777 (sudo chmod 777 /media/sdcard1/) and get chance to tar - now extracting. Don't know if 777 in card's root directory is evil or not. Anyway it is just for trying and messing with OS image, opkg and so - to keep NAND untouched. I buy 8GB card for this, so I hope that it is enough :)
EDIT: Mods, add [solved] to topic name please.
I suggested using the command line for extracting the rootfs because:
* It's a big (for the pandora anyways) file, and it will need to be entirely extracted (scanned through) to gather the file list for squeeze, which you dont really need to do.
* To properly boot from it you need to extract it as root (and if you were doing so, you wouldn't have had the need to chmod it). Maybe chrooting (and all that dance, bind mounting the host dev and mounting proc and sys for it) might work like the way you did it, but atleast it needs the device nodes that you can't create as a normal user.

...
 
Last edited by a moderator:
urjaman: I like cmdline. I grow on DOS prompt and MS Windows is something that I'm live from (database application developer), but I don't like windowed interface too much :/ I guess that I will like Linux more and more, as I will get more and more inside.

To the topic: I get some permission errors anyway. At last I reformat card again and do "sudo tar ..." and archive was unpacked properly - at last :)
 
Back
Top