I have very little experience with linux, so maybe this is a dumb question :)

I run Ubuntu 24.04 on a machine, and I had an old HDD in a usb-case which I mounted using fstab. Worked fine, but I decided it wasn’t appropriate for my purpose and removed it (physically and from fstab).

But it still shows up in the file manager? What am I missing?

  • ElderWendigo@sh.itjust.works
    link
    fedilink
    arrow-up
    6
    arrow-down
    5
    ·
    edit-2
    5 months ago

    With all due respect, RTFM. Mount and umount are two sides of the same operational coin. You mount the drive to use it and unmount it when you’re done. fstab is just a file system table used to remember and consistently apply the options used whether you’re mounting the drives manually or telling the system to do it at boot.

    Deleting a line from fstab is not the same as unmounting, it is just a shortcut to tell the system how you want that drive mounted when you or the system run the mount command. Mount directories (usually the folders in /media/ or /mnt/ ) also do not get automatically deleted just because you “yanked the drive”. Again, those directories are just where your system is expecting to mount the drive. When the drive is mounted they will be the root path to its contents, when the drive is unmounted they will be empty but they still exist. If your planning on mounting the drive again leave them there. If you’re not planning on mounting them again, delete them.

    If you’re not planning on regularly mounting a particular drive, it probably shouldn’t be listed in fstab and you should just run the mount command with the appropriate options (again fstab is just a table for remembering those options for the mount command).

    Many desktop Linux distros are also capable of automatically mounting new removable drives in such a way that the user can access them and doesn’t have to worry about touching fstab or the mount directories.

    • EvilCartyenOP
      link
      fedilink
      arrow-up
      8
      ·
      5 months ago

      Thanks. I don’t mind reading manuals at all, but is this not a community for asking questions?

      • ElderWendigo@sh.itjust.works
        link
        fedilink
        arrow-up
        2
        arrow-down
        2
        ·
        5 months ago

        For me at least, it’s not that you’re asking questions. I answered, so obviously I’m sympathetic to confusion in this area. I’m just trying to encourage you to seek your answers in the documentation and manuals FIRST. The way your question was worded led me to believe that you had not read the manuals at all and were simply copying snippets of code and commands from some random question and answer style forum that did not teach you anything about the fundamentals of what those commands and code actually did. That’s fine too, lots of people started off that way, myself included. Reading the manuals gives you the context to step back and understand how those commands work and what they’re really doing. If you do, you’ll be much better able to troubleshoot your own problems, you’ll be able to ask better questions in forums like this, and you’ll get better and more useful responses.

        • EvilCartyenOP
          link
          fedilink
          arrow-up
          3
          ·
          5 months ago

          Sure, I mean I am used to reading (and writing) manuals and documentation, so I usually go that route first when I know where to look. And your answer was helpful. Anyway, what are some authoritative ressources I should consult concerning these fundamental concepts?

          • ElderWendigo@sh.itjust.works
            link
            fedilink
            arrow-up
            2
            arrow-down
            2
            ·
            5 months ago

            Start with the man pages. Running the command man followed by a space and then followed by the command you’re using will almost always give you a man page of the basics of how that command works. The fstab has its own man page too. An internet search “man fstab” or whatever command you’re interested in should also net many mirrors of the those man pages as well.