[CentOS] erasing a disk

Mon Sep 14 22:06:18 UTC 2020
david <david at daku.org>

At 01:34 PM 9/14/2020, you wrote:
>what if you just dd the first 1GB of the disk and the last GB of the disk
>(the last because of RAID signatures of some controllers that write to the
>end of the disk)
>Look at this article and modify accordingly
>https://zedt.eu/tech/linux/using-dd-to-repeatedly-erase-a-specific-range-of-sectors-on-the-hard-disk/
>
>Also, use wipefs -a (Gordon Messmer answered faster than me)
>
>On Mon, Sep 14, 2020 at 3:18 PM david <david at daku.org> wrote:
>
> > Folks
> >
> > I've encountered situations where I want to reuse a hard-drive.  I do
> > not want to preserve anything on the drive, and I'm not concerned
> > about 'securely erasing' old content.  I just want to be able to
> > define it as an Physical Volume (in a logical volume set), or make it
> > a ZFS disk, or sometimes make it a simple EXT3, ExFAT or NTFS
> > disk.  However, old 'signatures' get in the way and Linux sometimes
> > refuses to let me proceed.  I know that a fool-proof solution is to
> > use the "dd if=/dev/zero bs=32768 oflag=direct" on the disk, but when
> > we're talking USB-connected hard drives of 8 TB, that's an operation
> > that can take days.
> >
> > The disk in question might even have been corrupted.  This would make
> > using 'zpool destroy' to clear out a ZFS disk, or
> >
> > I've tried erasing the first megabyte of the disk, but there are ZFS
> > or LVM structures that get in the way.  So, does anyone have an
> > efficient way to erase structures from a disk such that it can be reused?
> >
> > Something like
> >    -erase first N blocks (block defined as 4096)
> >    - Erase <number> blocks starting at block <number>
> >    - erase last <number> blocks
> >
> > At least such an algorithm would be quicker than erasing 8 TB of data.
> >
> > David
> >
> > _______________________________________________
> > CentOS mailing list
> > CentOS at centos.org
> > https://lists.centos.org/mailman/listinfo/centos
> >

Thanks for the suggestion.  "wipefs" looks like the right answer.

David