How to mount exfat USB drive

Tagged: 

  • This topic has 30 replies, 7 voices, and was last updated Sep 3-10:06 am by symbol.
Viewing 15 posts - 16 through 30 (of 31 total)
  • Author
    Posts
  • #64201
    Forum Admin
    anticapitalista

      @namida12 – this is one thing that I hope will work out of the box with the final release of antiX-21.

      We clearly have some work to do.

      Philosophers have interpreted the world in many ways; the point is to change it.

      antiX with runit - leaner and meaner.

      #64206
      Member
      Xecure

        Does this require a udevil rule? Does antiX auto-mounting use udevil to mount the devices?

        If you reconfigure udevil with
        sudo sed -i '/exfat/s/, nonempty//g' /etc/udevil/udevil.conf
        Wait a minute and replug the exfat drive. It works on kernel 5.10. Will test in a bit on 21b1 on liveUSB.

        antiX Live system enthusiast.
        General Live Boot Parameters for antiX.

        #64214
        Member
        Xecure

          OK. I got exfat to work on antiX21b1 live USB with both kernels 5.10 and 4.9.

          We need 2 things:
          1. Remove the “nonempty” option for all exfat entries in /etc/udevil/udevil.conf (as I pointed out in the previous post). This has mounting of exfat work out of the box on kernel 5.10 (exfat support was included in the kernel since version 5.7).
          2. For kernel 4.9, we need the exfat-linux package, which will compile the module for each kernel (conflicts with exfat-fuse). I installed a .deb built for ubuntu and it works. It builds the exfat-linux module for kernel 4.9 (using dkms, so each new kernel installed will also trigger the dkms instruction to build this module) on the live system and starts working almost immediately. Issues: it will also try to build the module for the 5.10 kernel and fail (there must be a way to give the dkms instruction a rule to ignore all kernels with a higher version than 5.7). It also removes exfat-fuse (no longer needed).

          This is as far as my investigations go. The ubuntu package source for exfat-linux can be used as a template for building a debian package, but needs some extra options to limit the kernel versions that would trigger the dkms module build.

          antiX Live system enthusiast.
          General Live Boot Parameters for antiX.

          #64265
          Forum Admin
          anticapitalista

            I tried with 5.10.52 kernel on antiX buster.

            Made an exfat usb device via gparted.
            Removed the “nonempty” option for all exfat entries in /etc/udevil/udevil.conf
            Device now recognised and mounts under /media, but I get permissions errors when trying to copy a file to it as user.

            Almost there …

            Philosophers have interpreted the world in many ways; the point is to change it.

            antiX with runit - leaner and meaner.

            #64266
            Member
            Xecure

              Device now recognised and mounts under /media, but I get permissions errors when trying to copy a file to it as user.

              You probably need exfatprogs instead of exfat-utils.
              EDIT: All I wrote in this reply was wrong. exfatprogs is not used for writing to the device. Sorry for the mistake.
              See if removing exfat-fuse helps (so it doesn’t conflict with the kernel module).

              • This reply was modified 2 years, 10 months ago by Xecure.

              antiX Live system enthusiast.
              General Live Boot Parameters for antiX.

              #64274
              Forum Admin
              anticapitalista

                This seems to work on antiX-19 buster with a 5.10 kernel.

                If you already have an exfat formatted usb device

                sudo apt purge exfat-fuse

                Edit line 224 of /etc/udevil/udev.conf to look like this:

                default_options_exfat = nosuid, noexec, nodev, noatime, uid=1000, gid=1000

                Also edit line 255 to look like this (not sure if this is needed)

                allowed_options_exfat = nosuid, noexec, nodev, noatime, fmask=0133, dmask=0022, uid=1000, gid=1000, umask=0077, namecase=*, ro, rw, sync, flush, iocharset=*, remount, nonempty

                Wait a few seconds and plug in usb device.

                Philosophers have interpreted the world in many ways; the point is to change it.

                antiX with runit - leaner and meaner.

                #64280
                Member
                Xecure

                  Probably the default_options you set are enough, as the others would make it so that if not UID=1000 or GID=1000, you could not configure it at all (not allowed).

                  I can tell you that on live-USB antiX21b1 amd64, I didn’t need to set UID or GID as a specific user (not for default or allowed options). If you don’t set it up, you cannot write to the drive at all?

                  antiX Live system enthusiast.
                  General Live Boot Parameters for antiX.

                  #64292
                  Forum Admin
                  anticapitalista

                    The second change isn’t needed.

                    For my sid tests, I needed to add the first change otherwise it wouldn’t write to the drive.

                    Philosophers have interpreted the world in many ways; the point is to change it.

                    antiX with runit - leaner and meaner.

                    #64294
                    Member
                    Xecure

                      For my sid tests, I needed to add the first change otherwise it wouldn’t write to the drive.

                      The change seems to work here too, so all is well.
                      Now the real test is if this configuration still works in 4.9 kernel and 4.19 on antiX19. I will test it out later today, probably build first the exfat-linux package.

                      antiX Live system enthusiast.
                      General Live Boot Parameters for antiX.

                      #64296
                      Forum Admin
                      anticapitalista

                        I tried on antiX-19 with the latest 4.9 kernel.
                        I removed exfat-fuse and installed the Ubuntu deb for exfat-linux.
                        It successfully created a .ko file, but no luck with the exfat usb device.
                        It isn’t even seen. (I rebooted as well, but no luck).

                        Philosophers have interpreted the world in many ways; the point is to change it.

                        antiX with runit - leaner and meaner.

                        #64298
                        Member
                        Xecure

                          Success for me on my installed (real hardware, non-VM) antiX 19.2(fully updated). I changed the /etc/udevil/udevil.conf file as you suggested (only the defaults, not the allowed).
                          I removed exfat-fuse.
                          Built the exfat-dkms package for buster (See attached). Installed and forced dkms install on kernels 4.9 and 4.19.

                          From spacefm, I can mount, unmount, read and write. I set automount and when I connect the device, it automounts after a few seconds. Tested for both kernel 4.9 (4.9.212-antix.1-amd64-smp, a bit old, but I normally only use kernel 5.10) and 4.19 (4.19.198-antix.1-amd64-smp).

                          Could anyone else test with the attached package on a system with kernel 4.9-4.19?

                          antiX Live system enthusiast.
                          General Live Boot Parameters for antiX.

                          #64303
                          Forum Admin
                          anticapitalista

                            Success this time running antiX-19 (fully updated) frugal install.
                            Same as Xecure re SpaceFM (need to test with zzzFM).
                            For rox, I needed to run devmon (in a terminal) and then it automounts.
                            So I’ll need to make some changes to the automount script in /usr/local/bin I guess.

                            (Thinking aloud so I don’t forget) So we’ll need a patched udevil package and some way to make sure the exfat-dkms package limits itself to 4.x series kernels.

                            Looking good!

                            Philosophers have interpreted the world in many ways; the point is to change it.

                            antiX with runit - leaner and meaner.

                            #64306
                            Member
                            Xecure

                              Success this time running antiX-19 (fully updated) frugal install.

                              That’s great.

                              It also auto-mounts for me on zzzfm (back in 21b1 right now).
                              Now that we are at it, I will open a thread asking for problematic experience with other partition formats so we can fix them all in one go.

                              some way to make sure the exfat-dkms package limits itself to 4.x series kernels.

                              EDIT2:
                              I creating this rule (kernels 4.9-5.6) in debian/exfat-dkms.dkms:
                              BUILD_EXCLUSIVE_KERNEL="^((5\.[0-6])|(4\.(9|[12][0-9]|30)))"
                              And it works (I cannot install it for kernel version 4.4 or 5.8, 5.10), but it first attempts to build for the current kernel (5.10) and suddenly stops and doesn’t build for the other kernels installed. Is there a special trick needed? An extra option to force to check each installed kernel even when it skips the first one?

                              • This reply was modified 2 years, 10 months ago by Xecure.
                              • This reply was modified 2 years, 10 months ago by Xecure. Reason: Edit related to BUILD_EXCLUSIVE_KERNEL option

                              antiX Live system enthusiast.
                              General Live Boot Parameters for antiX.

                              #64335
                              Member
                              Xecure

                                When trying to mount exfat as root, because root is not UID=1000, mounting fails.
                                The solution is changing the allowed_options for exfat UID=*, GID=* to allow all.

                                I was experimenting a bit with ntfs and it is the same. If you change the default from $UID to 1000, then any user not UID=1000 cannot mount the device.

                                The default in udevil.conf is
                                allowed_users = *
                                So, if nobody changes this parameter, UID=$UID is the same as UID=*. Is the allowed_users value different on sid?

                                antiX Live system enthusiast.
                                General Live Boot Parameters for antiX.

                                #89573
                                Member
                                eckoson

                                  I was running a flesh install of antiX 21 on a 32bit system And I couldn’t mount exfat drives. Gparted reported that exfatprogs is missing. I did apt-update && apt-upgrade but I still couldn’t mount even though exfat-utils and exfat-dkms were present. I got an error message: “unknown file system ‘exfat'”. Following this thread, I learnt that, it’s about the kernel, so I updated from 4.9 to 5.10 and now everything is working fine. Thanks for your contributions.

                                Viewing 15 posts - 16 through 30 (of 31 total)
                                • You must be logged in to reply to this topic.