Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #245834

Re: Make Debian automount mount devices in read only

From Carles Pina i Estany <carles@pina.cat>
Newsgroups linux.debian.user
Subject Re: Make Debian automount mount devices in read only
Date 2022-03-03 14:40 +0100
Message-ID <DWTQt-5AOC-7@gated-at.bofh.it> (permalink)
References <DWPDb-5y9r-3@gated-at.bofh.it> <DWSB3-5A3A-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

On Mar/03/2022, Brian wrote:
> On Thu 03 Mar 2022 at 10:00:09 +0100, Carles Pina i Estany wrote:
> 
> > 
> > Hi,
> > 
> > My desktop computer (Debian 11.2) auto-mounts USB devices (hard disks,
> > etc.)
> > 
> > I would like the devices to be mounted in read only mode by default. I
> > will remount them in rw if I need to.
> > 
> > They are not in my /etc/fstab
> > 
> > I've been looking at udev configuration files, rules, etc. but I'm
> > unsure which is the best way to go.
> > 
> > Is anyone here a bit more familiar with udev, systemd, etc. let me know
> > of a good approach please? The current Debian (and for many versions)
> > worked so well for me that I haven't dealt with this kind of settings,
> > I don't know which is the right tool to setup or how they interact with
> > eachother in detail anymore :-)
> 
> I have a USB stick containing audio files and in /etc/fstab there is
> 
>  LABEL=MUSIC-1  /media/MUSIC-1  vfat ro,gid=1000,fmask=0117,dmask=0007,noatime,noauto,user,x-systemd.automount,x-systemd.idle-timeout=5,x-systemd.device-timeout=1 0 0

Thanks!

> Mounting takes place only when the decice is accessed.

Ha! This is a bit different but interesting anyway. I didn't know that
it was possible to use x-systemd.* options in /etc/fstab

[...]

> I haven't any idea how this fits in with having udisks on the system or
> remounting a disk rw, or even how it fits your objectives.

For the remounting I'm not worried.

My use case is that I have about 10 or 15 hard disks that I want to
automount in ro because... I only need to read from them and I want to
avoid making accidental changes.

I expect that I don't need to change /etc/fstab with the UUID / LABEL of
each one.

I guess (untested) that I could do:
"
/dev/sdc1	/mnt/read-only	auto	ro,other_options	0 0
"

But I think that I would prefer to change the auto-mounter instead of
changing /etc/fstab and assume that they will come as sdc1 (plus some
have different partitions; and they have ext4, vfat and reiserfs for
what I remember but "auto" should be enough for this).

Thanks for the answer,

-- 
Carles Pina i Estany
https://carles.pina.cat

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Make Debian automount mount devices in read only Carles Pina i Estany <carles@pina.cat> - 2022-03-03 10:10 +0100
  Re: Make Debian automount mount devices in read only Brian <ad44@cityscape.co.uk> - 2022-03-03 13:20 +0100
    Re: Make Debian automount mount devices in read only Carles Pina i Estany <carles@pina.cat> - 2022-03-03 14:40 +0100
  Re: Make Debian automount mount devices in read only David Wright <deblis@lionunicorn.co.uk> - 2022-03-03 17:00 +0100
    Re: Make Debian automount mount devices in read only Carles Pina i Estany <carles@pina.cat> - 2022-03-04 00:30 +0100

csiph-web