使用fdisk命令管理磁盤分區(qū)詳解
fdisk命令
fdisk命令來自于英文詞組“Partition table manipulator for Linux”的縮寫,其功能是用于管理磁盤的分區(qū)信息。如果一套幾百平米的房子內(nèi)部沒有墻壁,雖然看起來會(huì)很敞亮,但是各種聲音、氣味、物品會(huì)隨意充斥在整個(gè)房子內(nèi),讓人極不舒適,因此需要用墻壁按照功能進(jìn)行劃分,例如臥室、廁所、廚房、陽臺(tái)等等。
fdisk命令可以用于對(duì)磁盤進(jìn)行分區(qū)操作,用戶可以根據(jù)實(shí)際情況進(jìn)行合理劃分,這樣后期掛載和使用時(shí)會(huì)方便很多。
語法格式: fdisk [參數(shù)] [設(shè)備]
常用參數(shù)
-b | 指定每個(gè)分區(qū)的大小 |
---|---|
-l | 列出指定的外圍設(shè)備的分區(qū)表狀況 |
-s | 將指定的分區(qū)大小輸出到標(biāo)準(zhǔn)輸出上,單位為區(qū)塊 |
-u | 搭配”-l”參數(shù)列表,會(huì)用分區(qū)數(shù)目取代柱面數(shù)目,來表示每個(gè)分區(qū)的起始地址 |
-v | 顯示版本信息 |
參考實(shí)例
查看當(dāng)前系統(tǒng)的分區(qū)情況
[root@linuxcool ~]# fdisk -l Disk /dev/sda: 20 GiB, 21474836480 bytes, 41943040 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 Disklabel type: dos Disk identifier: 0x5f1d8ee5 Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 2099199 2097152 1G 83 Linux /dev/sda2 2099200 41943039 39843840 19G 8e Linux LVM ………………省略部分輸出信息………………
管理指定硬盤的分區(qū)
(過程省略):
[root@linuxcool ~]# fdisk /dev/sda Welcome to fdisk (util-linux 2.32.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help): n All space for primary partitions is in use. Command (m for help): m Help: DOS (MBR) a toggle a bootable flag b edit nested BSD disklabel c toggle the dos compatibility flag Generic d delete a partition F list free unpartitioned space l list known partition types n add a new partition p print the partition table t change a partition type v verify the partition table i print information about a partition Misc m print this menu u change display/entry units x extra functionality (experts only) Script I load disk layout from sfdisk script file O dump disk layout to sfdisk script file Save & Exit w write table to disk and exit q quit without saving changes Create a new label g create a new empty GPT partition table G create a new empty SGI (IRIX) partition table o create a new empty DOS partition table s create a new empty Sun partition table ………………省略部分輸出信息………………
以上就是使用fdisk命令管理磁盤分區(qū)詳解的詳細(xì)內(nèi)容,更多關(guān)于fdisk命令管理磁盤分區(qū)的資料請(qǐng)關(guān)注腳本之家其它相關(guān)文章!
相關(guān)文章
linux下監(jiān)控網(wǎng)絡(luò)流量的腳本
在我們的日常工作當(dāng)中,監(jiān)控網(wǎng)絡(luò)要么使用iptarf,ifstat這些命令實(shí)現(xiàn)的,但是需要裝額外的RPM包。特別是iptarf裝起來麻煩2013-01-01linux 獲取某個(gè)日期對(duì)應(yīng)的月末日期方法
今天小編就為大家分享一篇linux 獲取某個(gè)日期對(duì)應(yīng)的月末日期方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2018-06-06