LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Huge tarball-what gives? (https://www.linuxquestions.org/questions/linux-newbie-8/huge-tarball-what-gives-932733/)

Odyssey1942 03-04-2012 08:37 PM

Huge tarball-what gives?
 
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. How can this be?

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?

frankbell 03-04-2012 08:51 PM

What does a du /home/username show?

Odyssey1942 03-04-2012 09:00 PM

pages and pages listing directories and subdirectories. Is there something specific I should look for? Thanks.

catkin 03-04-2012 09:47 PM

Use du -hs /home/username instead. The -s is for "summary" (so no voluminous listing of directories) and the -h for "human readable"

Odyssey1942 03-04-2012 09:53 PM

Thanks for the update. It returned:

Quote:

25G /home/username
Would this be 25 Gigs?

Satyaveer Arya 03-05-2012 04:30 AM

Check if there are any hidden files/directories in /home/username ?

You can delete /tester directory, but first check if there is any important data of yours.

And there is no need to delete lost + found directory.

colucix 03-05-2012 05:01 AM

This is a known and annoying bug reported here: https://bugs.launchpad.net/ubuntu/+s...lus/+bug/33883. The best way to determine the actual size of a directory is by means of the command line and the du command, as suggested by frankbell and Catkin above.

Regarding the tester home directory the cleaner way to delete it is by removing the tester user.

Instead, regarding the lost+found directory, it's there for a reason: it is related to ext2/ext3/ext4 filesystems and serves to store pieces of corrupted/broken files, generated for example upon a system crash or a sudden and unexpected shutdown. At the next boot the system will forcedly check the filesystems that are not in a clean state and it will try to repair corrupted files, if any. Therefore, better to leave it alone in order to assure the proper behaviour of your system.

catkin 03-05-2012 07:05 AM

Quote:

Originally Posted by Odyssey1942 (Post 4618571)
Would this be 25 Gigs?

Yes.

That implies ~15 GB in hidden directories and files if the linked bug is the cause of the discrepancy. Not impossible but an unusually large amount. This find command will list files over 250 MB for you to investigate (you may want to increase or decrease that 250 in case you get too many or too few files listed to be useful.
Code:

find /home/username -size +250M

Odyssey1942 03-05-2012 08:51 PM

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.

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.

catkin 03-05-2012 09:23 PM

Anywhere with enough space would be a suitable temporary location. /tmp and /var/tmp are specifically for temporary files but may be emptied on shutdown/reboot.

The tar command you posted would add XYZ to the archive. You can do what you intend by something like
Code:

tar -czvf /var/tmp/currenthome.tgz /home
.tgz is conventional for compressed tar archives.

frankbell 03-05-2012 09:25 PM

I want to thank the posters who added to my knowledge of du.

For what it's worth, in my experience, there is little utility to moving hidden configuration files from an old computer to a new one except when they are files I've configured away from their default settings.

For example, I will always copy my Fluxbox menu, startup, and init files; my dot-opera directory with bookmarks, mailstore, and so on; my .pan2 directory with my newsgroup subscriptions and configuration; and my LibreOffice templates, because I've tailored them to my needs and preferences. I'll also grab my /etc/samba/smb.conf file and my rc.firewall script because I expect to reuse them.

I don't copy over any configuration files that I've left at default. Not copying over config directories and files for programs I expect to leave at default greatly decreases the size of the data needing to be transferred.

Odyssey1942 03-05-2012 09:33 PM

That nailed it. Thanks so much.

Odyssey1942 03-06-2012 07:41 AM

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.

Odyssey1942 03-07-2012 08:31 AM

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 /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?

Finally could someone please give me the command to locate a specific directoryname anywhere on the computer (still looking for /username2)

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.

catkin 03-07-2012 09:39 AM

Given that the tar archive contained /home, you should have moved it to / and unpacked it. Maybe it worked OK and would have worked from anywhere because it explicitly contained /home with the leading /.

The errors could be caused by ownerships and permissions on the new files. Is your username and its group name the same on old and new computers? You could look in /etc/passwd and /etc/group to check.

Can you log in at a psuedo-terminal (accessed by Alt+Ctrl+F1 from the graphical logon screen?

If so and you create a file in /tmp and examine its username and group name, do they match what is in you new home directory? If you change to you home directory is it the expected /home/username? These commands can be used:
Code:

touch /tmp/my_test_file
/bin/ls -l /tmp/my_test_file
cd ~
cd /home/username
/bin/ls -al

The two cd comands should take you to the same directory.

This command will search for the lost directory: sudo find / -type d -iname username2


All times are GMT -5. The time now is 04:21 PM.