linux刪除分區(qū)命令, linux系統(tǒng)中刪除分區(qū)命令是什么?以下是詳細介紹:
在linux系統(tǒng)中刪除分區(qū)的命令是:fdisk命令。
1.fdisk命令介紹:
fdisk-partition table manipulator for Linux,翻譯成中文就是磁盤分區(qū)表操作工具的意思,其實就是一個分區(qū)工具。Fdsik可以將磁盤分成幾個區(qū)域,
同時,它還可以指定每個分區(qū)的文件系統(tǒng)。
比如linux,fat32,linux,linux swap,fat16及其Unix操作系統(tǒng)的文件系統(tǒng)等。當然,當我們使用fdisk對磁盤操作進行分區(qū)時,它并不是一個終點。
我們還需要格式化分區(qū)所需的文件系統(tǒng);可以使用這樣的隔板;這類似于DOS中的fdisk。
2.fdisk操作硬盤的命令格式:
[root@localhost beinan]# fdisk設(shè)備
通過fdisk -l了解/dev/hda或/dev/sda設(shè)備;如果要再次添加或刪除
可以使用一些分區(qū)
[root@localhost beinan]# fdisk /dev/hda
或
[root@localhost beinan]# fdisk /dev/sda
3.fdisk的描述:
通過fdisk設(shè)備,當你進入相應(yīng)設(shè)備的操作時,會有如下提示。
[root@localhost beinan]# fdisk /dev/sda
Command (m表示幫助):這里按m,輸出幫助;
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d刪除分區(qū)注意:這是刪除分區(qū)的動作;
L列出已知分區(qū)類型注:L列出分區(qū)類型供我們設(shè)置對應(yīng)的分區(qū)類型;
M打印這個菜單注意:M是列出幫助信息;
n添加新分區(qū)注意:添加分區(qū);
o create a new empty DOS partition table
Print partition table Note: p List partition table;
q quit without saving changes 注:不保存退出;
s create a new empty Sun disklabel
t change a partitions system id 注:t 改變分區(qū)類型;
u change display/entry units
v verify the partition table
w write table to disk and exit 注:把分區(qū)表寫入硬盤并退出;
x extra functionality (experts only) 注:擴展應(yīng)用,專家功能;12345678910111213141516171819
舉例:
列出當前操作硬盤的分區(qū)情況,用p:
Command (m for help): p
Disk /dev/sda: 1035 MB, 1035730944 bytes
256 heads, 63 sectors/track, 125 cylinders
Units=cylinders of 16128 * 512=8257536 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 25 201568+ c W95 FAT32 (LBA)
/dev/sda2 26 125 806400 5 Extended
/dev/sda5 26 50 201568+ 83 Linux
/dev/sda6 51 76 200781 83 Linux123456789
通過fdisk的d指令來刪除一個分區(qū):
Command (m for help): p 注:列出分區(qū)情況;
Disk /dev/sda: 1035 MB, 1035730944 bytes
256 heads, 63 sectors/track, 125 cylinders
Units=cylinders of 16128 * 512=8257536 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 25 201568+ c W95 FAT32 (LBA)
/dev/sda2 26 125 806400 5 Extended
/dev/sda5 26 50 201568+ 83 Linux
/dev/sda6 51 76 200781 83 Linux
Command (m for help): d 注:執(zhí)行刪除分區(qū)指定;
Partition number (1-6): 6 注:我想刪除sda6 ,就在這里輸入6 ;
Command (m for help): p 注:再查看一下硬盤分區(qū)情況,看是否刪除了?
Disk /dev/sda: 1035 MB, 1035730944 bytes
256 heads, 63 sectors/track, 125 cylinders
Units=cylinders of 16128 * 512=8257536 bytes
Device Boot Start End Blocks Id System
/dev/sda1 1 25 201568+ c W95 FAT32 (LBA)
/dev/sda2 26 125 806400 5 Extended
/dev/sda5 26 50 201568+ 83 Linux
Command (m for help):1234567891011121314151617181920
注意:刪除分區(qū)時要小心,請看好分區(qū)的序號,如果您刪除了擴展分區(qū),擴展分區(qū)之下的邏輯分區(qū)都會刪除;所以操作時一定要小心;如果知道自己操作錯了,用q不保存退出;在分區(qū)操作錯了時,千萬不要輸入w保存退出。
linux刪除分區(qū)命令,以上就是本文為您收集整理的linux刪除分區(qū)命令最新內(nèi)容,希望能幫到您!更多相關(guān)內(nèi)容歡迎關(guān)注。