Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 10-03-2006, 01:25 AM   #1
LQ Newbie
Registered: Oct 2006
Location: Torhout, Belgium
Posts: 1

Rep: Reputation: 0
Retrieve write protect state of USB device in user space


I'm currently struggling with the following issue:

I have to know the write protection state of USB mass storage devices which have a mechanical switch to protect the date from being overwritten.

When I attach such USB device to our hardware (embedded software project, MIPS based. kernel 2.6.10), I see that the kernel is showing me the write protection state (on or off) of the attached device. So, the kernel can anyhow detect this.

However, I can't find a way to get this information in user space (because that's where I need it).

Does anyone know how I can get this kernel info into user space? Are there specific locations/files where I can retrieve this information, like we can use /sys/block/sda/devices to get, among other things, vendor name, version number, model,...?

So far, I didn't succeed in finding the location for the write protection state of the device.

Any help much appreciated!

Best rgds,



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How do I retrieve the link state? bb002 Linux - Networking 1 10-31-2005 01:49 AM
Read and write USB device with non-root access halfzware_shag Linux - Hardware 3 10-11-2004 04:26 AM
write protect freezes my usb stick db391 Linux - Hardware 3 09-25-2004 04:43 AM
How i can write to device /dev/usb/hiddev0 ? njel Programming 2 08-17-2004 03:16 AM
write access on usb storage device wincen Linux - Hardware 3 01-20-2004 08:01 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:29 AM.

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