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?

  • EvilCartyen@feddit.dkOP
    link
    fedilink
    arrow-up
    8
    arrow-down
    3
    ·
    5 months ago

    Yanked out the cable like a medieval surgeon ;) Anyway, since I removed it from fstab I figured it was unmounted.

    • communism@lemmy.ml
      link
      fedilink
      arrow-up
      9
      ·
      5 months ago

      fstab tells the system what to mount on boot; it doesnt live reload! In future to unmount something do:

      sudo umount /path/to/mountpoint
      

      This command also works for something in your fstab, because fstab is only relevant during boot.

    • MentalEdge
      link
      fedilink
      arrow-up
      6
      ·
      edit-2
      5 months ago

      Don’t do that.

      fstab is just a config file so the computer knows what drives and storage volumes its supposed to have when it boots.

      You can add and remove drives without ever editing fstab. Plugging something in should give you the option to mount it in your file explorer, and in the same place you should be able to “eject” it before disconnecting the actual cable.

      • EvilCartyen@feddit.dkOP
        link
        fedilink
        arrow-up
        5
        ·
        5 months ago

        Don’t do that.

        Coming from non-linux, it’s not usually a problem. But now I know better :)

        fstab is just a config file so the computer knows what drives and storage volumes its supposed to have when it boots.

        You can add and remove drives without ever editing fstab. Plugging something in should give you the option to mount it in your file explorer, and in the same place you should be able to “eject” it before disconnecting the actual cable.

        I know that, but this particular drive was meant to be permanently mounted and accessible, which is why I added it to fstab. I am removing it because it’s damaged and i have to replace it with something which isn’t to act as a permanent drive for the server.

        Thank you for your help :)

        • MentalEdge
          link
          fedilink
          arrow-up
          1
          ·
          edit-2
          5 months ago

          It was always a problem. On all systems.

          Filesystems are resilient, but one that is actually designed to reliably survive being physically disconnected without warning, does not exist.

          Windows has always had a “make safe to unplug” button, too.

          Not that it matters if you were discarding the drive.

          • EvilCartyen@feddit.dkOP
            link
            fedilink
            arrow-up
            1
            arrow-down
            1
            ·
            5 months ago

            I mean, yes. But on the other hand, I’ve removed usb-connected media without using that button thousands of times and never had an issue. I’m obviously not doing it when I am writing to or reading from the medium.

            Either way, thanks again for taking the time to respond :)

            • MentalEdge
              link
              fedilink
              arrow-up
              3
              arrow-down
              1
              ·
              5 months ago

              Yes, and every single time, it was because filesystems have ways to recover when things go wrong.

              But make no mistake, things went wrong. Every time. Even if no files were damaged, the next system accessing the volume would run into a file system that wasn’t exited properly.

              And while “never do it while it’s being accessed” improves your chances, due to write caching you can’t actually know if the medium is still writing or reading. Or internally in the middle of a process organising data structures. Or being checked for damage by a background process because the filesystem was flagged for repair due to inconsistencies. Or in the case of spinning rust, in the middle of a background defrag. Or in the case of flash storage in the middle of a trim.

              If you have a forgiving boss you could tell him “fuck you” to his face every morning… But why would you? Maybe one morning he’ll be cranky, and that one time he’ll take offence and actually fire you.