如何在Linux中获取磁盘的已用大小 [英] How to get disk's used size in linux
本文介绍了如何在Linux中获取磁盘的已用大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Redhat Linux中,如果未将磁盘安装到文件系统,我如何获得磁盘的总大小和使用的大小.
现在我可以使用命令获取总大小了
fdisk -l | grep磁盘
但是如果我使用命令
df
新磁盘未显示.因此我无法获得磁盘的已用大小.
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.
推荐答案
您可以使用此命令查看分区的大小:
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.
我认为df
仅检查已挂载的文件系统.
I think that df
only checks mounted filesystems.
尝试
http://www.codecoffee.com/tipsforlinux/articles/22.html [ ^ ]
本文中提供的所有信息都可以在du和df的手册页中找到.
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.
这篇关于如何在Linux中获取磁盘的已用大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文