主頁(yè) > 知識(shí)庫(kù) > Linux中df命令查詢磁盤(pán)信息和fdisk命令分區(qū)的用法

Linux中df命令查詢磁盤(pán)信息和fdisk命令分區(qū)的用法

熱門(mén)標(biāo)簽:小語(yǔ)股票電銷(xiāo)機(jī)器人 杭州電銷(xiāo)機(jī)器人有效果嗎 金華呼叫中心外呼系統(tǒng)廠家 高德地圖標(biāo)注在電腦上 軟件電話機(jī)器人 申請(qǐng)400電話流程好嗎 襄陽(yáng)地圖標(biāo)注店 萊蕪移動(dòng)外呼系統(tǒng) 柯城手機(jī)地圖如何做地圖標(biāo)注

df - 報(bào)告文件系統(tǒng)磁盤(pán)空間的使用情況

總覽

df [OPTION]... [FILE]... POSIX 選項(xiàng): [-kP]

GNU 選項(xiàng) (最短方式): [-ahHiklmPv] [-t fstype] [-x fstype] [--block-size=size] [--print-type] [--no-sync] [--sync] [--help] [--version] [--]

描述

此手冊(cè)頁(yè)文檔是df的GNU版本. df命令列出指定的每一個(gè)文件名所在的文件系統(tǒng)上可用磁盤(pán)空間的數(shù)量。 如果沒(méi)有指定文件名,則顯示當(dāng)前所有使用中的文件系統(tǒng).缺省設(shè)置時(shí), 磁盤(pán)空間以1K為一塊顯示,如果環(huán)境變量POSIXLY_CORRECT已設(shè) 置,則采用512字節(jié)為一塊顯示. 如果參數(shù)是一個(gè)包含已使用文件系統(tǒng)的磁盤(pán)設(shè)備名, df命令顯示出的是該文件系統(tǒng)的可用空間,而非包含設(shè)備結(jié)點(diǎn)的文件系 統(tǒng)(只能是根文件系統(tǒng)).此版本的df不能顯示未使用文件系統(tǒng)的可用空 間,這是由于大多數(shù)系統(tǒng)在響應(yīng)這樣的請(qǐng)求時(shí)必須很清楚該文件系統(tǒng)的 結(jié)構(gòu).

GNU 參數(shù)說(shuō)明

-a, --all
    列出包括BLOCK為0的文件系統(tǒng)
--block-size=SIZE use SIZE-byte blocks
    指定塊的大小
-h,--huma-readable
    用常見(jiàn)的格式顯示出大小(例如:1K 234M 2G)
-H,--si
    同上,但是這里的1k等于1000字節(jié)而不是1024字節(jié)
-i, --inodes
    用信息索引點(diǎn)代替塊表示使用狀況
-k, --kilobytes
    指定塊大小等于1024字節(jié)來(lái)顯示使用狀況
-l, --local
    只顯示本地文件系統(tǒng)使用狀況
-m, --megabytes
    以指定塊大小等于1048576字節(jié)(1M)來(lái)顯示使用狀況
--no-sync
    在取得使用信息前禁止調(diào)用同步 (default)
-P, --portability
    使用POSIX格式輸出
--sync
    在取得使用信息前調(diào)用同步
-t, --type=TYPE
    只顯示指定類型(TYPE)的文件系統(tǒng)
-T, --print-type
    輸出每個(gè)文件系統(tǒng)的類型
-x, --exclude-type=TYPE
    只顯示指定類型(TYPE)之外的文件系統(tǒng).
-v (忽略)
--help
    輸出該命令的幫助信息并退出
--version
    輸出版本信息并退出

例:


復(fù)制代碼
代碼如下:

[root@localhost ~]# df #列出各文件系統(tǒng)的磁盤(pán)空間使用情況
[root@localhost ~]# df -ia #列出各文件系統(tǒng)的i節(jié)點(diǎn)使用情況
[root@localhost ~]# df -T #列出文件系統(tǒng)的類型
[root@localhost ~]# df -h #目前磁盤(pán)空間和使用情況 以更易讀的方式顯示
[root@localhost ~]# df -k #以單位顯示磁盤(pán)的使用情況



