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

    Help with fstab/usbmount for USB drive

    Scheduled Pinned Locked Moved Help and Support
    usb drivemountboot
    10 Posts 4 Posters 2.4k 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.
    • pjftP
      pjft
      last edited by pjft

      Hi all,

      I have a weird dilemma here and I don't seem to be enough of a Linux expert to be able to sort this out on my own. I have just started to move to stretch using the new Pi 3B+, using the stretch image in another thread as a start. May or may not be related. Prior to this I was on Jessie on a Pi 3. Everything was flawless.

      I have always run my ROMs from a USB stick. I have my USB drive mounted via the old fstab method from the Documentation. After some iterations and debugging, this is the line that has worked for me for the past year, flawlessly.

      UUID=16FE-1C65  /home/pi/RetroPie      vfat    nofail,user,exec,noatime,umask=0000  0       2
      

      In a non-repeatable fashion now on the Pi 3B+ in stretch (may be completely unrelated) it seems that EmulationStation starts to load and try to access my mounted USB drive before it is fully mounted. That is the only reason I can find as some of the systems load properly, whereas others - the first ones (quite often "arcade", but anything up to "dreamcast" which is my 3rd system) - will be logged as (example for daphne):

       System "daphne" has no games! Ignoring it.
      

      If I restart ES after it's loaded, it'll load properly.

      If I force a delay on startup - for instance, telling the Pi to wait for network - it will load correctly, but certainly that shouldn't be necessary.

      I wonder what may be the case. I disabled usbmount to rely solely on fstab (as I was having some errors from usbmount on the boot logs), and still didn't change it.

      I also get quite often a "dirty bit set" on the USB drive even though I haven't removed it. I wonder if I should add an explicit unmount command on shutdown.

      Here are my boot logs, in case it helps:

      https://pastebin.com/Ytv3QzeF

      The only thing that stands out is that even though usbmount is disabled, it still launches and starts a check on that filesystem

      Started File System Check on /dev/disk/by-uuid/16FE-1C65
      

      and then later fstab as well. I wonder if that may be related or not.

      This exact same drive and fstab settings are working on my Pi 3 (regular) on Jessie. It can be the USB drive, certainly, but given that this only started when I moved to the 3B+ two days ago, I'm willing to explore a bit further.

      I'm using the official Pi 3 Power supply.

      Some hypotheses or thoughts that came to mind, that are likely false:

      • Maybe ES is being launched separately while the drive is being mounted?
      • Maybe the file system check locks the drive and ES can't read it.
      • Could I mount the drive and force the system to wait for the drive to be mounted?
      • Faulty drive?
      • Faulty Pi USB hub?

      Any help, suggestions, or pointers are very much appreciated.

      Thanks in advance.

      1 Reply Last reply Reply Quote 0
      • SanoS
        Sano
        last edited by Sano

        Usbmount is disabled according to the logs.
        Did you disable it by putting ENABLED=0 in /etc/usbmount/usbmount.conf ?

        Note that for a windows partition you should set the pass field to be 0 AFAIK (hence the FS check messages you have).

        This seems to be relevant :

        Mar 18 11:13:06 arcade3b systemd-fsck[474]: fsck.fat 4.1 (2017-01-24)
        Mar 18 11:13:06 arcade3b systemd-fsck[474]: /dev/sda1: 23523 files, 1904670/1928934 clusters
        Mar 18 11:13:06 arcade3b systemd[1]: Started File System Check on /dev/disk/by-uuid/16FE-1C65.
        Mar 18 11:13:06 arcade3b systemd[1]: home-pi-RetroPie.mount: Directory /home/pi/RetroPie to mount over is not empty, mounting anyway.
        Mar 18 11:13:06 arcade3b systemd[1]: Mounting /home/pi/RetroPie...
        

        Could you umount /home/pi/Retropie and verify what's in the folder when the USB key is unmounted ? It should be empty.

        1 Reply Last reply Reply Quote 1
        • pjftP
          pjft
          last edited by

          Hi @Sano , thanks for taking a stab at it.

          Indeed, that is how I disabled usbmount. Still, the logs suggest it's being started on demand, or am I misreading them? Would there be a better or different way to disable it, if needed? I wonder if it's that service start time that is causing that.

          Mar 18 16:32:19 arcade3b systemd[1]: Starting usbmount@dev-sda.service...
          Mar 18 16:32:19 arcade3b usbmount[469]: usbmount is disabled, see /etc/usbmount/usbmount.conf
          Mar 18 16:32:19 arcade3b systemd[1]: Started usbmount@dev-sda.service.
          Mar 18 16:32:19 arcade3b systemd[1]: Found device Silicon-Power64G RETROPIE64.
          Mar 18 16:32:19 arcade3b systemd[1]: Starting usbmount@dev-sda1.service...
          Mar 18 16:32:19 arcade3b systemd[1]: Mounting /home/pi/RetroPie...
          Mar 18 16:32:19 arcade3b usbmount[475]: usbmount is disabled, see /etc/usbmount/usbmount.conf
          Mar 18 16:32:19 arcade3b systemd[1]: Started usbmount@dev-sda1.service.
          Mar 18 16:32:19 arcade3b systemd[1]: Mounted /home/pi/RetroPie.
          

          In regards to the folder not being empty, that is indeed the case - though it also was on the original Jessie set up. It has the original subfolders structure (roms/<systems>, BIOS, retropiemenu and splashscreen) but they don't have any meaningful content. I just removed it from it, though. That in particular didn't seem to make a difference.

          I wasn't aware of the recommendation for the pass field to be 0 if it's FAT32, but I'm happy to give it a shot. Realistically what that'll result in it not running the fsck commands, but it seems to be working as intended so far.

          Weird. :)

          Any further thoughts?

          Thank you.

          SanoS 1 Reply Last reply Reply Quote 0
          • SanoS
            Sano @pjft
            last edited by

            @pjft You can try to uninstall usbromservice from retropie setup.
            According to the source, this will remove the usbmount package.
            This way we'll be sure that it's not the issue.

            pjftP 1 Reply Last reply Reply Quote 2
            • pjftP
              pjft @Sano
              last edited by

              @sano Thank you!

              I did it and indeed it removed usbmount for good.

              That being said, moving fstab pass to 2 brought the symptoms back, so I'm leaving it at zero now.

              I'll stay with it for now - thank you very much for pointers and looking into this!

              Hope you're doing well.

              cyperghostC 1 Reply Last reply Reply Quote 1
              • cyperghostC
                cyperghost @pjft
                last edited by cyperghost

                @pjft Even if this method is dirty and not recommended. I use symlinks since the first installation and I'm good with this. So ~/RetroPie/roms points to /media/usb0/roms on a FAT32 device.

                So I did also with my savegame folder and my BackGroundMusic ;)

                @Sano Thank you for elaborating this out.

                pjftP 1 Reply Last reply Reply Quote 1
                • pjftP
                  pjft @cyperghost
                  last edited by

                  @cyperghost interesting. Any considerations or drawbacks to this specific method? I mean, you're obviously auto mounting the drive anyway, why not mounting on the expected path instead?

                  Just curious.

                  Thank you!

                  cyperghostC 1 Reply Last reply Reply Quote 0
                  • cyperghostC
                    cyperghost @pjft
                    last edited by

                    @pjft Well it works with Mame, NES, N64, PSX.... and PORTS (doom, quake)
                    I never used SCUMMVM, DOSBOX, Amiga so I can't say this will work in general.

                    Surly there are drawbacks. But I think it's not about the symlink. I think it's rather the FAT32 format because it has no user and right managment. So to execute shell files for example you need to execute via bash myscript.sh or sh myscript.sh

                    1 Reply Last reply Reply Quote 1
                    • darkniorD
                      darknior
                      last edited by

                      @pjft said in Help with fstab/usbmount for USB drive:

                      In a non-repeatable fashion now on the Pi 3B+ in stretch (may be completely unrelated) it seems that EmulationStation starts to load and try to access my mounted USB drive before it is fully mounted. .......
                      If I restart ES after it's loaded, it'll load properly.

                      Some time i have exactly the same problem on my PI3, with my USB 1To hard drive, but it's very rare.
                      Like you i only restart ES and it's fine :)
                      If you found a solution to tell ES to stand mount service was done before loading, i would like to know and try it :)
                      And maybe it can be cool to add it to Retropie for every one.

                      I also use symbolic links like @cyperghost for PORTS. I don't want to let them take place on my SD and move them to USB with symbolic links and it works perfectly.
                      The only problem in FAT32 was the RIGHT management. There is no right to launch bash :(
                      I don't know i can also do bash myscript.sh or sh myscript.sh, i will try it.

                      Finally the auto Retropie mount is fine for me and i use it, but i make many test before and i found this command that let me mount my FAT32 hard drive and launch .SH with it.

                      UUID=E44B-FC4E /home/pi/RetroPie vfat rw,exec,uid=pi,gid=pi,umask=022 0 2

                      I made it for OpenBOR last year, but now i have modify OpenBOR source code to launch games with command line i don't use it any more.

                      Life is game, just play it !

                      cyperghostC 1 Reply Last reply Reply Quote 1
                      • cyperghostC
                        cyperghost @darknior
                        last edited by cyperghost

                        @darknior @pjft
                        Oh... one thing that could go wrong with the symbolic link method.
                        If you insert two USB devices at the same time then the naming could get wrong. Means that /mount/usb0 is not always Device 1
                        and /mount/usb1 is not always Device 2. They can change, so working with fstab and giving the devices their unique numbering is better. But the symlink is imho the fastest way ...
                        need to say: it is not supported by official intructions!!

                        The bash myscript.sh is working for ES because it is setted in es_systems.cfg since RetroPie 4.0

                        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.