View Full Version : How to mount usb storage devices as read-only

28th July 2015, 12:55 PM
Hi Friends,

On earlier fedora versions I was able to successfully mount the usb storage devices in read-only mode through udev rules. Now the below rules are no longer working on Fedora 21, in-fact with the below rules the usb drives no longer gets automounted. Can someone share the fix for Fedora 21 for mounting usb drives a read-only.


SUBSYSTEMS=="usb|firewire", KERNEL=="sd?*[0-9]*", ACTION=="add" RUN+="/usr/local/sbin/usb_remount %k"


if [ -z "$2" ];then
$0 $1 foo &disown

while [ -z "$(grep -e "^/dev/$1 " /etc/mtab)" ] ;do

sleep 0.1

/bin/mount -o remount,ro /dev/$1

Do let me know if you need any further information.

Thanks & Regards

Ankush Grover