Huge tarball-what gives?


Results 1 to 10 of 10

Thread: Huge tarball-what gives?

  1. #1
    Join Date
    Nov 2006
    Posts
    49

    Huge tarball-what gives?

    Beginner here and my O/S is Ubuntu 10.04.

    While working on another problem and following guidance I found on the net, I created a tarball of my /home directory. My /home consists of three directories and their "sizes":

    lost + found - ? items
    myusername - 18 items
    tester - 9 items

    checking properties, it shows

    lost + found - unreadable
    myusername - 10.5 GB
    tester - 32.2MB

    (dispensing with "tester" which if I remember correctly, I set up to work on a long ago problem, but didn't actually use it. It is essentially empty.)

    The important thing is that in addition to the three directories above, there is the "home.tar.gz" tarball which I created using this command (from within /home) :

    sudo tar -cjf home.tar.gz myusername

    and that tarball is 20.6 GB or twice the size of /myusername. If tarballs are files that compress the data going into them, how can this be? I suppose that the "lost and found" directory might be taking up a huge amount of space, but if this is the case, I really don't want it unless it is absolutely necessary.

    Also can I delete the /tester directory without causing a problem, and if so, can I simply right click in Gnome and delete?

    Finally can I delete /lost & found without causing a problem?
    Last edited by Odyssey; 03-05-2012 at 12:10 AM.

  2. #2
    Join Date
    Jul 2003
    Location
    Spokane, Washington
    Posts
    580
    First of all, the -j switch is for bz2 compression, not gzip, so your archive should have a .bz2 extension, not .gz.
    As for the size discrepancy, my first bet is symbolic links, a.k.a shortcuts. If your desktop's properties does not follow symbolic links when calculating a folder's size, but tar did follow them when packaging up that folder, then the archive would suck in more files than are actually stored in your home directory (or if the symlinks stay in your home directory, the tar file may have multiple copies). Check the manpage or google for the default behaviors regarding symbolic links of both tar and your desktop's file explorer.

  3. #3
    Join Date
    Nov 2006
    Posts
    49
    The resulting file definitely ends in .gz. Would this be the result of the j being used in conjunction with c and f?

    I am definitely a beginner, and I don't understand those topics that you recommend me to check.

    Also I have to do quite a lot of work with this (NEW) computer just as soon as I can get it running. Since there appears to be a reasonable explanation for the tarball being larger, what would be the down side of just unzipping it on NEW and see if it works?

    Also do I need to rename the existing /home directory on NEW before unzipping the tarball?

    Any specific commands you can give me will be most appreciated. Thanks.

  4. #4
    Join Date
    Nov 2006
    Posts
    49
    I am very anxious to get back to work and have taken the following steps in order to get the files across to the NEW computer in the best possible state.

    I removed "tester" as a user (since it was never even used) and moved /oldhome out of my /home/username (into /opt) to clean the /home directory up and to reduce its total size.

    I want to zip (the now much smaller) /home again, but this time have the tarball file placed outside of /home as it is created to avoid a "double compression" issue.

    I have tried several variations of tar with various switches and destinations, but nothing wants to work. Have read the tar man pages, which is way too technical for me, and google is not being helpful. Could I trouble someone to please extend (and correct if needed) the line of code below to have the tarball show up in /opt (where there is space for it (or if /opt is not a good place to put it, your suggestion):

    Code:
    tar -czvf currenthome.tar.gz /home XYZ
    where "currenthome" will be the tarball, "/home" will be the current home folder that is being tarballed, and XYZ will be whatever else is needed to actually get the tarball into /opt (or some other place you think better. I also recognize that XYZ may not be properly located in the line of code. I just put it there to represent the additional step of placing the tarball elsewhere.)

    Many thanks.

  5. #5
    Join Date
    Nov 2006
    Posts
    49
    This did it:

    Code:
    tar -czvf /opt/currenthome.tgz /home
    Thanks.

  6. #6
    Join Date
    Jul 2003
    Location
    Spokane, Washington
    Posts
    580
    You shouldn't need an XYZ to put the file into /opt, just run the command from /opt or add /opt/ in front of the filename: /opt/archive.tar.gz. You may need root privileges to write into /opt.

  7. #7
    Join Date
    Nov 2006
    Posts
    49
    Arrarrgh! This is becoming more complicated. I thought that I had deleted the old home.tar.gz from the /home directory, but had not. So the new tar file of /home contained the previous tar file. (The new tar file is 32GB!)

    So I deleted the new tar file from /opt, then deleted the old home.tar.gz from /home. Then emptied the trash.

    Then logged out and at the intitial login screen, pressed Alt-Ctrl-F1 to bring up a command line terminal. But Alt-Ctrl-F1 now doesn't work.

    I rebooted a couple of times, then powered off, but Alt-Ctrl-F1 still doesn't work. So I then logged in, brought up a console and tried to create the tar from the console, but it failed. Arrrrrgh!

    So now I need to get Alt-Ctrl-F1 working again at the Login screen. Any ideas?

    EDIT: Found it! Ctrl key on keyboard failed! What are the chances of that? Thanks.
    Last edited by Odyssey; 03-06-2012 at 10:10 AM.

  8. #8
    Join Date
    Nov 2006
    Posts
    49
    Still bashing away and seem to be no closer to success. In fact I am in a terrible muddle. Here is a summary of the history:

    in old computer I ran:
    Code:
    sudo tar -czvf /opt/username120305.tar.gz /home
    (put into opt to keep from creating the tarball within the directory being zipped),

    then from within /opt
    Code:
    sudo scp username120305.tar.gz /home@192.168.0.104
    which failed with error message: "permission denied, please try again" (i.e., would not accept my password [which I know is correct and retried several times]), then
    Code:
    sudo scp username120305.tar.gz /username@192.168.0.104
    which worked

    Then in /home at the new computer, I renamed /username /username2, moved username120305.tar.gz into /home and unpacked it.

    Now when I boot up new computer, I put in my password at login as normal, but then get the following three error messages on a blank desktop (color only, no icons)

    1)Could not update ICEauthority file /home/username/ICEauthority
    2)There is a problem with the configuration server. (/usr/lib/libgconf2-4/gconf-sanity-check-2 exited with status 256)
    3)Nautilus could not create the following required folders: /home/username/Desktop, /home.username.nautilus (Before running Nautilus, please create these folders, or set permissions such that Nautilus can create them.)

    To add to the confusion, I cannot bring back /username2 because it is gone, and I have no idea where.

    So my first question is, can anyone see anything in the above that caused this whole process to go pear shaped?

    Secondly, why do /home and /username on the new computer seem to need different passwords in order to scp the files over?

    I am very much a noob at the command line, so more information rather than less will be so appreciated (I hope to learn something from all this) Thanks.
    Last edited by Odyssey; 03-08-2012 at 01:04 AM.

  9. #9
    Join Date
    Nov 2006
    Posts
    49
    Good news! I am sure that all will be relieved to hear that the problem is solved.

    The problem was:

    Code:
    robert@robert-desktop:~$ ls -l /home
    total 28
    drwx------  2 root   root   16384 2010-11-20 12:39 lost+found
    drwxr-xr-x 47 robert robert  4096 2012-03-07 12:38 robertorig
    drwxr-xr-x  3 root   root    4096 2012-03-07 12:45 robert
    The fix (as root):
    Code:
    chown robert:robert /home/robert
    Thanks all.

  10. #10
    Join Date
    Jul 2003
    Location
    Spokane, Washington
    Posts
    580
    I think you'll need a -R on that chown.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •