Ask advise for disk safely reuse

Hannes Reinecke hare at suse.de
Sun Apr 24 04:39:39 PDT 2022


On 4/22/22 06:50, Shuo Chen wrote:
> Hi teams,
> I am investigating how to safely reuse the disk between different
> customers and do a safe data cleaning. From the nvme-cli I see three
> options:
> nvme format
> nvme sanitize
> nvme write-zeros
> 
> I've tried all of these three methods and it looks like I can not read
> any previous data by using the "dd" command anymore. I wonder what is
> the difference between these three? My concern is writing zeros to the
> whole disk is really time consuming, as a result, I wonder whether
> "nvme format" is good enough to wipe the data.

In theory, all of the above provide the desired result.
'nvme format' is typically used to change the format parameters, so if 
you call 'nvme format' with the same parameters as had been used 
previously the net result will be pretty close to 'nvme sanitize'.
'nvme write-zeroes' will achieve similar effects, but with the drawback 
that it instructs the firmware to actually _write_ data, thereby 
decreasing the lifetime of the device.

So I would settle with 'nvme sanitize'; that achieves what you want with 
least side-effects.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare at suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer



More information about the Linux-nvme mailing list