I have a requirement, if I found my partition using skids -p /dev/sdc then I need to clear the particular partition content. How can I do that using sgdisk command?
Suppose I found the Client_Image partition and need to clear the content of that
# 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 1 Answer
From sgdisk manpage:
-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.
Therefore, to delete partition Client_Image (number 3)
sudo sgdisk -d 3 -s /dev/sdc Will delete partition 3, then sorts modified partition table.
1