Avatar of Los Angeles1
Los Angeles1
 asked on

Linux, total disk space

I am using RHEL 5.6

What command can I run to see the total disk space (used or free or not yet allocated) on the system

Thanks
Microsoft ApplicationsLinux

Avatar of undefined
Last Comment
1ly4me

8/22/2022 - Mon
SOLUTION
farzanj

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Los Angeles1

ASKER
I get the following:

-bash-3.2# usermod -g mqm -G mqbrkrs mqm
-bash-3.2# su - mqm
-bash-3.2$ exit
logout
-bash-3.2# df -hT
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sda1     ext3    9.7G  3.8G  5.5G  41% /
tmpfs        tmpfs   1006M     0 1006M   0% /dev/shm
/dev/sdb1     ext3    9.9G  3.0G  6.5G  32% /opt
-bash-3.2#
-bash-3.2# du -sh /
6.7G    /
-bash-3.2#
-bash-3.2#
-bash-3.2# fdisk -l

Disk /dev/sda: 12.8 GB, 12884901888 bytes
255 heads, 63 sectors/track, 1566 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1305    10482381   83  Linux
/dev/sda2            1306        1566     2096482+  82  Linux swap / Solaris

Disk /dev/sdb: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        1305    10482381   83  Linux
-bash-3.2#

Open in new window


So the df -hT says I have about 10GB per disk, and the fdisk -l says I have about 12 GB in the sda and 10GB in the sdb

Why is there a difference?

Which of these 2 commands whould I rely upon
farzanj

Well, I would say fdisk is.  It gives you the sum total of the entire disk whether it is usable disk space or not (un-partitioned).
SOLUTION
farzanj

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
1ly4me

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Your help has saved me hundreds of hours of internet surfing.
fblack61