欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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

51yip   發(fā)布時間:2016-01-14 14:21:43   作者:張映   我要評論
這篇文章主要介紹了Linux中df命令查詢磁盤信息和fdisk命令分區(qū)的用法,是Linux入門學習中的基礎(chǔ)知識,需要的朋友可以參考下

df - 報告文件系統(tǒng)磁盤空間的使用情況

總覽

df [OPTION]... [FILE]... POSIX 選項: [-kP]

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

描述

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

GNU 參數(shù)說明

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

例:


復制代碼
代碼如下:

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



fdisk磁盤分區(qū)命令

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

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

復制代碼
代碼如下:

[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ū)

復制代碼
代碼如下:

[root@localhost ~]# fdisk /dev/hdc #分區(qū)時,不要加上數(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 #磁盤名稱和大小
255 heads, 63 sectors/track, 5005 cylinders #磁頭、磁區(qū)與磁柱數(shù)量,多少
Units = cylinders of 16065 * 512 = 8225280 bytes #每個磁柱的大小
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 以柱面顯示

復制代碼
代碼如下:

[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.

相關(guān)文章

  • linux下使用fdisk結(jié)合partprobe命令不重啟系統(tǒng)添加一塊新的磁盤分區(qū)

    使用partprobe可以不用重啟系統(tǒng)即可配合fdisk工具創(chuàng)建新的分區(qū),這里簡單的分享下,方便需要的朋友
    2013-04-01
  • Linux fdisk 命令使用詳解

    fdsik 能劃分磁盤成為若干個區(qū),同時也能為每個分區(qū)指定分區(qū)的文件系統(tǒng),比如linux 、fat32、 linux 、linux swap 、fat16 以及其實類Unix類操作系統(tǒng)的文件系統(tǒng)等
    2024-08-29
  • fdisk對硬盤分區(qū)

    fdisk 操作硬盤的命令格式如下:   [root@localhost beinan]# fdisk 設(shè)備   比如我們通過 fdisk -l 得知 /dev/hda 或者 /dev/sda設(shè)備;我們?nèi)绻朐偬砑踊蛘邉h除一些
    2009-03-10
  • Linux下使用fdisk命令進行磁盤分區(qū)(圖文詳解)

    FDISK是一個用于硬盤分區(qū)的工具,特別是在較早的操作系統(tǒng)版本中,如Windows 98和早期的Linux系統(tǒng)中,F(xiàn)DISK是進行硬盤分區(qū)的主要工具,這里就為大家分享一下linux系統(tǒng)中使用
    2024-08-29

最新評論