LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Blogs > ndh_singh80
User Name
Password

Notices

Rate this Entry

logical disk info by df -h <drive > command is not giving info for whole hard disk..

Posted 01-21-2009 at 08:46 AM by ndh_singh80

I am new to Linux and I am facing problem to get info for logical disk on Linux..
I want to know logical disk info like how many logical disk I have , used space and free space for each logical disk..
When I am running fdisk then it shows that I have 300GB hard disk and I have 5 logical disk(/dev/sda1 .. to /dev/sda5).
This 300 GB space should be divided in above 5 logical disk,(which i have) but when I am querying with df h <logical disk path> command for above logical disk then total Sum of all disk space is coming near about 8.2 GB.


Below is the detailed info of command out put..


[root@localhost proc]# fdisk -l

Disk /dev/sda: 300.0 GB, 300000000000 bytes
255 heads, 63 sectors/track, 36472 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 7 56196 de Dell Utility
/dev/sda2 8 530 4200997+ 8e Linux LVM
/dev/sda3 * 531 555 200812+ 83 Linux
/dev/sda4 556 36472 288503302+ 5 Extended
/dev/sda5 556 36472 288503271 8e Linux LVM


When I am query about each logical disk uses by df h <logical disk path> command then it shows me used and free spaces for that partition.
Here sum of all logical disk start from /dev/sda1 to /dev/sda5 then is (2 GB+2 GB+ 190 M+2 GB+ 2 GB) near about 8.2 GB.
I am wondering why it is not giving me logical disk info for all 300 GB disk .


[root@localhost proc]# df -h /dev/sda1
Filesystem Size Used Avail Use% Mounted on
- 2.0G 168K 2.0G 1% /dev
[root@localhost proc]# df -h /dev/sda2
Filesystem Size Used Avail Use% Mounted on
- 2.0G 168K 2.0G 1% /dev
[root@localhost proc]# df -h /dev/sda3
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 190M 15M 166M 8% /boot
[root@localhost proc]# df -h /dev/sda4
Filesystem Size Used Avail Use% Mounted on
- 2.0G 168K 2.0G 1% /dev
[root@localhost proc]# df -h /dev/sda5
Filesystem Size Used Avail Use% Mounted on
- 2.0G 168K 2.0G 1% /dev
Posted in Uncategorized
Views 1850 Comments 2
« Prev     Main     Next »
Total Comments 2

Comments

  1. Old Comment
    You're probably past this problem by now, but I'm curious...

    fdisk makes sense to me for logical disk info, but df is used to report space usage on mounted filesystems only.

    So I'm curious what you get when you just run a "df -h"?

    For logical disk info, I generally 'cheat' by using gparted (pretty pictures and not much thinking involved). That's assuming you have a GUI running.
    Posted 02-18-2009 at 11:07 AM by SA_Ron SA_Ron is offline
  2. Old Comment

    for logical problem

    Dear user of linux,
    df -h shows only the main directory which is /dev and used for mounted partition mounted on . used to check the used space free spaced.fdisk -l is used for long lising the all partion.
    Posted 02-19-2009 at 02:18 AM by vinaystyle vinaystyle is offline
 

  



All times are GMT -5. The time now is 09:37 AM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration