Re: [CentOS] erasing a disk

2020-09-14 Thread david

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  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  blocks starting at block 
>- erase last  blocks
>
> At least such an algorithm would be quicker than erasing 8 TB of data.
>
> David
>
> ___
> CentOS mailing list
> CentOS@centos.org
> https://lists.centos.org/mailman/listinfo/centos
>


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

David 


___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] erasing a disk

2020-09-14 Thread John Pierce
I've never run into a system yet where using dd to write zeros on the first
few megabytes didn't completely wipe the disk as far as the OS and existing
file systems are concerned..

dd if=/dev/zero of=/dev/sde bs=65536 count=1024
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] erasing a disk

2020-09-14 Thread david

At 02:36 PM 9/14/2020, you wrote:

On 2020-09-14 16:52, Robert Heller wrote:

At Mon, 14 Sep 2020 13:14:44 -0700 CentOS mailing list
 wrote:


Folks
I've encountered situations where I want to reuse a hard-drive.  I do


If it is a Seagate, don't bother.  They have the highest failure 
rate in the industry.


Look at the SMART statistics before deciding to re-use a disk, 
especially "Reallocated_Sector_Ct,"

"Power_On_Hours," and run the "extended SMART test."

Todd Merriman
Software Toolz, Inc.


Todd

The reason I'm reusing a disk is not because of hardware failures, 
but rather because I've abandoned a particular use for that disk, 
maybe changed operating systems, maybe tried something using ZFS and 
want to change to some other techonology.  I know that the best way 
to reclaim a disk after read-failures is to wipe it with zeros, and 
this takes days.


And by the way, I typically use only WD disks, not seagate.

Thanks for the confirmation.

David 


___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] erasing a disk

2020-09-14 Thread mailist

On 2020-09-14 16:52, Robert Heller wrote:

At Mon, 14 Sep 2020 13:14:44 -0700 CentOS mailing list
 wrote:



Folks

I've encountered situations where I want to reuse a hard-drive.  I do


If it is a Seagate, don't bother.  They have the highest failure rate in 
the industry.


Look at the SMART statistics before deciding to re-use a disk, 
especially "Reallocated_Sector_Ct,"

"Power_On_Hours," and run the "extended SMART test."

Todd Merriman
Software Toolz, Inc.
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] erasing a disk

2020-09-14 Thread Robert Heller
At Mon, 14 Sep 2020 13:14:44 -0700 CentOS mailing list  
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  blocks starting at block 
>- erase last  blocks

Use dd in a script:

#!/bin/bash
# erase N 4K blocks starting at M
# (M=0 means from the start of the disk)
# usage: $0 start4Kblock numberof4Kblocks drive
M = $1
N = $2
rawdisk = $3
dd if=/dev/zero bs=4096 oflag=direct count=$N seek=$M of=$rawdisk

> At least such an algorithm would be quicker than erasing 8 TB of data.
> 
> David
> 
> ___
> CentOS mailing list
> CentOS@centos.org
> https://lists.centos.org/mailman/listinfo/centos
> 
>   
>  
> 

-- 
Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software-- Custom Software Services
http://www.deepsoft.com/  -- Linux Administration Services
hel...@deepsoft.com   -- Webhosting Services


___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] erasing a disk

2020-09-14 Thread Erick Perez - Quadrian Enterprises
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  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  blocks starting at block 
>- erase last  blocks
>
> At least such an algorithm would be quicker than erasing 8 TB of data.
>
> David
>
> ___
> CentOS mailing list
> CentOS@centos.org
> https://lists.centos.org/mailman/listinfo/centos
>


-- 

-
Erick Perez
Quadrian Enterprises S.A. - Panama, Republica de Panama
Skype chat: eaperezh
WhatsApp IM: +507-6675-5083
-
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] erasing a disk

2020-09-14 Thread Jon Pruente
On Mon, Sep 14, 2020 at 3:18 PM david  wrote:

> 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?
>

GPT for sure has backup metadata on the drive, so you won't be wiping it by
trying to remove the first few MB. You always should try using tooling made
for the purpose instead of trying to manually do it. In this case try a
tool like wipefs.
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] erasing a disk

2020-09-14 Thread Gordon Messmer

On 9/14/20 1:14 PM, david wrote:
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? 



Use "wipefs -a" on any partition (or raw disk) before reusing it.

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


[CentOS] erasing a disk

2020-09-14 Thread david

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  blocks starting at block 
  - erase last  blocks

At least such an algorithm would be quicker than erasing 8 TB of data.

David

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos