1

I reinstalled my UBUNTU 12.04 after facing some crashing issues with my software. I have separate partitions for / and /home.

Output of df -h:

root@sougata-SATELLITE-L750:/home# df -h
Filesystem   Size   Used   Avail   Use%   Mounted on
/dev/sda1    29G    3.8G   23G     15%    /
udev         2.0G   4.0K   2.0G    1%     /dev
tmpfs        402M   860K   401M    1%     /run
none         5.0M   0      5.0M    0%     /run/lock
none         2.0G   22M    2.0G    2%     /run/shm
/dev/sda6    558G   182G   348G    35%    /home

It shows 182 GB used in the /home folder but I can't find those files in /home anywhere.

Output of ls -l /home:

root@sougata-SATELLITE-L750:/home# ls -l /home
total 96
drwx------ 2 sougata sougata 16384 Oct 10 2012 lost+found
drwxr-xr-x 30 sougata sougata 4096 Aug 16 11:27 sougata
drwxr-xr-x 54 sougata sougata 73728 Aug 9 08:31 sougatapc

Are those files saved inside the lost+found folder ?

If so then how do I recover them & view them now?

3 Answers 3

5

The command du will show you the disk space used by your files and directory.

  • du -sh /home/* will show you the size of each subdirectory directly below the /home directory, afterwards depending on your preferences you might then:
  • Either run the same command against one of these directories to manually step one level lower (for instance du -sh /home/sougatapc/*),
  • Or display a complete recursive listing of your directories and files sizes (du -h /home, remove the -s argument ("summary") and do not forget to remove the /* too at the end of the path: this will allow you to catch any potential hidden directories and files too).

Thanks to this you should be to quickly pinpoint where the largest files or directories are located.

3

Your home folder contains two directories you own, /home/sougata and /home/sougatapc. The 182 GB you look for are these subdirectories plus possibly in an hidden one.

To display hidden directories, use ls -la /home.

On the other hand, unless you had a file system corruption and some files and directories were recovered with fsck, your lost+found directory should be empty.

0

If you're reinstalling anyway, you might want to just grab Ubuntu 14.04LTS. (or 15.04).

/home contains the home directories for every user account on the system.

It looks like you chose a different username when you reinstalled. From the ls output, I can tell /home/sougatapc has more subdirectories (higher link count), and is older (last mod time on the directory is 7 days older than your current $HOME.

The size of the older directory itself is also higher, which means there are (or were at one point) more directory entries in it. (The size of a directory itself is the space it takes to store the name -> inode mapping of every file and directory in it.)

Your best bet is to do something like

cd
mkdir old-dotfiles
mv    ../sougatapc/*  .
mv    ../sougatapc/.[^.]* old-dotfiles/  # avoids trying to move ../sougatapc/..
sudo  rmdir ../sougatapc  # remove the old empty dir

You don't need to sudo or chown, because both directories had the same numeric UID owner. When you reinstalled, UID 1000 changed from sougatapc to sougata. So your new account name still owns the home directory of the old account.

You should probably not try to use most of your old dot-files unchanged. Some of them will probably refer to /home/sougatapc, which won't exist anymore. Although you can work around that by doing

sudo ln -s sougata /home/sougatapc   # make a symlink /home/sougatapc -> sougata

If you have savegames or configs from specific things that you want to restore instead of re-configuring, look for them in your old dot-files directory, and move them out into your main directory.

k4dirstat is a program for graphically showing disk space usage, which you might want to use to see what's where in your old ~.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.