Arch auto mount usb example
After 2 days of head banging and following the wrong answers on google, I finally got my usb to auto mount as user on the Arch Phosh install.

There is no guaranties this will work as everything in linux is dynamic and what worked one day doesn't the next. 

Here is what I did I create 3 file  


Quote:ACTION=="add",KERNEL=="sd[a-z][0-9]*",SUBSYSTEMS=="usb",RUN+="/bin/systemctl start usb-mount@%k.service"

ACTION=="remove",KERNEL=="sd[a-z][0-9]*",SUBSYSTEMS=="usb",RUN+="/bin/systemctl stop usb-mount@%k.service"

Description=Mount USB Drive on %i
ExecStart=/home/alarm/bin/ add %i
ExecStop=/home/alarm/bin/ remove %i



case "${ACTION}" in
        /usr/bin/udisksctl mount -b ${DEVICE}
        /usr/bin/udisksctl unmount -b ${DEVICE}

Don't forget to chmod -x it can be called anything and put anywhere, obvious use your path in the usb-mount@.service file.

I found rebooting the phone more reliable than 

Quote:udevadm control --reload-rules

systemctl daemon-reload

EDIT: Check the Second Post, I forgot the polkit edit. If it works without it great, but I am sure it was critical... (end EDIT)

After just plug in a usb and it should auto mount. 

I did manage to get a sound to play, but that was a whole other story and twice as painful as getting the usb working.

Hope it's useful to someone Big Grin
Don't miss the Doughnut by looking through the hole.
Best laid plans!. I missed an edit.


in the first section <action id="org.freedesktop.udisks2.filesystem-mount">


change to 


I did so many tests I forgot about this. If it works without it please tell me. I'm sure it was critical but I'm human and obviously make mistakes
Don't miss the Doughnut by looking through the hole.

Possibly Related Threads…
Thread Author Replies Views Last Post
  VPN for Arch Linux ARM? tk1107 5 1,179 04-27-2022, 06:23 PM
Last Post: tk1107
  Best Messaging client for pinephone? (arch-phosh) pineuser0 20 5,084 03-23-2022, 07:13 AM
Last Post: saba
  repository for arch-phosh oihantto64 7 1,006 02-27-2022, 12:28 PM
Last Post: Dan-Sun
  arch-audit oihantto64 0 270 02-03-2022, 01:26 AM
Last Post: oihantto64
  Arch image for Pinephone - where to get it? MikeMan 7 909 02-01-2022, 12:35 AM
Last Post: MikeMan
  audio services shut down after short time on arch-phosh pineuser0 3 778 01-22-2022, 01:14 PM
Last Post: elagost
  Rootkit detector for Arch Linux on PinePhone tk1107 11 2,220 01-01-2022, 12:04 PM
Last Post: tk1107
  Waydroid on Arch Linux ARM install guide? tk1107 2 1,568 12-23-2021, 10:09 AM
Last Post: tk1107
  Emulation on Pinephone UBPorts CE Running Arch Linux ARM Plasma Mobile horme7 0 453 12-12-2021, 10:29 PM
Last Post: horme7
  how to make a terminal command run as an icon in arch-phosh pineuser0 3 1,249 12-06-2021, 03:41 PM
Last Post: brb78

Forum Jump:

Users browsing this thread: 1 Guest(s)