首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用sgdisk清除/删除已找到分区的内容

如何使用sgdisk清除/删除已找到分区的内容
EN

Ask Ubuntu用户
提问于 2019-03-26 12:50:09
回答 1查看 2.8K关注 0票数 0

我有一个需求,如果我发现我的分区使用skids -p /dev/sdc,那么我需要清除特定的分区内容。如何使用sgdisk命令做到这一点?

假设我找到了Client_Image分区,需要清除该分区的内容

代码语言:javascript
复制
# sudo sgdisk -p /dev/sdc
Disk /dev/sdc: 15654912 sectors, 7.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 8C5B1844-CEAE-2370-00BD-D0E47E3C9900
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 15654878
Partitions will be aligned on 2-sector boundaries
Total free space is 0 sectors (0 bytes)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              34         2097151   1024.0 MiB  0700  Linux data
   2         2097152         8388607   3.0 GiB     0700  Shared FAT
   3         8388608        15654878   3.5 GiB     A503  Client_Image
EN

回答 1

Ask Ubuntu用户

发布于 2019-03-26 13:07:22

来自sgdisk命令页

-d, --delete=partnum Delete a partition. This action deletes the entry from the partition table but does not disturb the data within the sectors originally allocated to the partition on the disk. If a corresponding hybrid MBR partition exists, gdisk deletes it, as well, and expands any adjacent 0xEE (EFI GPT) MBR protective partition to fill the new free space.

因此,删除分区Client_Image (数字3)

代码语言:javascript
复制
sudo sgdisk -d 3 -s /dev/sdc

将删除分区3,然后排序修改的分区表。

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1128830

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档