fdisk磁盤(pán)分區(qū)命令

-v
    打印 fdisk 的版本信息并退出.
-l
    列出指定設(shè)備的分區(qū)表信息并退出。 如果沒(méi)有給出設(shè)備,那么使用那些在 /proc/partitions (如果存在)提到的.
-u
    以扇區(qū)數(shù)而不是以柱面數(shù)的形式顯示分區(qū)表中各分區(qū)的信息. -s 分區(qū) 將分區(qū)的 大小 (單位為塊)信息輸出到標(biāo)準(zhǔn)輸出

例a,查看所有分區(qū)

復(fù)制代碼
代碼如下:

[root@localhost ~]# fdisk -l /p> p>Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes/p> p> Device Boot Start End Blocks Id System
/dev/sda1 * 1 17 136552 83 Linux
/dev/sda2 18 279 2104515 82 Linux swap / Solaris
/dev/sda3 280 60801 486142965 5 Extended
/dev/sda5 280 60801 486142964+ 83 Linux

例b,fdisk分區(qū)

復(fù)制代碼
代碼如下:

[root@localhost ~]# fdisk /dev/hdc #分區(qū)時(shí),不要加上數(shù)字
The number of cylinders for this disk is set to 5005.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): m #可以查看幫助
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition #刪除分區(qū)
l list known partition types #列舉已知分區(qū)
m print this menu
n add a new partition #增加分區(qū)
o create a new empty DOS partition table
p print the partition table #顯示分區(qū)表
q quit without saving changes #不保存退出分區(qū)
s create a new empty Sun disklabel
t change a partition's system id #改變分區(qū)ID
u change display/entry units
v verify the partition table
w write table to disk and exit #保存分區(qū)操作
x extra functionality (experts only)

Command (m for help): p
Disk /dev/hdc: 41.1 GB, 41174138880 bytes #磁盤(pán)名稱和大小
255 heads, 63 sectors/track, 5005 cylinders #磁頭、磁區(qū)與磁柱數(shù)量,多少
Units = cylinders of 16065 * 512 = 8225280 bytes #每個(gè)磁柱的大小
Device Boot Start End Blocks Id System
/dev/hdc1 * 1 13 104391 83 Linux
/dev/hdc2 14 1288 10241437+ 83 Linux
/dev/hdc3 1289 1925 5116702+ 83 Linux
/dev/hdc4 1926 5005 24740100 5 Extended
/dev/hdc5 1926 2052 1020096 82 Linux swap / Solaris
Command (m for help): q # q是不保存退出,w不要隨便輸入

例c,-c 以柱面顯示

復(fù)制代碼
代碼如下:

[root@server7 ~]# fdisk -cl /dev/vdb
Disk /dev/vdb: 8589 MB, 8589934592 bytes
16 heads, 63 sectors/track, 16644 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xce720981
Device Boot Start End Blocks Id System
/dev/vdb1 3 206 102400 83 Linux
/dev/vdb2 206 409 102400 83 Linux
/dev/vdb3 409 612 102400 83 Linux
[root@server7 ~]# fdisk -ul /dev/vdb
Disk /dev/vdb: 8589 MB, 8589934592 bytes
16 heads, 63 sectors/track, 16644 cylinders, total 16777216 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xce720981
Device Boot Start End Blocks Id System
/dev/vdb1 2048 206847 102400 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/vdb2 206848 411647 102400 83 Linux
Partition 2 does not end on cylinder boundary.
/dev/vdb3 411648 616447 102400 83 Linux
Partition 3 does not end on cylinder boundary.

標(biāo)簽:哈密 海東 九江 孝感 優(yōu)質(zhì)穩(wěn)定 昌都 臺(tái)州 玉樹(shù)

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Linux中df命令查詢磁盤(pán)信息和fdisk命令分區(qū)的用法》,本文關(guān)鍵詞  Linux,中,命令,查詢,磁盤(pán),;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《Linux中df命令查詢磁盤(pán)信息和fdisk命令分區(qū)的用法》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于Linux中df命令查詢磁盤(pán)信息和fdisk命令分區(qū)的用法的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章