tom3f
Posts: 10
Joined: Thu Apr 26, 2012 6:26 pm

How to force automounted USB drive to be read-only ?

Sat Dec 01, 2012 2:30 pm

Hello,

When I connect my USB harddrive to raspberry it automaticali mount to /media/My Drive
and /media/TM
On my hdd I have one hfs partition called TM and other one exfat called My Drive. So everything is working. But I want to mount both partitions as read-only. But I don't know how to configure it because I don't know where is configuration file for this service which is mounting my drive automatically. There are no data about this drive in /etc/fstab and when I add there some lines to force ro it works after restart but if i plug usb when system is running, everything is mounted again to /media/ as rw

I am using headless system. (terminal only)

chris57100
Posts: 522
Joined: Wed Sep 12, 2012 7:23 pm
Location: Thionville
Contact: Website

Re: How to force automounted USB drive to be read-only ?

Sun Dec 02, 2012 12:42 pm

Hello,

After the reboot your fstab file is updated or you still have the ro in the parameters ?
The dmesg tail has traces of the same device than in fstab ? I made one time the mistake to use sda instead of sdb ...

Else there is a service called autofs to automount USB drives. May be it's installed within your distribution
Raspberry Pi Home Server : http://www.pihomeserver.fr
Software and electronic tutorials : Samba, Airplay, CUPS, Time machine, Nginx, Owncloud, rTorrent, Wordpress, etc.
Full Wi-Fi hotspot installation on a RPi 3 including a captive portal and freeradius management: https://github.com/pihomeserver/Kupiki-Hotspot-Script

tom3f
Posts: 10
Joined: Thu Apr 26, 2012 6:26 pm

Re: How to force automounted USB drive to be read-only ?

Mon Dec 03, 2012 11:35 am

After reboot it works fine, hdd is mounted like ro and in fstab it is ro too. But if I unplug USB and then plug it back, hdd is always mounted like rw. I don't have this automount service instaled. So I don't understand which program mount my hdd every time when pluged in.

Return to “Beginners”