Jump to content

df -a and lsd / ls -l questions - SOLVED


Recommended Posts

These are probably really easy questions, but in my two years I've never figured them out and have never bothered to ask here, even though I have searched for the answer.

 

Question 1:

When I do 'ls -l' in a directory that contains other directories, it never gives me the correct size of the sub-directories and thus, the correct total size of the current directory is also wrong. Why is that? Is there a way to fix it? Here's an example:

 

omar@localhost ~ 2017 02-Sep-04
> ls -l -h
total 514M
<<snip>>
drwx------  122 omar xgrp    12K Sep  2 17:40 tmp/
<<snip>>

 

I guarantee you there's more than 12k inside my ~/tmp and more than 514M in ~.

 

As a matter of fact, let me show you:

omar@localhost ~/tmp 2017 02-Sep-04
> cd ~/tmp
omar@localhost ~/tmp 2017 02-Sep-04
> ls -l -h
total 1.4G

 

And I can tell you there's more in there than 1.4G, too, because there are directories inside there that are reported incorrectly as far as size goes. You can tell this by:

omar@localhost ~/tmp 2017 02-Sep-04
> df -a -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/ide/host0/bus0/target0/lun0/part1
                      20G  3.1G   16G  17% /
none                     0     0     0   -  /proc
none                     0     0     0   -  /proc/bus/usb
none                     0     0     0   -  /dev
none                     0     0     0   -  /sys
/dev/ide/host0/bus0/target0/lun0/part7
                     989M   17M  922M   2% /backup
none                     0     0     0   -  /dev/pts
/dev/ide/host0/bus0/target0/lun0/part6
                      16G   13G  3.6G  78% /home

 

And omar is my only user in /home that has more than 200K of info in his directory.

This brings us to:

Question 2:

When I plug in my usb pen drive, it gets automatically mounted under /mnt/removable, yet no entry in /etc/fstab exists for it. Also, while mounted, it does not exist in the output of 'df -a -h' and, of course I can't go into /mnt/removable and do an 'ls -l -h' and get a correct size because, why, it contains subdirectories and 'ls -l -h' reports their size incorrectly.

 

Any thoughts? Cooker with latest updates as of today and kernel 2.6.3-7mdk.

TIA

Edited by Steve Scrimpshire
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...