SCIENTIFIC-LINUX-USERS Archives

August 2015

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
ToddAndMargo <[log in to unmask]>
Reply To:
ToddAndMargo <[log in to unmask]>
Date:
Sat, 29 Aug 2015 22:18:49 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (43 lines)
On 08/29/2015 09:45 PM, Brandon Vincent wrote:
> On Sat, Aug 29, 2015 at 8:14 PM, ToddAndMargo <[log in to unmask]> wrote:
>> I was looking for an easier way to tell if my write protect switches
>> were in the read only position.  There are other ways, like trying to
>> mount it and see what happens, but I would like to get the information
>> more directly.
>
> Try querying the block device with udevadm(8).
>
> udevadm info -a -n /dev/sdc
>
> Brandon Vincent
>

Rats!

   looking at device 
'/devices/pci0000:00/0000:00:1d.7/usb2/2-4/2-4.2/2-4.2:1.0/host7/target7:0:0/7:0:0:0/block/sdc':
     KERNEL=="sdc"
     SUBSYSTEM=="block"
     DRIVER==""
     ATTR{ro}=="1"
     ATTR{size}=="61767680"
     ATTR{stat}=="     360        3     2904      376        0        0 
        0        0        0      376      376"
     ATTR{range}=="16"
     ATTR{discard_alignment}=="0"
     ATTR{events}=="media_change"
     ATTR{ext_range}=="256"
     ATTR{events_poll_msecs}=="-1"
     ATTR{alignment_offset}=="0"
     ATTR{inflight}=="       0        0"
     ATTR{removable}=="1"
     ATTR{capability}=="51"
     ATTR{events_async}==""


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ATOM RSS1 RSS2