RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Usb automount not working

    Scheduled Pinned Locked Moved Help and Support
    usbautomount
    9 Posts 2 Posters 4.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      deisi
      last edited by

      I can't get the retropi usb automount to work on raspberri pi 4 debian buster manual installation.

      The Setup

      • raspberri pi 4
      • Retropi master branch c7a3d0dabb593b6965b8c764ab9f4576432bcb3b (4.6)
      • Raspbian buster
      • usbmount (installed and set up manually. https://retropie.org.uk/docs/Running-ROMs-from-a-USB-drive/ is lacking some information here. Once this here works I would volunteer to add some notes to the documentation. It basically comes down to add https://raspberrypi.stackexchange.com/questions/100312/raspberry-4-usbmount-not-working and in particular change to PrivateMounts=no in /lib/systemd/system/systemd-udevd.service)
      • lsblk shows that usb mounting is working as the usb device is mounted on /media/usb0
      • USB stick is formatted to FAT
      • There is a folder /media/usb0/retropie-mount/ and it is empty. However I'm not sure about the user rights. Its currently drwxr-xr-x 2 root root 16K May 3 21:52 retropie-mount Do I need to mount this as user pi? If yes. Documentation is lacking this as well.

      Accoding to e.g. https://retropie.org.uk/forum/topic/21706/having-trouble-running-roms-from-usb-using-automount/12?_=1588603965478 there should be a systemd service: Usbmount@dev-sda.service however this doesn't exist on my setup.

      1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator
        last edited by mitu

        Stupid question, but did you reboot after enabling the service ? I already had usbmount installed, but it was disabled, after enabling it and inserting the USB with a retropie-mount folder, rsync kicked in and started to copy over the ROMs/BIOS/splashscreen.

        ps -ef | grep `rsync`
        rsync -rtu /home/pi/RetroPie/ /media/usb0/retropie-mount/
        

        EDIT: After copying all the necessary files, the usbmount mounted the retropie-mount over the existing RetroPie folder, no restart required.

        The systemd service is created when you insert the USB stick, based on the udev rules added by usbromservice:

        sudo systemctl status usbmount@dev-sda1.service
        ā— usbmount@dev-sda1.service
           Loaded: loaded (/lib/systemd/system/usbmount@.service; static; vendor preset: enabled)
           Active: active (exited) since Mon 2020-05-04 17:28:25 BST; 2min 59s ago
          Process: 885 ExecStart=/usr/share/usbmount/usbmount add (code=exited, status=0/SUCCESS)
         Main PID: 885 (code=exited, status=0/SUCCESS)
        
        May 04 17:14:43 pie4 systemd[1]: Starting usbmount@dev-sda1.service...
        May 04 17:14:48 pie4 usbmount[920]: executing command: mount -tvfat -onodev,noexec,noatime,uid=1000,gid=1000 dev/sda1 /media/usb0
        May 04 17:14:48 pie4 usbmount[928]: executing command: run-parts /etc/usbmount/mount.d
        May 04 17:14:48 pie4 usbmount-10_retropie_mount-[942]: Copying existing /home/pi/RetroPie to /media/usb0/retropie-mount ...
        May 04 17:28:25 pie4 usbmount-10_retropie_mount-[1204]: Mounting /media/usb0/retropie-mount over /home/pi/RetroPie ...
        May 04 17:28:25 pie4 systemd[1]: Started usbmount@dev-sda1.service.
        
        1 Reply Last reply Reply Quote 0
        • D
          deisi
          last edited by

          Stupid question, but did you reboot after enabling the service ?

          yep multiple times.

          I already had usbmount installed

          As I used debain-lite it is not installed by default.

          rsync kicked in and started to copy over the ROMs/BIOS/splashscreen

          year that is what is not happening for me. But good to know its rsync based.

          sudo systemctl status usbmount@dev-sda1.service

          That's basically the thing. This service is not installed for me. Can it be that it got removed from the install script?

          1 Reply Last reply Reply Quote 0
          • D
            deisi
            last edited by deisi

            I guess https://github.com/RetroPie/RetroPie-Setup/blob/master/scriptmodules/supplementary/usbromservice.sh is the script that actually installes the usbmount systemd service. It also installes usbmount. So for some reason this script never ran for me. Its basically this function that does so. https://github.com/RetroPie/RetroPie-Setup/blob/master/scriptmodules/supplementary/usbromservice.sh#L25

            Question now is, why did this never run for me.

            EDIT
            Aha, usbrom service is an optional part of retropi. Apparently it seems I never installed it and thus it is not working. I will enable it and see again.

            mituM 1 Reply Last reply Reply Quote 0
            • mituM
              mitu Global Moderator @deisi
              last edited by mitu

              As I used debain-lite it is not installed by default.

              I meant I installed it from RetroPie-Setup, as a package.

              Aha, usbrom service is an optional part of retropi. Apparently it seems I never installed it and thus it is not working. I will enable it and see again.

              When you said you installed it and set-up, I understood you did it from RetroPie-Setup. You need to do it from there, since it installs also the necessary scripts.

              1 Reply Last reply Reply Quote 0
              • D
                deisi
                last edited by deisi

                @mitu said in Usb automount not working:

                When you said you installed it and set-up, I understood you did it from RetroPie-Setup

                Well I did, but quite a while ago and from raspberry pi 4 alpha branch or what ever it was called. However usbromservice is part of the opt packages, so I assume they are not installed by default from the installer. Instead one hast to specifically install them. Correct me if I'm wrong.

                I now ran the installer again and updted everything usbromservice is not getting installed. I will now install manually from the opt packages. I think documentation about this should be updated.

                mituM 1 Reply Last reply Reply Quote 0
                • mituM
                  mitu Global Moderator @deisi
                  last edited by mitu

                  @deisi That's correct, if you manually install and do a basic install, it's not installed by default. The image provided though, has it installed.

                  1 Reply Last reply Reply Quote 0
                  • D
                    deisi
                    last edited by deisi

                    Okay, I see. That explains it. However I installed it with retropi-setup script and now it doesn't mount the usb stick properly any more....
                    lsblk shows nothing and I see:

                    pi@retropi:~ $ sudo systemctl status usbmount@dev-sda1.service
                    ā— usbmount@dev-sda1.service
                       Loaded: loaded (/lib/systemd/system/usbmount@.service; static; vendor preset: enabled)
                       Active: failed (Result: exit-code) since Mon 2020-05-04 21:22:49 CEST; 3min 31s ago
                      Process: 374 ExecStart=/usr/share/usbmount/usbmount add (code=exited, status=32)
                     Main PID: 374 (code=exited, status=32)
                    
                    May 04 21:22:43 retropi systemd[1]: Starting usbmount@dev-sda1.service...
                    May 04 21:22:49 retropi systemd[1]: usbmount@dev-sda1.service: Main process exited, code=exited, status=32/n/a
                    May 04 21:22:49 retropi systemd[1]: usbmount@dev-sda1.service: Failed with result 'exit-code'.
                    May 04 21:22:49 retropi systemd[1]: Failed to start usbmount@dev-sda1.service.
                    
                    
                    

                    Found it. Its because during experimenting i changed the usb stick to ext4. Now in this case, the default /etc/usbmount/usbmount.conf is invalid. the uid=1000and gid=1000 statement must be removed from the MOUNTOPTIONS.

                    Its a bit irritating, as /etc/usbmount/usbmount.conf contains the line FILESYSTEMS="vfat ext2 ext3 ext4 hfsplus ntfs exfat" but the way MOUNTOPTIONS are set, only vfat and ntfs are actually supported, as all others will fail to mount.

                    And for reference this journalctl lines brought me on the right track:

                    May 04 21:26:52 retropi kernel: EXT4-fs (sda1): Unrecognized mount option "uid=1000" or missing value
                    May 04 21:26:52 retropi systemd[1]: usbmount@dev-sda1.service: Main process exited, code=exited, status=32/n/a
                    May 04 21:26:52 retropi systemd[1]: usbmount@dev-sda1.service: Failed with result 'exit-code'.
                    May 04 21:26:52 retropi systemd[1]: Failed to start usbmount@dev-sda1.service.
                    
                    mituM 1 Reply Last reply Reply Quote 0
                    • mituM
                      mitu Global Moderator @deisi
                      last edited by mitu

                      @deisi said in Usb automount not working:

                      Its a bit irritating, as /etc/usbmount/usbmount.conf contains the line FILESYSTEMS="vfat ext2 ext3 ext4 hfsplus ntfs exfat" but the way MOUNTOPTIONS are set, only vfat and ntfs are actually supported, as all others will fail to mount.

                      Hm, that may actually be a bug. Let me re-test and maybe we can correct this.

                      Thanks for testing.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post

                      Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                      Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.