Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
In Redhat Linux, if the Disk is not mount to the filesystem how can i get the disk's total size and used size.

Now I can get the total size use command
fdisk -l |grep Disk

But if I use command
df
the new disk is not show.so i can't get the used size of the disk.
Posted

You can use this command to see the size of partitions :

ls /proc/partitions


And I guess that its very difficult to find out how much space is free on a particular partition unless its corresponding filesystem driver were installed(mounted).

Hope it helps.
 
Share this answer
 
Comments
sesha Fan 13-Dec-11 22:26pm    
i agree with
"
And I guess that its very difficult to find out how much space is free on a particular partition unless its corresponding filesystem driver were installed(mounted).

"
Amir Mahfoozi 13-Dec-11 23:49pm    
Thanks :)
I think that df only checks mounted filesystems.
 
Share this answer
 
Try
http://www.codecoffee.com/tipsforlinux/articles/22.html[^]
All the information present in this article is available in the man pages for du and df.
 
Share this answer
 
Mount the filesystem; get the size using df; unmount it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900