Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: fstab alternatives for mounting external drive partition

  1. #1

    Default fstab alternatives for mounting external drive partition

    My system includes an external drive, permanently connected via USB (a Western Digital 750 MB magnetic drive in an Antec enclosure). On the KDE desktop, I access the drive either through luckyBackup (frequently) or Dolphin (infrequently).

    Until now, I have used the following entry in fstab to mount the drive:
    Code:
    LABEL=WD750  /z/WD750  ntfs  defaults,nofail 0  0
    Because the drive occasionally fails to mount during bootup, I added the "nofail" option to avoid a system hang.

    In light of deano_ferrari's comment in another thread
    Most users would just use the udisks/udev/DE mounting mechanism to detect and auto-mount USB media . . .
    [https://forums.opensuse.org/showthre...24#post2905224], I have begun to question my approach.

    If the drive mounts automatically during bootup [/dev/disk/by-label/WD750], would autofs or some other scheme be a preferable alternative to fstab?

    A brief review of the openSuSE reference manual and posts on various forums did not yield a clear answer.

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    27,347

    Default Re: fstab alternatives for mounting external drive partition

    IMHO using fstab is a correct way of doing it. You could use autofs (the old automounter) or it's new replacement systemd.automount (which again uses fstab), but why? It is always there, it should be mounted always. This is like every other file sytem use use in that system. And they are all in fstab.

    The only problem you seem to have that on boot it sometimes seems not to be available. Maybe you should address that first before going on the adventure path.

    It is possible though that the disk is a slow starter and thus not always ready at boot time mounting. Then only mounting it when needed (automounter) might help.
    To show you an example, I have one here with the following options in fstab
    Code:
    noauto,nofail,x-systemd.automount,x-systemd.mount-timeout=10,x-systemd.idle-timeout=5min
    Henk van Velden

  3. #3

    Default Re: fstab alternatives for mounting external drive partition

    Henk -

    Thank you for the reply and suggestion. I will look into the systemd.automount option.

    For now, before I boot up the machine, I'm checking the drive to see that it is in fact spinning.

    If the drive continues to work without any hiccups, I might leave well enough alone.

    Thanks again.

  4. #4
    Join Date
    Jul 2018
    Location
    Loma Linda, Mo
    Posts
    367

    Default Re: fstab alternatives for mounting external drive partition

    I too have had my USB attached drives fail to mount via /etc/fstab.
    Something since 15.1 has caused some USB drives not to be seen for up to 15 seconds after the Desktop is up.
    It does not matter if if is a rotating drive or an ssd or a nvme attached USB drive.
    My cure under MATE desktop is a startup app that runs as root and mount all my USB drives after sleeping 25 seconds. I no longer use fstab for them. This is also better because if the Desktop fails to start properly - the init 6 to reboot is much faster.

    Since it takes a while for USB drives to appear - that is my workaround for "slow to show USB drives" (I have 4 on each of my 6 machines).

    I once thought it might be that some were NTFS, some GPT, but no difference if NTFS, ext4, GPT or MSDOS. I suspect udev is waiting for them to go ready - failing and trying again after 15 seconds and repeating until successful.
    Opensuse 15.2 with VirtualBox VM's (XP, 10 & OpenSUSE 15.0)
    Pi4 with Ubuntu MATE 20.04
    Unix since 1974 (pdp-11 in "B" , Interdata 7/32 in "C") (AT&T, Tandy, Convergent, IBM, NCR, HP flavors)
    Linux since 1995 (mandrake, redhat, fedora, centos, now OpenSUSE)

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    27,347

    Default Re: fstab alternatives for mounting external drive partition

    Quote Originally Posted by larryr View Post
    My cure under MATE desktop is a startup app that runs as root and mount all my USB drives after sleeping 25 seconds.
    But that depends very much on that particular user starting in in that desktop. That might fit you, but when there are other users or when those file systems are needed by the system even without any user loged in, it is not a solution.

    I guess starting the same run from root's crontab using @reboot as the time and date fields, will circumvent these restrictions.
    Last edited by hcvv; 12-Sep-2020 at 09:22.
    Henk van Velden

  6. #6

    Default Re: fstab alternatives for mounting external drive partition

    Henk -

    After reviewing your response in post #2 above and looking at some materials discussing systemd and autofs, I am considering converting my remote autofs-mounted shares to fstab entries using the systemd options you suggested. I opted for autofs last year to avoid system hang during bootup when the remote shares were not present.

    While setting up auto.master and auto.misc was a fairly simple exercise and the arrangement works well, the advantage of sytemd would be one central location for mount assignments (in fstab).

    Do you foresee any downsides?

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    27,347

    Default Re: fstab alternatives for mounting external drive partition

    Using the systemd feature is, I think, the way of the future (like so many systemd features). Good old (since the 1970's?) auto.master, etc. is, as you say, also easy to do and I do not think it will vanish in the near future. Maybe sometime it will be deprecated, but there are so many "deprecated" features that still work after years, thus when it happens (if it will happen), you will have ample time to convert Thus it is up to you.

    I use it on an NFS mount. I had another way of mounting this (not when needed, but when available) and wanted to test systemd.automount just out of curiosity. Until now I am satisfied with it.

    To be complete, this is my fstab entry (from which I posted the relevant options above). Remark the _netdev option there:
    Code:
    boven.henm.xs4all.nl:/home/wij             /home/wij  nfs   noauto,nofail,x-systemd.automount,x-systemd.mount-timeout=10,_netdev,x-systemd.idle-timeout=5min          0  0
    Henk van Velden

  8. #8
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    2,069
    Blog Entries
    1

    Default Re: fstab alternatives for mounting external drive partition

    Quote Originally Posted by w2tq View Post
    My system includes an external drive, permanently connected via USB (a Western Digital 750 MB magnetic drive in an Antec enclosure). On the KDE desktop, I access the drive either through luckyBackup (frequently) or Dolphin (infrequently).

    Until now, I have used the following entry in fstab to mount the drive:
    Code:
    LABEL=WD750  /z/WD750  ntfs  defaults,nofail 0  0
    Because the drive occasionally fails to mount during bootup, I added the "nofail" option to avoid a system hang.

    In light of deano_ferrari's comment in another thread [https://forums.opensuse.org/showthre...24#post2905224], I have begun to question my approach.

    If the drive mounts automatically during bootup [/dev/disk/by-label/WD750], would autofs or some other scheme be a preferable alternative to fstab?

    A brief review of the openSuSE reference manual and posts on various forums did not yield a clear answer.
    Yet another alternative: Let the device notifier mount the external drive automatically and specify the mountpoint in fstab:

    Code:
    erlangen:~ # egrep 'GARMIN|FR' /etc/fstab 
    UUID=6914-84F3                             /GARMIN                 vfat   user,noauto                   0  0
    UUID=0267-906F                             /GARMIN-KART            vfat   user,noauto                   0  0
    LABEL=FR735                                /FR735                  vfat   user,noauto                   0  0
    erlangen:~ #
    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), openSUSE Tumbleweed, KDE Plasma 5

  9. #9
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    27,347

    Default Re: fstab alternatives for mounting external drive partition

    There will only be a device notitfier when some end-user is logged in.

    This is no solution if one needs the file system "for the system" (regardless if some user logged in in the GUI).
    Henk van Velden

  10. #10
    Join Date
    Jan 2014
    Location
    Erlangen
    Posts
    2,069
    Blog Entries
    1

    Default Re: fstab alternatives for mounting external drive partition

    Quote Originally Posted by hcvv View Post
    There will only be a device notitfier when some end-user is logged in.

    This is no solution if one needs the file system "for the system" (regardless if some user logged in in the GUI).
    Sure. The top post says:
    My system includes an external drive, permanently connected via USB (a Western Digital 750 MB magnetic drive in an Antec enclosure). On the KDE desktop, I access the drive either through luckyBackup (frequently) or Dolphin (infrequently).
    For doing so the solution is easy to configure and works reliably. Failure to mount will cause no system hangs.
    AMD Athlon 4850e (2009), openSUSE 13.1, KDE 4, Intel i3-4130 (2014), i7-6700K (2016), i5-8250U (2018), AMD Ryzen 5 3400G (2020), openSUSE Tumbleweed, KDE Plasma 5

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •