Artix Linux => Installation / Migration / Configuration => Topic started by: Lumenor on 02 March 2022, 13:54:17
Title: [SOLVED] Autmount with /etc/fstab not working
Post by: Lumenor on 02 March 2022, 13:54:17
Hello. I have installed Artix on my computer, and everything works great--except on boot my external drives are not being mounted. I have defined them in /etc/fstab, I am using UUIDs--perhaps the options I am using are wrong? They're ntfs drives with the following lines in /etc/fstab:
I did manage to get them working at one point, but when I reformatted a drive due to what I think was a filesystem error it stopped working.
Update: Nevermind. Just decided to create a runit service that runs "mount -a" on startup. Works as well as expected.
Title: Autmount with /etc/fstab not working
Post by: Lumenor on 02 March 2022, 16:38:05
Hello. I have installed Artix on my computer, and everything works great--except on boot my external drives are not being mounted. I have defined them in /etc/fstab, I am using UUIDs--perhaps the options I am using are wrong? They're mostly ntfs drives with the following lines in /etc/fstab:
I did manage to get them working at one point, but when I reformatted a drive due to what I think was a filesystem error it stopped working.
I did manage to automount them via a runit service that runs "mount -a" on (I think) boot, but I want to learn/know how to do this without that.
Note: I have a third device which is a USB, but I decided not to list that one since it isn't as necessary and it doesn't change much either way (I suppose).
Title: Re: Autmount with /etc/fstab not working
Post by: gripped on 02 March 2022, 18:55:38
Title: Re: Autmount with /etc/fstab not working
Post by: strajder on 02 March 2022, 19:20:12
It is generally a bad idea to automount external (removable) hard drives, to a subdirectory of /home nonetheless. Just use the mount function of your DE, or, if you aren't using a DE, mount them manually as root when you need them.
Furthermore, if an ordinary user tries to mount an NTFS filesystem, the attempt will fail with the following error message:
Unprivileged user can not mount NTFS block devices using the external FUSE library. Either mount the volume as root, or rebuild NTFS-3G with integrated FUSE support and make it setuid root. Please see more information at http://tuxera.com/community/ntfs-3g-faq/#unprivileged
So the user option has no effect.
Why are you using nofail? It does the following:
Quote
nofail Do not report errors for this device if it does not exist.
Reporting errors is very useful for diagnosing issues like the one from this thread.
Other than that, one of the main functions of /etc/fstab is exactly automounting. All filesystems which don't have the noauto option specified should be automounted, unless there were errors.
Title: Re: Autmount with /etc/fstab not working
Post by: Lumenor on 03 March 2022, 06:44:19
It is generally a bad idea to automount external (removable) hard drives, to a subdirectory of /home nonetheless. Just use the mount function of your DE, or, if you aren't using a DE, mount them manually as root when you need them.
Furthermore, if an ordinary user tries to mount an NTFS filesystem, the attempt will fail with the following error message:
Unprivileged user can not mount NTFS block devices using the external FUSE library. Either mount the volume as root, or rebuild NTFS-3G with integrated FUSE support and make it setuid root. Please see more information at http://tuxera.com/community/ntfs-3g-faq/#unprivileged
So the user option has no effect.
Why are you using nofail? It does the following:Reporting errors is very useful for diagnosing issues like the one from this thread.
Other than that, one of the main functions of /etc/fstab is exactly automounting. All filesystems which don't have the noauto option specified should be automounted, unless there were errors.
Most likely your initramfs isn't configured to load ntfs module, so it can't "see" the ntfs partitions at that stage of the boot process. Try including ntfs module in mkinitcpio.conf (https://wiki.archlinux.org/title/Mkinitcpio#Configuration) and rerunning mkinitcpio.
Title: Re: Autmount with /etc/fstab not working
Post by: Lumenor on 03 March 2022, 08:11:43
Most likely your initramfs isn't configured to load ntfs module, so it can't "see" the ntfs partitions at that stage of the boot process. Try including ntfs module in mkinitcpio.conf (https://wiki.archlinux.org/title/Mkinitcpio#Configuration) and rerunning mkinitcpio.
My thanks. One question, though, what line do I have to edit and what do I edit into it?
Title: Re: Autmount with /etc/fstab not working
Post by: Lumenor on 03 March 2022, 08:24:29
Is it ntfs3?
Title: Re: Autmount with /etc/fstab not working
Post by: strajder on 03 March 2022, 08:39:49
Module name is ntfs. Refer to the documentation for mkinitcpio (https://wiki.archlinux.org/title/Mkinitcpio).
Title: Re: Autmount with /etc/fstab not working
Post by: rayburn on 03 March 2022, 08:47:25
I had a similar problem with an external usb thumbdrive, and as a workaround I added this line to my root crontab:
Module name is ntfs. Refer to the documentation for mkinitcpio (https://wiki.archlinux.org/title/Mkinitcpio).
That's interesting. When I add that to /etc/mkinitcpio.conf it gives an error message. Something about not finding the module or something. And when I run
That's interesting. When I add that to /etc/mkinitcpio.conf it gives an error message. Something about not finding the module or something. And when I run
==> ERROR: Unable to write to /boot/initramfs-linux516-tkg-pds.img ==> ERROR: Unable to write to /boot/initramfs-linux516-tkg-pds-fallback.img ==> ERROR: Unable to write to /boot/initramfs-linux.img ==> ERROR: Unable to write to /boot/initramfs-linux-fallback.img
Title: Re: Autmount with /etc/fstab not working
Post by: Lumenor on 03 March 2022, 14:01:18
That page lists some additional troubleshooting steps if that still doesn't work.
I've applied the fix and checked the troubleshooting steps. Both troubleshooting steps don't seem to apply, and the fix unfortunately didn't really do anything. It worked before, so I don't know what exactly changed.
Title: Re: Autmount with /etc/fstab not working
Post by: Lumenor on 03 March 2022, 15:22:37
Okay. Weird thing happened. It worked after running "sudo mkinitcpio -P" and "sudo update-grub." Gonna reboot to test if the fix is persistent.
Title: Re: Autmount with /etc/fstab not working
Post by: Lumenor on 03 March 2022, 15:24:02
It isn't persistent. That is so weird. Why does it work sometimes and not other times? Is it a hardware defect?
Title: Re: Autmount with /etc/fstab not working
Post by: strajder on 03 March 2022, 18:09:09
What troubleshooting steps? What did you do? Be more specific.
Title: Re: Autmount with /etc/fstab not working
Post by: Lumenor on 05 March 2022, 12:37:39
I'm marking this as solved since it seems that reinstalling Artix fixes the issue. I am on a new installation of Artix on the same computer without the fstab configurations, but I'm sure it'll work if I configure it again (which I won't as while it may work properly I have discovered it could lead to potential issues.)
Title: Re: Autmount with /etc/fstab not working
Post by: Lumenor on 05 March 2022, 12:41:43
By the way, my apologies for the late reply strajder. To be clear, I simply didn't consider something in the wiki page applicable (iirc, as it's been a while.) All I did was add the following to /etc/udev/rules.d/ntfs3_by_default.rules:
..., but I'm sure it'll work if I configure it again (which I won't as while it may work properly I have discovered it could lead to potential issues.)
Nice. However, I still can't see what benefits you can expect when mounting filesystems from hot-plug devices using fstab.
Title: Re: Autmount with /etc/fstab not working
Post by: Lumenor on 05 March 2022, 18:17:55
It was mostly just an idea of convenience really. I don't think I'll do it again, as I think it introduced issues when it did mount the devices.