CentOS erase all Linux partitions

hardware
sysadmin
centos7

#1

I need to erase all partitions stored on second hard disk. Let us name it /dev/sdb. That is actual name of my second disk and it comes with two Linux partitions

  • /dev/sdb1
  • /dev/sdb2

How do you delete and erase all Linux partitions from /dev/sdb and make it empty like a brand new disk?


#2

I use gparted in a GUI screen.


#3

Try dd command (warning all data and partitions would be deleted and can not be recovered):

dd if=/dev/zero of=/dev/sdb  bs=512  count=1

See


Another option is

shred -n 5 -vz /dev/sdb

See


HTH


#4

A hammer applied to a disk will remove all partitions etc


#5

That is not useful answer. How does this help OP to use the disk again?


#6

The only certain way to permanently remove all partitions/data from a disk is to physically destroy the disk. However, since the OP is discarding their system it appears that there is no particular desire to reuse the disk.

If you want to reuse the disk, just repartition as necessary.


#7

@axisofevil I don’t want to physically destroy my hard disk. I never typed I want to. I want to remove all old data and make it like new as I did using dd command. That is the correct answer for me at least.