【笔记】Linux删除磁盘分区

前言

Linux删除磁盘分区

查看设备

1
fdisk -l

删除分区

/dev/sdb:需要被删除分区的设备

1
fdisk /dev/sdb

Command:输入命令

d:删除分区
w:保存分区表

Partition number:输入需要删除的分区序号,如果只有1个分区,无需选择

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

Welcome to fdisk (util-linux 2.36.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): d
Partition number (1,2, default 2): 2

Partition 2 has been deleted.

Command (m for help): w
The partition table has been altered.
Failed to remove partition 2 from system: Device or resource busy

The kernel still uses the old partitions. The new table will be used at the next reboot.
Syncing disks.

完成

参考文献

CSDN——danxuezx