У меня есть требование, если бы я нашел свой раздел с помощью блоков-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
От 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, затем виды изменили таблицу разделов.