LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to check the whole disk space? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-check-the-whole-disk-space-4175420588/)

thomas2004ch 08-06-2012 02:21 AM

How to check the whole disk space?
 
Hi,

I can use df -h to check the used and available disk space. But it doesn't show the sum.

etech3 08-06-2012 03:15 AM

Did you try:
Code:

du -h

thomas2004ch 08-06-2012 03:48 AM

Quote:

Originally Posted by etech3 (Post 4747022)
Did you try:
Code:

du -h

Yes. It seems it just print out the sum of each directory but not the whole of disk. Besides, it print out a very long list and it takes very long.

etech3 08-06-2012 04:01 AM

[quote]Besides, it print out a very long list and it takes very long.[/quote

I think it's the last line.

Code:

du -h
The last line on my test machines shows 1.1G.

Of cource there is nothing on this machine except a base install of Wheezy with a couple of small problem packages.

just my :twocents:

thomas2004ch 08-06-2012 04:09 AM

The last line on the machine is 6.9 GB. But if I use df -h I got followings:
Code:

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_root-lv_root
                      4.9G  2.8G  1.9G  61% /
/dev/mapper/vg_root-lv_var
                      3.0G  458M  2.4G  17% /var
/dev/mapper/vg_root-lv_home
                      496M  21M  450M  5% /home
/dev/mapper/vg_root-lv_opt
                      13G  3.8G  8.2G  32% /opt
/dev/mapper/vg_root-lv_tmp
                      496M  19M  452M  4% /tmp
/dev/sda1              99M  41M  54M  43% /boot
tmpfs                1.5G    0  1.5G  0% /dev/shm

Do you know is it possible not to print out the long list?

jv2112 08-06-2012 04:23 AM

To see the total by system and drives you can do this.

Code:

joe@Tux-Box  in ~$ df -hTl --total
Filesystem                                            Type      Size  Used Avail Use% Mounted on
rootfs                                                rootfs    10G  1.3G  8.3G  14% /
udev                                                  devtmpfs  10M    0  10M  0% /dev
tmpfs                                                  tmpfs    801M  1.6M  799M  1% /run
/dev/disk/by-uuid/4f3d205b-268b-4cea-8ebd-132a6f755561 ext4      10G  1.3G  8.3G  14% /
tmpfs                                                  tmpfs    5.0M    0  5.0M  0% /run/lock
tmpfs                                                  tmpfs    1.6G  76K  1.6G  1% /tmp
tmpfs                                                  tmpfs    1.6G  900K  1.6G  1% /run/shm
/dev/sda1                                              ext4      331M  36M  278M  12% /boot
/dev/sda4                                              ext4      25G  7.1G  17G  30% /home
/dev/sda5                                              ext4      12G  5.6G  5.0G  53% /usr
/dev/sda7                                              ext4      7.7G  646M  6.6G  9% /var
/dev/sdb1                                              ext4      1.4T  793G  534G  60% /media/Archive-I
/dev/sde1                                              ext4      1.4T  244G  1.1T  19% /media/Archive-II
/dev/sdc1                                              ext4      931G  234G  651G  27% /media/E-Space
/dev/sdf1                                              ext4      1.4T  597G  730G  45% /media/N-Space
/dev/sdd1                                              ext4      298G  214G  70G  76% /media/K-9
total                                                  -        5.4T  2.1T  3.1T  41%



If you wab to see by a group of folders then


Code:

joe@Tux-Box  in ~$ du -sch /media/N-Space/Cinema/
543G        /media/N-Space/Cinema/
543G        total

Hope this helps.

414N 08-06-2012 04:23 AM

Quote:

Originally Posted by thomas2004ch (Post 4746989)
Hi,

I can use df -h to check the used and available disk space. But it doesn't show the sum.

What sum? If you mean user+avail, isn't it in the Size column?

thomas2004ch 08-06-2012 05:41 AM

You get the point. Many thanks!


All times are GMT -5. The time now is 06:45 PM.