LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-16-2020, 06:36 AM   #1
smashit
LQ Newbie
 
Registered: Oct 2020
Posts: 2

Rep: Reputation: Disabled
Detection of readonly or readwrite modes of NVMe devices in Linux


I am using NVMe devices on SLES15 sp1 and sp2 both. These NVMe devices are exposed through SAN. Because they exported from SAN, these devices can go readonly or back to readwrite due to some changes by host or internally. I am trying to find out a way in sales host if the device is readonly without doing any IOs to it. The small dd command that I did, succeeded but IO errors appeared in dmesg. At a later point when device turned rw, again I couldn't find if the device is rw now. dd command succeeded and no bad messages in dmesg.
In summary, I want to know how I can find out if device is read only. I do see a file called “/sys/block/nvmeXnY/ro” but that always remained 0 even when device is readonly. Moreover, when I try "blockdev –rereadpt /dev/nvmeXnY; blockdev -report /dev/nvmeXnY", the output is always RW.
Thanks
 
Old 10-16-2020, 06:59 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
Are you on a SLES support contract ?. Go ask them.
 
Old 10-17-2020, 05:25 AM   #3
smashit
LQ Newbie
 
Registered: Oct 2020
Posts: 2

Original Poster
Rep: Reputation: Disabled
I believe this is not SLES specific question. What is the way to find out NVMe device state in any Linux distribution ? e.g. in case of SCSI, I could do "blockdev --rereadpt <dev>; blockdev --report <dev>" to get the latest state of the device, but the same isn't working for NVMe.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
fstab mounting cifs voumes in file_mode=755 / readonly , needs to be readwrite gregorywest Linux - Security 5 11-23-2019 02:00 AM
LXer: Data in a Flash, Part II: Using NVMe Drives and Creating an NVMe over Fabrics Network LXer Syndicated Linux News 0 05-20-2019 11:41 PM
Migrate Linux/win10 dual boot from MBR nvme drive to a new GPT nvme drive bluemoo Linux - Software 7 09-25-2018 06:42 PM
-bash: HISTSIZE: readonly variable -bash: HISTFILESIZE: readonly variable deathsfriend99 Linux - Newbie 4 12-08-2009 12:51 PM
Difference between Readonly Filesystem and Mounting filesystem as readonly bluepenguine Linux - Newbie 1 06-19-2009 01:26 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration