[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

/sys/block/$device/removable reporting a removable disk as fixed



Dear Klaus,

Thanks so much for your detailed and helpful reply.  Use of
/sys/block/$device/removable looked like just what the doctor ordered.  I
ran some tests and usb _flash_ drives are being reported as removable. 
However, I plugged in a Western Digital usb pocket-sized portable
(mechanical) hdd and it is reported as fixed. :(

This may be the way to go, anyway.  I have seen many of these pocket-sized
portable hdds for sale, but haven't seen anyone carrying one around
without their own laptop.  In any case, /sys/.../removable solves at least
90% of the cases.

Is another test I could use?  Thanks again.

Best regards,
Andrew

> Hello Andrew,
>
> On Sat, Aug 20, 2011 at 03:10:46AM -0400, Andrew wrote:
>> Dear Filippo Valsorda,
>>
>> I don't understand.  What are you suggesting I do with udev?
>>
>> -Andrew
>>
>> > Udev is the way to go. (I think ;) )
>> > http://reactivated.net/writing_udev_rules.html
>> >
>> > ---
>> > Filippo Valsorda
>
> The knoppix terminalserver client (at least the default option) runs
> completely on the client side, only the base system is mounted via NFS
> from the DHCP/TFTP/NFS server containing the Knoppix CD or DVD.
>
> This means that the server does not have to export any of its drives,
> and all the hardware is handled locally on the (fat) client.
>
> udev sets up /etc/fstab for local mounts via the "rebuildfstab" script
> on device detection, and this is the point where you could add a
> difference between fixed disks and removable ones. They are easy to
> distinguish by checking the content of /sys/block/$device/removable. If
> it equals "0", it's a fixed disk.
>
> Alternately, you could add a script that sets fixed internal harddisks
> and partitions (see above) to read-only via blockdev --setro $device,
> for example in /etc/rc.local on the server, which will then be executed
> on the clients on boot.
>
> Regards
> -Klaus
>
>> > Il giorno 18/ago/2011, alle ore 13:55, "Andrew"
>> <knoppix@rngresearch.com>
>> > ha scritto:
>> >
>> >> Dear Klaus et al,
>> >>
>> >> I have some windows boxes and would like to use Knoppix
>> terminalserver
>> >> to
>> >> provide a linux alternative.  The users should have full access to
>> any
>> >> usb
>> >> devices they plug in, but I do not want them to be able to
>> (accidentally
>> >> or intentionally) clobber the windows drives; they should only be
>> >> mountable ro, or perhaps not mountable at all.  The problem is that
>> some
>> >> of the machines have more than one hard disk, so I must prevent
>> >> /dev/sdb1
>> >> from being writable, but this prevents use of usb flash drives on the
>> >> machines with only one hard disk!
>> >>
>> >> Any suggestions?
>> >>
>> >> -Andrew
>
>
> --
> To UNSUBSCRIBE, email to debian-knoppix-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact
> listmaster@lists.debian.org
> Archive: [🔎] 20110820134244.GG2905@knopper.net">http://lists.debian.org/[🔎] 20110820134244.GG2905@knopper.net
>
>



Reply to: