0

I have a sata disk on module which has a hardware switch which can lock the disk from being written in a READ ONLY MODE. Is there a way to tell in software whether or not that switch has been switched to the READ ONLY mode?

I've already examined:

lsblk

smartctrl

parted

I wonder if there is an endpoint in : /sys/class/scsi_disk/ perhaps?

Rusty Weber
  • 472
  • 8
  • 21

2 Answers2

1

You can tell if the disk itself is set as read only by mounting it and using the mount command or by running cat /proc/mounts

It's difficult to tell whether or not the hardware switch is on without knowing who manufactures the disk.

Your best bet would be to look that information up and see if there is a way to do so. A good starting point would be the manufacturer's website.

Nasir Riley
  • 2,137
  • 9
  • 10
1

try with hdparm (https://linux.die.net/man/8/hdparm ) it should show this, I assume.

tonioc
  • 1,047
  • 8
  • 11