You are not logged in.

#1 2013-07-18 04:02:05

apolyonn
Member
Registered: 2013-05-21
Posts: 46

tar command not working

I'm following this tutorial, and reached the step where you have to create a tarball.  So, I follow the command:

root@Aeon:/mnt# tar czf /home/nergal/tmp/archlinux/archlinux.tar.gz

which gives me the result:

tar: Cowardly refusing to create an empty archive
Try `tar --help' or `tar --usage' for more information.

/tmp/archlinux exists.

So, did a little research.  Thought: "maybe I should separate the archlinux.tar.gz and place it before the directory." 

tar czf archlinux.tar.gz /home/nergal/tmp/archlinux/

and this gave me:

tar: Removing leading `/' from member names

More research: "I should add the P switch"

tar czPf archlinux.tar.gz /home/nergal/tmp/archlinux/

"Neat, the cli implied that the task is done...but, if so, it was instantaneous, wheras the tutorial suggested that this sptep should take awhile.  I should probably see if it even produced a file..."

root@Aeon:/mnt# ls /home/nergal/tmp/archlinux
root@Aeon:/mnt# 

Nothing.

I'm ready to claw my own eyes out and have abandoned everything I've ever known about file compression.

Help would be appreciated.

Last edited by apolyonn (2013-07-18 04:07:09)

Offline

#2 2013-07-18 04:05:30

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: tar command not working

should it be more like

$ tar czf <whatever.tar.gz> <stuff> <to> <tar> 

Offline

#3 2013-07-18 04:15:34

apolyonn
Member
Registered: 2013-05-21
Posts: 46

Re: tar command not working

WonderWoofy wrote:

should it be more like

$ tar czf <whatever.tar.gz> <stuff> <to> <tar> 

Perhaps part of the problem is that I'm not 100% sure what the author is trying to do here (or maybe I'm just second-guessing myself out of raw frustration).  I believe that this step should take everything in the current directory, /mnt, and send it to the file archlinux.tar.gz within /home/user/tmp/archlinux.

Here's a quick excerpt from the tutorial for context.  My issue deals with the command the author posted near the very bottom.

Mount the root partition and create the FS tarball

/dev/mapper/loop0p3 is the root filesystem, so let's mount it:

$ sudo mount /dev/mapper/loop0p3 /mnt/
$ ls /mnt/
bin   dev  home  lost+found  mnt  proc  run   srv  tmp  var
boot  etc  lib   media       opt  root  sbin  sys  usr
$ cat /mnt/etc/issue
Arch Linux \r (\l)

Yeah, that's our spiffy Arch Linux root filesystem.

Create the tarball now, we'll upload it to the phone SD card after that. It's importat we create the tarball as root or using sudo to preserve the permissions and do it from the root of the filesystem. That is:

$ cd /mnt/
$ sudo tar czf /home/rubiojr/tmp/archlinux/archlinux.tar.gz .

(as a total side note: on my computer, it's loop0p2, not 0p3)

Last edited by apolyonn (2013-07-18 04:28:37)

Offline

#4 2013-07-18 04:28:22

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: tar command not working

It is working for me when I do (I am testing on a cloned git repo):

% tar cvzf ./test.tar.gz ./genbootstrap 
./genbootstrap/
./genbootstrap/.git/
./genbootstrap/.git/refs/
./genbootstrap/.git/refs/heads/
./genbootstrap/.git/refs/heads/master
./genbootstrap/.git/refs/tags/
./genbootstrap/.git/refs/remotes/
./genbootstrap/.git/refs/remotes/origin/
./genbootstrap/.git/refs/remotes/origin/HEAD
./genbootstrap/.git/branches/
./genbootstrap/.git/hooks/
./genbootstrap/.git/hooks/applypatch-msg.sample
./genbootstrap/.git/hooks/commit-msg.sample
./genbootstrap/.git/hooks/post-update.sample
./genbootstrap/.git/hooks/pre-applypatch.sample
./genbootstrap/.git/hooks/pre-commit.sample
./genbootstrap/.git/hooks/pre-push.sample
./genbootstrap/.git/hooks/pre-rebase.sample
./genbootstrap/.git/hooks/prepare-commit-msg.sample
./genbootstrap/.git/hooks/update.sample
./genbootstrap/.git/info/
./genbootstrap/.git/info/exclude
./genbootstrap/.git/description
./genbootstrap/.git/objects/
./genbootstrap/.git/objects/pack/
./genbootstrap/.git/objects/info/
./genbootstrap/.git/objects/bd/
./genbootstrap/.git/objects/bd/911f611c79463dc916b323460f9cd993734c40
./genbootstrap/.git/objects/32/
./genbootstrap/.git/objects/32/fae88598c8e30336d36fdc2511660dda1ac018
./genbootstrap/.git/objects/03/
./genbootstrap/.git/objects/03/ac78abd01e60bfbc0af2e64515625914097c72
./genbootstrap/.git/objects/b8/
./genbootstrap/.git/objects/b8/44a285e7896a080fd12428916dd52bdd8af727
./genbootstrap/.git/objects/e1/
./genbootstrap/.git/objects/e1/8ac4abddb5c0b7eb22735fd88f21bcc29b441e
./genbootstrap/.git/objects/b2/
./genbootstrap/.git/objects/b2/00c83eae6765c3b1799875a89ff4710b59f4e6
./genbootstrap/.git/objects/33/
./genbootstrap/.git/objects/33/41f335a6696e3f0e726d2ace5a0f10710723a1
./genbootstrap/.git/objects/3d/
./genbootstrap/.git/objects/3d/163b92e1e27f2af91e42a1842d1a71edc97fac
./genbootstrap/.git/objects/7f/
./genbootstrap/.git/objects/7f/1131129e714a67e29c37aa1fbd3e22e95fdc41
./genbootstrap/.git/objects/c4/
./genbootstrap/.git/objects/c4/1ee5255772c67b098a2ad79e382a2e6e7a6e73
./genbootstrap/.git/objects/d1/
./genbootstrap/.git/objects/d1/15475691b0b004ce0078e323ebdbed04f31780
./genbootstrap/.git/objects/a3/
./genbootstrap/.git/objects/a3/f36d2098cae42fbdd913a927d6b2bd5c6a7298
./genbootstrap/.git/objects/c6/
./genbootstrap/.git/objects/c6/6053044376a5ae67ce6eaa6b3a5fdcca8f2391
./genbootstrap/.git/packed-refs
./genbootstrap/.git/logs/
./genbootstrap/.git/logs/refs/
./genbootstrap/.git/logs/refs/remotes/
./genbootstrap/.git/logs/refs/remotes/origin/
./genbootstrap/.git/logs/refs/remotes/origin/HEAD
./genbootstrap/.git/logs/refs/heads/
./genbootstrap/.git/logs/refs/heads/master
./genbootstrap/.git/logs/HEAD
./genbootstrap/.git/HEAD
./genbootstrap/.git/config
./genbootstrap/.git/index
./genbootstrap/README
./genbootstrap/genbootstrap

and

% ls -lh
<snip>
-rw-r--r-- 1 wonderwoofy users  12K Jul 17 21:25 test.tar.gz

and

% tar tvzf test.tar.gz 
drwxr-xr-x wonderwoofy/users 0 2013-07-06 23:00 ./genbootstrap/
drwxr-xr-x wonderwoofy/users 0 2013-07-06 23:00 ./genbootstrap/.git/
drwxr-xr-x wonderwoofy/users 0 2013-07-06 23:00 ./genbootstrap/.git/refs/
drwxr-xr-x wonderwoofy/users 0 2013-07-06 23:00 ./genbootstrap/.git/refs/heads/
-rw-r--r-- wonderwoofy/users 41 2013-07-06 23:00 ./genbootstrap/.git/refs/heads/master
drwxr-xr-x wonderwoofy/users  0 2013-07-06 23:00 ./genbootstrap/.git/refs/tags/
drwxr-xr-x wonderwoofy/users  0 2013-07-06 23:00 ./genbootstrap/.git/refs/remotes/
drwxr-xr-x wonderwoofy/users  0 2013-07-06 23:00 ./genbootstrap/.git/refs/remotes/origin/
-rw-r--r-- wonderwoofy/users 32 2013-07-06 23:00 ./genbootstrap/.git/refs/remotes/origin/HEAD
drwxr-xr-x wonderwoofy/users  0 2013-07-06 23:00 ./genbootstrap/.git/branches/
drwxr-xr-x wonderwoofy/users  0 2013-07-06 23:00 ./genbootstrap/.git/hooks/
-rwxr-xr-x wonderwoofy/users 452 2013-07-06 23:00 ./genbootstrap/.git/hooks/applypatch-msg.sample
-rwxr-xr-x wonderwoofy/users 896 2013-07-06 23:00 ./genbootstrap/.git/hooks/commit-msg.sample
-rwxr-xr-x wonderwoofy/users 189 2013-07-06 23:00 ./genbootstrap/.git/hooks/post-update.sample
-rwxr-xr-x wonderwoofy/users 398 2013-07-06 23:00 ./genbootstrap/.git/hooks/pre-applypatch.sample
-rwxr-xr-x wonderwoofy/users 1704 2013-07-06 23:00 ./genbootstrap/.git/hooks/pre-commit.sample
-rwxr-xr-x wonderwoofy/users 1348 2013-07-06 23:00 ./genbootstrap/.git/hooks/pre-push.sample
-rwxr-xr-x wonderwoofy/users 4951 2013-07-06 23:00 ./genbootstrap/.git/hooks/pre-rebase.sample
-rwxr-xr-x wonderwoofy/users 1239 2013-07-06 23:00 ./genbootstrap/.git/hooks/prepare-commit-msg.sample
-rwxr-xr-x wonderwoofy/users 3611 2013-07-06 23:00 ./genbootstrap/.git/hooks/update.sample
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/info/
-rw-r--r-- wonderwoofy/users  240 2013-07-06 23:00 ./genbootstrap/.git/info/exclude
-rw-r--r-- wonderwoofy/users   73 2013-07-06 23:00 ./genbootstrap/.git/description
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/objects/
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/objects/pack/
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/objects/info/
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/objects/bd/
-r--r--r-- wonderwoofy/users  241 2013-07-06 23:00 ./genbootstrap/.git/objects/bd/911f611c79463dc916b323460f9cd993734c40
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/objects/32/
-r--r--r-- wonderwoofy/users  197 2013-07-06 23:00 ./genbootstrap/.git/objects/32/fae88598c8e30336d36fdc2511660dda1ac018
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/objects/03/
-r--r--r-- wonderwoofy/users  190 2013-07-06 23:00 ./genbootstrap/.git/objects/03/ac78abd01e60bfbc0af2e64515625914097c72
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/objects/b8/
-r--r--r-- wonderwoofy/users  141 2013-07-06 23:00 ./genbootstrap/.git/objects/b8/44a285e7896a080fd12428916dd52bdd8af727
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/objects/e1/
-r--r--r-- wonderwoofy/users   90 2013-07-06 23:00 ./genbootstrap/.git/objects/e1/8ac4abddb5c0b7eb22735fd88f21bcc29b441e
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/objects/b2/
-r--r--r-- wonderwoofy/users  534 2013-07-06 23:00 ./genbootstrap/.git/objects/b2/00c83eae6765c3b1799875a89ff4710b59f4e6
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/objects/33/
-r--r--r-- wonderwoofy/users  554 2013-07-06 23:00 ./genbootstrap/.git/objects/33/41f335a6696e3f0e726d2ace5a0f10710723a1
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/objects/3d/
-r--r--r-- wonderwoofy/users  461 2013-07-06 23:00 ./genbootstrap/.git/objects/3d/163b92e1e27f2af91e42a1842d1a71edc97fac
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/objects/7f/
-r--r--r-- wonderwoofy/users  467 2013-07-06 23:00 ./genbootstrap/.git/objects/7f/1131129e714a67e29c37aa1fbd3e22e95fdc41
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/objects/c4/
-r--r--r-- wonderwoofy/users   90 2013-07-06 23:00 ./genbootstrap/.git/objects/c4/1ee5255772c67b098a2ad79e382a2e6e7a6e73
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/objects/d1/
-r--r--r-- wonderwoofy/users   91 2013-07-06 23:00 ./genbootstrap/.git/objects/d1/15475691b0b004ce0078e323ebdbed04f31780
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/objects/a3/
-r--r--r-- wonderwoofy/users   57 2013-07-06 23:00 ./genbootstrap/.git/objects/a3/f36d2098cae42fbdd913a927d6b2bd5c6a7298
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/objects/c6/
-r--r--r-- wonderwoofy/users  438 2013-07-06 23:00 ./genbootstrap/.git/objects/c6/6053044376a5ae67ce6eaa6b3a5fdcca8f2391
-rw-r--r-- wonderwoofy/users  107 2013-07-06 23:00 ./genbootstrap/.git/packed-refs
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/logs/
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/logs/refs/
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/logs/refs/remotes/
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/logs/refs/remotes/origin/
-rw-r--r-- wonderwoofy/users  203 2013-07-06 23:00 ./genbootstrap/.git/logs/refs/remotes/origin/HEAD
drwxr-xr-x wonderwoofy/users    0 2013-07-06 23:00 ./genbootstrap/.git/logs/refs/heads/
-rw-r--r-- wonderwoofy/users  203 2013-07-06 23:00 ./genbootstrap/.git/logs/refs/heads/master
-rw-r--r-- wonderwoofy/users  203 2013-07-06 23:00 ./genbootstrap/.git/logs/HEAD
-rw-r--r-- wonderwoofy/users   23 2013-07-06 23:00 ./genbootstrap/.git/HEAD
-rw-r--r-- wonderwoofy/users  267 2013-07-06 23:00 ./genbootstrap/.git/config
-rw-r--r-- wonderwoofy/users  184 2013-07-06 23:00 ./genbootstrap/.git/index
-rw-r--r-- wonderwoofy/users 1151 2013-07-06 23:00 ./genbootstrap/README
-rwxr-xr-x wonderwoofy/users  854 2013-07-06 23:00 ./genbootstrap/genbootstrap

Offline

#5 2013-07-18 04:32:51

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: tar command not working

apolyonn wrote:

believe that this step should take everything in the current directory, /mnt, and send it to the file archlinux.tar.gz within /home/user/tmp/archlinux.

How about drop out of religion and RTFM, where M=tar(1)?


This silver ladybug at line 28...

Offline

#6 2013-07-18 04:33:09

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: tar command not working

apolyonn wrote:
$ sudo tar czf /home/rubiojr/tmp/archlinux/archlinux.tar.gz .

                                                                                                                    ^
You missed the dot...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2013-07-18 04:39:46

lolilolicon
Member
Registered: 2009-03-05
Posts: 1,722

Re: tar command not working

$ sudo tar czf /home/rubiojr/tmp/archlinux/archlinux.tar.gz .
                                                            ^

Fixed that for ya. (depends=proper monospace font.)


This silver ladybug at line 28...

Offline

#8 2013-07-18 04:44:57

apolyonn
Member
Registered: 2013-05-21
Posts: 46

Re: tar command not working

jasonwryan wrote:
apolyonn wrote:
$ sudo tar czf /home/rubiojr/tmp/archlinux/archlinux.tar.gz .

                                                                                                                   
You missed the dot...

I actually thought that was a smudge of some sort on my monitor since I rarely wipe down my netbook screen...problem solved -__-

Commence n00b-directed condescension.

Last edited by apolyonn (2013-07-18 04:45:22)

Offline

#9 2013-07-18 04:58:55

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: tar command not working

lolilolicon wrote:
$ sudo tar czf /home/rubiojr/tmp/archlinux/archlinux.tar.gz .
                                                            ^

Fixed that for ya. (depends=proper monospace font.)


Aww, man, I hit preview at least half a dozen times trying to line that fscker up... tongue


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#10 2013-07-18 05:25:56

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: tar command not working

apolyonn wrote:

More research: "I should add the P switch"

tar czPf archlinux.tar.gz /home/nergal/tmp/archlinux/

"Neat, the cli implied that the task is done...but, if so, it was instantaneous, wheras the tutorial suggested that this sptep should take awhile.  I should probably see if it even produced a file..."

root@Aeon:/mnt# ls /home/nergal/tmp/archlinux
root@Aeon:/mnt# 

For the record, you just confused the arguments...  "/home/nergal/tmp/archlinux/" is the path you asked tar to add to the tarball "archlinux.tar.gz" so you should have done "ls archlinux.tar.gz"

The fact that your actual ls command returned nothing suggests and empty directory, hence tar made the tarball so fast.

Offline

#11 2013-07-18 13:35:00

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: tar command not working

apolyonn, please remember to mark the thread as solved https://bbs.archlinux.org/viewtopic.php?id=130309

Offline

Board footer

Powered by FluxBB