Results 1 to 2 of 2

Thread: Unmounting and remounting an external disk on reconnect

  1. #1
    Join Date
    Oct 2006
    Beans
    54

    Unmounting and remounting an external disk on reconnect

    I have a server, from which I host a few directories on an external hdd. I'd like to just yank out the disk any time I want (it's why it is external) without any prior preparation.

    - on dismount: force unmount and remove the mount point, whatever process uses it
    - on mount: mount it again

    Is dismount like this possible without crashing my server?
    I tried to write udev usb mount rules plus shell scripts (on add and remove), but:
    - for remove/dismount, a umount -l does not work and the syslog just log disk errors whenever I try to to access the drive
    - for add, mounting doesn't seem to work from the shell script. Yet after typing the command manually the mount occurs properly.

    Is there a better strategy for this?

  2. #2
    Join Date
    Apr 2014
    Beans
    668

    Re: Unmounting and remounting an external disk on reconnect

    Autofs or systemd automounting. Will only be mounted when its being actively used by the system.

Bookmarks

Posting Permissions

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