[LINUX] RHCSA test preparation-How to delete partition table

Introduction The command introduced in this article is to delete the information in the physical drive (HDD, SSD, etc.). If you do this, the data in the drive will be lost, so please be aware of this.

This article introduces the command to delete partition table from the drive that has GPT partition table.

There are several ways to delete a partition table on the Internet. I'm picking up what I personally find the easiest.

Method using wipefs In the figure below, / dev / sdb and / dev / sdc already have a GPT-formatted partition table.
parted /dev/sdb print
parted /dev/sdb print

You can confirm that it is in GPT format from the output of the above command. (See lines 5 and 13 from the top of the figure) image.png In the above figure, the following command was executed to delete the partition table of the drive.

wipefs -a /dev/sdb
wipefs -a /dev/sdc

After deleting the above partition table, when I checked it again with the following command, the partition table became unknown. The deletion of the table is completed successfully.

parted /dev/sdb print
parted /dev/sdb print

image.png Now you can treat the drive as clean. If you want to perform verification from a clear state again in a verification environment, please use it.

Delete partition table using dd command I will write this later even when I have free time. (Because the purpose of this article is to prepare for the RHCSA exam, we are focusing on commands that you may find easy to enter during the exam.)

Recommended Posts

RHCSA test preparation-How to delete partition table