Automount external USB?

  • Hello,


    If I power on my external usb drive it will be mounted for some seconds and then unmounted.



    Code
    Jun 30 22:39:31 openmediavault ntfs-3g[4967]: Version 2012.1.15AR.5 external FUSE 29
    Jun 30 22:39:31 openmediavault ntfs-3g[4967]: Mounted /dev/sdd1 (Read-Write, label "Backup-USB", NTFS 1.2)
    Jun 30 22:39:31 openmediavault ntfs-3g[4967]: Cmdline options: rw
    Jun 30 22:39:31 openmediavault ntfs-3g[4967]: Mount options: rw,allow_other,nonempty,relatime,fsname=/dev/sdd1,blkdev,blksize=4096
    Jun 30 22:39:31 openmediavault ntfs-3g[4967]: Ownership and permissions disabled, configuration type 7
    Jun 30 22:39:41 openmediavault ntfs-3g[4967]: Unmounting /dev/sdd1 (Backup-USB)
    Jun 30 22:39:49 openmediavault monit[2900]: 'fs_media_8CDE1CAADE1C8F18' filesystem exists


    How to automount an external usb drive?


    I want to switch on and off my external usb driva via timer switch. This will be done once a week for about 2-3 hours. During this time USB Backup runs to backup my RAID to the external usb drive. After that external usb switch off by the timer switch.


    The problem is, that my usb drive will not be automatically mounted.


    Any ideas?

    • Offizieller Beitrag

    The usb backup plugin works auto mounting the drive performing the backup and unmounting the drive. It gives a sound notification when the job is finished via pc speaker(beep).


    if you don't want the plugin then you need use udev rules for auto mounting.

  • I would like to use the USB Plug-in and its auto-back-up, however, I want my back-ups to go to a sub-directory on the drive. Consequently I have tried using udev rules to create an auto-mount by using the guidance here https://www.axllent.org/docs/view/auto-mounting-usb-storage/ to create a file "/etc/udev/rules.d/11-media-by-label-auto-mount.rules" containing:



    and then reload:

    Code
    udevadm control --reload-rules


    This created something of a problem as Storage/File_Systems then gave errors, e.g.:


    Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C; mount -v '/media/22f45667-e682-4224-9f5e-818e3762e0db' 2>&1' with exit code '32': mount: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so.
    Error #0: exception 'OMV\ExecException' with message 'Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C; mount -v '/media/22f45667-e682-4224-9f5e-818e3762e0db' 2>&1' with exit code '32': mount: wrong fs type, bad option, bad superblock on /dev/sdb1, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so.' in /usr/share/php/openmediavault/system/process.inc:175 Stack trace: #0 /usr/share/php/openmediavault/system/mountpoint.inc(135): OMV\System\Process->execute() #1 /usr/share/openmediavault/engined/rpc/filesystemmgmt.inc(900): OMV\System\MountPoint->mount() #2 [internal function]: OMVRpcServiceFileSystemMgmt->mount(Array, Array) #3 /usr/share/php/openmediavault/rpc/serviceabstract.inc(124): call_user_func_array(Array, Array) #4 /usr/share/php/openmediavault/rpc/rpc.inc(84): OMV\Rpc\ServiceAbstract->callMethod('mount', Array, Array) #5 /usr/sbin/omv-engined(516): OMV\Rpc\Rpc::call('FileSystemMgmt', 'mount', Array, Array, 1) #6 {main}


    and:


    Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C; df -PT '/media/Back-Up_II' 2>&1' with exit code '1': df: '/media/Back-Up_II': Transport endpoint is not connected
    Error #0: exception 'OMV\ExecException' with message 'Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C; df -PT '/media/Back-Up_II' 2>&1' with exit code '1': df: '/media/Back-Up_II': Transport endpoint is not connected' in /usr/share/php/openmediavault/system/process.inc:175 Stack trace: #0 /usr/share/php/openmediavault/system/filesystem/filesystem.inc(614): OMV\System\Process->execute(Array) #1 /usr/share/openmediavault/engined/rpc/filesystemmgmt.inc(140): OMV\System\Filesystem\Filesystem->getStatistics() #2 [internal function]: OMVRpcServiceFileSystemMgmt->enumerateFilesystems(NULL, Array) #3 /usr/share/php/openmediavault/rpc/serviceabstract.inc(124): call_user_func_array(Array, Array) #4 /usr/share/openmediavault/engined/rpc/filesystemmgmt.inc(296): OMV\Rpc\ServiceAbstract->callMethod('enumerateFilesy...', NULL, Array) #5 [internal function]: OMVRpcServiceFileSystemMgmt->getList(Array, Array) #6 /usr/share/php/openmediavault/rpc/serviceabstract.inc(124): call_user_func_array(Array, Array) #7 /usr/share/php/openmediavault/rpc/rpc.inc(84): OMV\Rpc\ServiceAbstract->callMethod('getList', Array, Array) #8 /usr/sbin/omv-engined(516): OMV\Rpc\Rpc::call('FileSystemMgmt', 'getList', Array, Array, 1) #9 {main}


    And in WinSCP I am seeing a number of drives that make little sense.


    I have deleted the /etc/udev/rules.d/11-media-by-label-auto-mount.rules file and reloaded "udevadm control --reload-rules", but to no effect.


    Are you able to advise how I can back to the status quo and, once there, how do I create an auto-mount rule for USBs?

    OMV 4.1.8.2-1
    Rock64, 1Gb
    Logitech Media Server 7.9.2

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!