read-only flag

Keith Busch kbusch at kernel.org
Thu Apr 20 12:35:40 PDT 2023


On Thu, Apr 20, 2023 at 07:25:09PM +0000, Igor Rybak wrote:
> Hi,
> 
> If I set the read-only flag on a block device like "sudo blockdev -setro /dev/nvme0n1", I can still erase the drive with "nvme format /dev/nvme0n1". 
> Is this normal? Where do you think the read-only flag should be handled?

'format' is an admin command utilizing the admin queue, which is not tied to
the block device. If you're seeking a way to prevent accidently formatting a
namespace that you've marked 'read-only', I don't think any such method exists.



More information about the Linux-nvme mailing list