[systemd-devel] [EXT] Launch a mount unit from udev rule via ENV{SYSTEMD_WANTS}

Jacopo fingolfin00 at gmail.com
Thu Feb 16 09:31:34 UTC 2023


Il giorno gio 16 feb 2023 alle ore 08:39 Ulrich Windl <
Ulrich.Windl at rz.uni-regensburg.de> ha scritto:

> >>> Jacopo <fingolfin00 at gmail.com> schrieb am 15.02.2023 um 17:59 in
> Nachricht
> <CAO-AGAuKP=BvtTfGOpCcePGaZAiqzcA9+exi0V-rSYkLNMLohg at mail.gmail.com>:
> > I'be been having issues lately trying to automatically remount an
> external
> > USB drive that is mounted at boot from an fstab entry:
> > LABEL=data-ssd  /opt/data-ssd  ext4  defaults,nofail,users  0  2
> >
> > I'm using systemd 244 and after some investigation I learned about the
> > possibility to launch a systemd unit from a udev rule via
> > ENV{SYSTEMD_WANTS} (see here
> > https://github.com/systemd/systemd/issues/22589#issuecomment-1047940003
> and
> > https://github.com/systemd/systemd/pull/11373#issuecomment-594014841)
> >
> > In particular the second suggestion is exactly what I need, but the only
> > way I could make it work was launching a dummy.service that "Wants" the
> > corresponding mount unit:
> >
> > udev rule:
> > ACTION=="add", SUBSYSTEM=="block", KERNEL=="sd*", SUBSYSTEMS=="usb",
>
> And is your SSD really a "sd*" device?
>

Yeah I use a SATA-to-USB adaptor so it's exposed as /dev/sd*.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20230216/7764e96b/attachment.htm>


More information about the systemd-devel mailing list