我有一个需求,如果我发现我的分区使用skids -p /dev/sdc,那么我需要清除特定的分区内容。如何使用sgdisk命令做到这一点?
假设我找到了Client_Image分区,需要清除该分区的内容
# 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发布于 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)
sudo sgdisk -d 3 -s /dev/sdc将删除分区3,然后排序修改的分区表。
https://askubuntu.com/questions/1128830
复制相似问题