RE: nvme sanitize command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
> Sent: 13 January 2025 11:18
> To: Renaud Barbier <Renaud.Barbier@xxxxxxxxxx>; Barebox List
> <barebox@xxxxxxxxxxxxxxxxxxx>
> Subject: Re: nvme sanitize command
> 
> ***NOTICE*** This came from an external source. Use caution when replying,
> clicking links, or opening attachments.
> 
> Hello Renaud,
> 
> On 13.01.25 11:57, Renaud Barbier wrote:
> > I would like to add a nvme sanitize command to the barebox. Something like
> "nvme sanitize" where at first the only option is block erase.
> 
> That would indeed be useful to have.
> 
> > I have a level of understanding on how admin commands are passed to
> > the device through the /drivers/nvme/host/[core.c|pci.c.]
> > Looking at the parted command, I am not sure how it goes from the
> command call to the partition layer support (EFI or DOS) to the driver.
> >
> > I see that Linux make use of an ioctl to trigger the sanitize command.
> 
> We do have ioctls on cdev in barebox, but we also have an actual erase
> operation, so I prefer we use that instead.

Below the option for sanitize command:
# nvme sanitize --help
Usage: nvme sanitize <device> [OPTIONS]

Send a sanitize command.

Options:
  [  --no-dealloc, -d ]                 --- No deallocate after sanitize.
  [  --oipbp, -i ]                      --- Overwrite invert pattern between
                                            passes.
  [  --owpass=<NUM>, -n <NUM> ]         --- Overwrite pass count.
  [  --ause, -u ]                       --- Allow unrestricted sanitize exit.
  [  --sanact=<NUM>, -a <NUM> ]         --- Sanitize action.
  [  --ovrpat=<NUM>, -p <NUM> ]         --- Overwrite pattern.

Note I am talking about sanitize operation that is  the whole device being erased i.e there is no start and end block to be specified.

Using erase would limit sanitisation to erasing the whole media and no possibility to use the other options such as overwrite where a pattern and a number of pass is specified. 
Unless a way can be added to set features for sanitize.
At present, erase is all I need so I will add the erase entry point with the sanitisation action being NVME_SANITIZE_SANACT_START_BLOCK_ERASE as default.






[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux