Announcement

Collapse
No announcement yet.

Mounting USB drives - mount command vs fstab

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [RESOLVED] Mounting USB drives - mount command vs fstab

    Context:
    I have USB stick always plugged into my docking station which I use for backing up photos and documents and such.

    Kubuntu has multiple ways to mount this drive:

    1 - I can tell it to mount all drives automatically via the System Settings

    2 - I can use the `mount` command in bash (which is what I did)

    3 - I can put a line in /etc/fstab


    What is the practical difference between option 2 versus option 3 and when should one be preferred over the other?
    Last edited by TwoFistedJustice; May 08, 2023, 05:28 PM.

    #2
    Don't forget 1.a - mount selected devices on attach/login (or not to do so) to override settings per-device.
    fstab is primarily for permanent sorts of mounts - internal drives, network shares, and the like.
    It is also easier to set specific mount options than using a manual mount command.

    Plasma's automount is ideal for removable drives that get regularly removed from the system - including things attached to docking stations, if the laptop or device routinely is removed from it.
    Using the fstab iirc can be used for removable drives or any situation where the computer and that drive are regularly disconnected, but it may be more effort than it is worth to tweak things until you have it set up well.

    But basically, use whatever method you want, and/or works best for you.

    Comment


      #3
      Originally posted by TwoFistedJustice View Post
      Context:
      I have USB stick always plugged into my docking station which I use for backing up photos and documents and such.
      […]
      The important word for me here is "always".

      Therefore I (personally) would not use option "2" (I would be too lazy ), but make an entry in fstab - either to have it already automatically mounted in Dolphin or to have it available there at a mouse click - whichever option suits your use case best.

      Don't forget to include the "nofail" option in fstab, though, just in case you did not plug in the USB stick before you booted your computer.
      Last edited by Schwarzer Kater; Apr 14, 2023, 03:57 PM.
      Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
      Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others

      get rid of Snap scriptreinstall Snap for release-upgrade scriptinstall traditional Firefox script

      Comment


        #4
        Originally posted by Schwarzer Kater View Post

        The important word for me here is "always".

        Therefore I (personally) would not use option "2" (I would be too lazy ), but make an entry in fstab - either to have it already automatically mounted in Dolphin or to have it available there at a mouse click ...
        So the weird thing is that I used option 2. I had it mount /dev/sdb or sdb1 (don't remember) to a folder I created. And now the drive just always shows up in Dolphin. I even deleted the folder I told it to mount to, and it still shows up. (it did one time flash an error because the folder was gone)

        Comment


          #5
          You probably have the automount option enabled for the drive in System Settings
          Easiest way if you don't want to get your hands dirty in CLI (door number "1" ).
          Last edited by Schwarzer Kater; Apr 15, 2023, 04:27 PM.
          Debian KDE & LXQt • Kubuntu & Lubuntu • openSUSE KDE • Windows • macOS X
          Desktop: Lenovo ThinkCentre M75s • Laptop: Apple MacBook Pro 13" • and others

          get rid of Snap scriptreinstall Snap for release-upgrade scriptinstall traditional Firefox script

          Comment


            #6
            Originally posted by Schwarzer Kater View Post
            You probably have the automount option enabled for the drive in System Settings
            ...
            Looks like that is the case. Only it wasn't I who checked the box. Must have done it automatically when I called mount in konsole.

            Click image for larger version

Name:	removeable drives.png
Views:	110
Size:	28.5 KB
ID:	670069

            Comment

            Working...
            X