Error when deleting shared folder

    • OMV 4.x
    • Resolved

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Error when deleting shared folder

      Only a while after removing a broken external disk, I wanted to clean up the configuration. Removed sharing from services/SMB, then wanted to delete the shared folder (to be able to remove the disk). When selecting delete ("Löschen") and applying I received a popup with the following content:

      Source Code

      1. Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C; systemctl start 'sharedfolders-Elements.mount' 2>&1' with exit code '4': Failed to start sharedfolders-Elements.mount: Access deniedSee system logs and 'systemctl status sharedfolders-Elements.mount' for details.
      2. Fehler #0:
      3. OMV\ExecException: Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C; systemctl start 'sharedfolders-Elements.mount' 2>&1' with exit code '4': Failed to start sharedfolders-Elements.mount: Access denied
      4. See system logs and 'systemctl status sharedfolders-Elements.mount' for details. in /usr/share/php/openmediavault/system/process.inc:175
      5. Stack trace:
      6. #0 /usr/share/php/openmediavault/system/systemctl.inc(86): OMV\System\Process->execute(Array, 4)
      7. #1 /usr/share/php/openmediavault/system/systemctl.inc(104): OMV\System\SystemCtl->exec('start', NULL, false)
      8. #2 /usr/share/openmediavault/engined/module/sharedfolders.inc(59): OMV\System\SystemCtl->enable(true)
      9. #3 /usr/share/openmediavault/engined/rpc/config.inc(194): OMVModuleSharedfolders->startService()
      10. #4 [internal function]: OMVRpcServiceConfig->applyChanges(Array, Array)
      11. #5 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)
      12. #6 /usr/share/php/openmediavault/rpc/serviceabstract.inc(149): OMV\Rpc\ServiceAbstract->callMethod('applyChanges', Array, Array)
      13. #7 /usr/share/php/openmediavault/rpc/serviceabstract.inc(565): OMV\Rpc\ServiceAbstract->OMV\Rpc\{closure}('/tmp/bgstatusJd...', '/tmp/bgoutputEj...')
      14. #8 /usr/share/php/openmediavault/rpc/serviceabstract.inc(159): OMV\Rpc\ServiceAbstract->execBgProc(Object(Closure))
      15. #9 /usr/share/openmediavault/engined/rpc/config.inc(213): OMV\Rpc\ServiceAbstract->callMethodBg('applyChanges', Array, Array)
      16. #10 [internal function]: OMVRpcServiceConfig->applyChangesBg(Array, Array)
      17. #11 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)
      18. #12 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('applyChangesBg', Array, Array)
      19. #13 /usr/sbin/omv-engined(536): OMV\Rpc\Rpc::call('Config', 'applyChangesBg', Array, Array, 1)
      20. #14 {main}
      21. [b][/b][i][/i][u][/u][sub][/sub][sup][/sup][s][/s]
      22. [b][/b][i][/i][u][/u][sub][/sub][sup][/sup][s][/s]
      Display All

      systemctl status sharedfolders-Elements.mount yields:

      Source Code

      1. ● sharedfolders-Elements.mount - Mount shared folder Elements to /sharedfolders/Elements
      2. Loaded: error (Reason: Operation not permitted)
      3. Active: inactive (dead)
      4. Where: /sharedfolders/Elements
      5. What: /srv/dev-disk-by-label-Elements4TB/.
      6. Jun 09 15:20:11 hpms systemd[1]: [/etc/systemd/system/sharedfolders-Elements.mount:7] Failed to add required mount "/srv/dev-disk-by-label-Elements4TB/.", ignoring: Operation n
      7. Jun 09 15:20:11 hpms systemd[1]: sharedfolders-Elements.mount: Cannot add dependency job, ignoring: Access denied
      8. Jun 09 15:20:12 hpms systemd[1]: [/etc/systemd/system/sharedfolders-Elements.mount:7] Failed to add required mount "/srv/dev-disk-by-label-Elements4TB/.", ignoring: Operation n
      9. Jun 09 15:20:12 hpms systemd[1]: [/etc/systemd/system/sharedfolders-Elements.mount:7] Failed to add required mount "/srv/dev-disk-by-label-Elements4TB/.", ignoring: Operation n
      10. Jun 09 15:20:12 hpms systemd[1]: [/etc/systemd/system/sharedfolders-Elements.mount:7] Failed to add required mount "/srv/dev-disk-by-label-Elements4TB/.", ignoring: Operation n
      11. Jun 09 15:20:12 hpms systemd[1]: [/etc/systemd/system/sharedfolders-Elements.mount:7] Failed to add required mount "/srv/dev-disk-by-label-Elements4TB/.", ignoring: Operation n
      12. Jun 09 15:20:12 hpms systemd[1]: [/etc/systemd/system/sharedfolders-Elements.mount:7] Failed to add required mount "/srv/dev-disk-by-label-Elements4TB/.", ignoring: Operation n
      Display All

      The disk mentioned in the systemctl command above (/srv/dev-disk-by-label-Elements4TB/) is still there (not the failed one) and seems to work correctly.


      What to do?

      Recently I had upgraded from OMV3 to 4, which seemed to proceed without any errors.
      OMV 4.1.13-1 (typically everything up to date), only plugin: flash memory; HP Microserver, 4 internal ext4 HDDs, SSD for OS, SD-Card for booting (can't boot on SSD with 4 HDD used …), external USB3 HDDs (ext4 + NTFS)
    • Can't anybody help?

      Basically, the system works, but I am stuck in the current configuration. Whenever I want to change it, I receive errors, i.e. the one above.

      Maybe I had phrased my article not very well. "Deleting Shared Folder" probably should have been phrases as "removing …" meaning "removing the reference to it, not the contents". Unfortunately, I did not find a fast way to change the language of the OMV Web interface. Wanted to change the language from German to English, but didn't see the switch - seem I am blind … (I wanted to be able to use the proper English wording from the OMV Web interface)

      I had replaced the broken external USB3 disk by a new one. Now tried to ignore my failed attempts to remove the old broken disk from the configuration and wanted to add the new one. When trying to mount the file system, I get:

      Source Code

      1. Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C; systemctl reload 'monit' 2>&1' with exit code '1': monit.service is not active, cannot reload.

      Well, it was rather easy to find similar errors in the forum. From a message of votdev, it seemed, that this was fixed in 4.18.1. I already have updated to this version. I also have tried:

      Source Code

      1. root@hpms:~# systemctl enable monit
      2. monit.service is not a native service, redirecting to systemd-sysv-install.
      3. Executing: /lib/systemd/systemd-sysv-install enable monit
      4. root@hpms:~#

      The error stays …
      OMV 4.1.13-1 (typically everything up to date), only plugin: flash memory; HP Microserver, 4 internal ext4 HDDs, SSD for OS, SD-Card for booting (can't boot on SSD with 4 HDD used …), external USB3 HDDs (ext4 + NTFS)
    • Please ignore the error about monit. It is gone. Seems I was confused about versions or had forgotten one reboot (although I was sure …).

      Nevertheless, I am stuck with my configuration. Mounting the new disk did work in the web-UI. But adding it to Shared folders and applying yielded in the error from the first message above. And Removing the missing file system (from broken disk) from Shared Folders the same.
      OMV 4.1.13-1 (typically everything up to date), only plugin: flash memory; HP Microserver, 4 internal ext4 HDDs, SSD for OS, SD-Card for booting (can't boot on SSD with 4 HDD used …), external USB3 HDDs (ext4 + NTFS)
    • I'm heading out tomorrow morning but, when I get back this coming weekend, I'll try to duplicate this.

      Video Guides :!: New User Guide :!: Docker Guides :!: Pi-hole in Docker
      Good backup takes the "drama" out of computing.
      ____________________________________
      Primary: OMV 3.0.99, ThinkServer TS140, 12GB ECC, 32GB USB boot, 4TB+4TB zmirror, 3TB client backup.
      Backup: OMV 4.1.13, Intel Server SC5650HCBRP, 6GB ECC, 16GB USB boot, UnionFS+SNAPRAID
      2nd Backup: OMV 4.1.9, Acer RC-111, 4GB, 32GB USB boot, 3TB+3TB zmirror, 4TB Rsync'ed disk
    • Thanks for your support.
      To help you in your repro, these are some hints:
      - my shared folders exists since omv 3.x or even omv 2.X
      - I see some old shared folders I don't use anymore, with status 'referenced', while they are not used anymore by any plugin or function, preventing me to delete them

      My guess would be that import of shared folders config from omv 3.x into omv 4.x failed in some ways, and generates troubles. I was willing to delete all my shared folders and recreate them, but as stated above several are still with status 'referenced' (while not used), preventing to delete them.
      I'm thinking about an migration issue to omv 4.X, with the omv internal shared folder configuration (I add a similar issue with NFS configuration NFS share issue).
    • OK, I set up two drives on test hardware.
      I referenced both drives with shared folders and samba shares.

      I shutdown and killed one drive. ( /dev/sdb with a label of DATA2)

      After booting up, In Storage, File systems, the drive DATA2 was Mounted (No) Referenced (Yes) and Status was (Missing). This is to be expected. The Delete button was greyed out so the drive couldn't be deleted, direct, in this screen. (Also to be expected.)

      **Note that deconfiguring a drive must be done in the same order that it was configured, but in reverse order. This is designed in intentionally and is part of how OMV manages the house keeping of it's database- and is the reason why the Delete button is greyed out. (Otherwise users might accidently delete a drive that has been extensivly configured with huge amounts of data, while also scrambling OMV's database.)**


      At this point, I deconfigured references to the missing drive DATA2 by:

      - Deleting an rsnapshot reference
      - Deleting the SMB share
      - Any Rsync Jobs config'ed
      - Deleted the shared folder referencing DATA2
      (When I deleted shared folder(s) - the final process before the drive can be deleted - I got an error as follows.)

      Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C; systemctl restart 'sharedfolders-Music\x2dSnap.mount' 2>&1' with exit code '1': A dependency job for sharedfolders-Music\x2dSnap.mount failed. See 'journalctl -xe' for details.

      - I selected the shared folder and deleted it again. The second time around, it deleted successfully.

      Finally, after removing all references to the data drive, I went back to Storage, Filesystems. All was the same as before with DATA2 (as noted above) except Referenced is now (No)

      I clicked on the drive, found that the Delete button is now active, and deleted the drive. (While probably not necessary, after the drive delete completed, I rebooted.
      _____________________________________________________

      To make sure you've deleted all configured services that reference your drives shared folders, install the "openmediavault-resetperm's" plugin. This plugin adds two new tabs to Access Rights Management, Shared Folders. You'll be interesting in the Shared Folder in Use because it shows all extended references to all shared folders (SMB shares, Rsync, etc.).

      Once all references to the shared folders on a missing drive are deleted, the shared folders themselves can be deleted which will, finally, allow you to delete the drive itself.

      Video Guides :!: New User Guide :!: Docker Guides :!: Pi-hole in Docker
      Good backup takes the "drama" out of computing.
      ____________________________________
      Primary: OMV 3.0.99, ThinkServer TS140, 12GB ECC, 32GB USB boot, 4TB+4TB zmirror, 3TB client backup.
      Backup: OMV 4.1.13, Intel Server SC5650HCBRP, 6GB ECC, 16GB USB boot, UnionFS+SNAPRAID
      2nd Backup: OMV 4.1.9, Acer RC-111, 4GB, 32GB USB boot, 3TB+3TB zmirror, 4TB Rsync'ed disk
    • Thank you fimaxey for your repro.
      Let's go deeply into the details...
      I can repro exactly the same situation than yours, except that if I go a step further I find out that the SharedFolder is actually not deleted.
      This is the process:
      - I have 2 shared folders SF1 & SF2 without any reference
      - I delete SF1 and click on "Apply modifications"
      - I get the error message you had also
      - I click on "Cancel modification" to get SF1 back in the list
      - I delete once again SF1, and apply modif
      - Then SF1 disappears from shared folders list. Here we are both at the same understanding of the situation. :thumbup:
      Let's continue
      - I delete SF2 and apply modif
      - I get the same error message
      - I cancel the modification
      Then SF2 comes back in the list, BUT ALSO SF1 ;(
      In fact, it looks like it is deleted, but it's not. I can toggle between SF1 and SF2 deletion several times; they are never deleted.
    • BTW: The test run was done on OMV4.

      zevleu wrote:

      - I delete SF2 and apply modif- I get the same error message
      - I cancel the modification
      Then SF2 comes back in the list, BUT ALSO SF1 ;(
      In fact, it looks like it is deleted, but it's not. I can toggle between SF1 and SF2 deletion several times; they are never deleted.
      Did you install the resetperm's plugin for the "Shared Folder in Use Tab" (detailed above) ? There may be something remaining, still attached to the shared folder(s). If that's the case, they won't delete. They'll revert every time.

      Also when you get Shared Folder 1 deleted, try rebooting the server to see if it stays gone, before moving on to shared folder 2. While the need to reboot is unnecessary in most cases, I've seen a few events where a reboot straighten things out.
      __________________________________

      At all stages, I'd check the File System Page to see if the Delete button becomes active. If it does, delete the drive.

      Video Guides :!: New User Guide :!: Docker Guides :!: Pi-hole in Docker
      Good backup takes the "drama" out of computing.
      ____________________________________
      Primary: OMV 3.0.99, ThinkServer TS140, 12GB ECC, 32GB USB boot, 4TB+4TB zmirror, 3TB client backup.
      Backup: OMV 4.1.13, Intel Server SC5650HCBRP, 6GB ECC, 16GB USB boot, UnionFS+SNAPRAID
      2nd Backup: OMV 4.1.9, Acer RC-111, 4GB, 32GB USB boot, 3TB+3TB zmirror, 4TB Rsync'ed disk
    • I've installed the ResetPerm plugin. When I try to reset my non-referenced shared folder, I get the error "Failed to execute XPath query '//system/resetperms'.".

      Also, I forgot to mention that I cannot delete non-referenced SharedFolders, which is annoying, but I cannot create new SharedFolders as I get the same error message than when I delete one. I cannot modify anymore my omv config.
    • Something "unhealthy" seems to have happened and I believe you're at a point where the effort to find out what happened would take far longer than a rebuild.

      If you can't modify your server, at this point, I really don't see any choice other than to rebuild. I'd remove or disconnect my data drive, rebuild OMV, and remount the data drive.

      If you do rebuild, consider the advice in this guide for operating system backup. With a cloned boot drive, you'd be able to gracefully back out of future problems like this.

      Video Guides :!: New User Guide :!: Docker Guides :!: Pi-hole in Docker
      Good backup takes the "drama" out of computing.
      ____________________________________
      Primary: OMV 3.0.99, ThinkServer TS140, 12GB ECC, 32GB USB boot, 4TB+4TB zmirror, 3TB client backup.
      Backup: OMV 4.1.13, Intel Server SC5650HCBRP, 6GB ECC, 16GB USB boot, UnionFS+SNAPRAID
      2nd Backup: OMV 4.1.9, Acer RC-111, 4GB, 32GB USB boot, 3TB+3TB zmirror, 4TB Rsync'ed disk
    • Well, I sincerely regret the rebuild. With a heavily configured server, I know,, it can take hours...

      I also had a bizarre event crop up, just recently:
      When changing ANY network parameter, when saved, I got a message that my gateway must be a valid IP4 address. (It was valid address - it hadn't been changed...) Even one of OMV's sharpest Dev's couldn't make sense of it. In this case, the server worked fine but it was obvious that I'd never be able to change network parameters.

      Usually, I maintain a total of 3 cloned USB boot drives, so I can fall back. Since this particular server was relatively new, I had only 2 drives and the same problem had been cloned to the backup. (I usually maintain a 3rd clone in a drawer that goes way back for just this type of event.)

      After futzing around with it, it became apparent something was slightly corrupted. (And since this server doesn't have ECC, it has a couple server add-on's, maybe an update went sour?, there was no knowing exactly what happened.) The conclusion became apparent rapidly, the easiest solution was to rebuild.

      Again look at OS backup, in the guide. It might save you a headache or two down the road.

      Video Guides :!: New User Guide :!: Docker Guides :!: Pi-hole in Docker
      Good backup takes the "drama" out of computing.
      ____________________________________
      Primary: OMV 3.0.99, ThinkServer TS140, 12GB ECC, 32GB USB boot, 4TB+4TB zmirror, 3TB client backup.
      Backup: OMV 4.1.13, Intel Server SC5650HCBRP, 6GB ECC, 16GB USB boot, UnionFS+SNAPRAID
      2nd Backup: OMV 4.1.9, Acer RC-111, 4GB, 32GB USB boot, 3TB+3TB zmirror, 4TB Rsync'ed disk
    • zevleu wrote:

      @buers,
      did you manage to fix the issue?
      No. I actually was rather disappointed, that within two months I got no answers, so I had given up at that time. I only today looked back at the forum, I lived with fact, that I could not change the system anymore. Other drives were running and working.

      flmaxey: "Note that deconfiguring a drive must be done in the same order that it was configured, but in reverse order. "

      Well, my drive died. It seems that OMV needs a working drive, to properly remove it? Of course, I may not have understood, how to do it.. When I try to remove the file system of the dead drive from shared folders, I get the errors described above. OMV shows me, that there are no references left to the shared folder. (I had removed CIFS/SMB references before).


      I have updated OMV today to 4.1.13-1. Still exactly the same error messages from my first post at the start of this thread.

      So I'll try to ask again: How do I properly remove a dead drive?

      BTW. I have backups of all the data :)
      Images
      • omv.JPG

        26.36 kB, 843×121, viewed 39 times
      OMV 4.1.13-1 (typically everything up to date), only plugin: flash memory; HP Microserver, 4 internal ext4 HDDs, SSD for OS, SD-Card for booting (can't boot on SSD with 4 HDD used …), external USB3 HDDs (ext4 + NTFS)

      The post was edited 1 time, last by buers ().

    • Have you tried to edit
      /etc/openmediavault/config.xml and remove the section which is related to the old drive? Before you edit, make a copy of the file.

      Safe the file and then
      omv-mkconf fstab
      Odroid HC2 - armbian - Seagate ST4000DM004 - OMV4.x
      Asrock Q1900DC-ITX - 16GB - 2x Seagate ST3000VN000 - Intenso SSD 120GB - OMV4.x
      :!: Backup - Solutions to common problems - OMV setup videos - OMV4 Documentation - user guide :!:
    • Well, I guess I should start removing this section:

      Source Code

      1. <sharedfolder>
      2. <uuid>bf729f44-bbee-4615-bc34-327fc7b9642a</uuid>
      3. <name>Seagate</name>
      4. <comment/>
      5. <mntentref>3743292e-fa2d-49d7-a035-161469f18961</mntentref>
      6. <reldirpath>./</reldirpath>
      7. <privileges>
      8. ...
      9. </privileges>
      10. </sharedfolder>

      I concluded this from the mntent entry:

      Source Code

      1. <mntent>
      2. <uuid>3743292e-fa2d-49d7-a035-161469f18961</uuid>
      3. <fsname>/dev/disk/by-id/ata-ST4000DM000-1F2168_Z302YX7G-part2</fsname>
      4. <dir>/srv/dev-disk-by-id-ata-ST4000DM000-1F2168_Z302YX7G-part2</dir>
      5. <type>ntfs</type>
      6. <opts>defaults,nofail</opts>
      7. <freq>0</freq>
      8. <passno>2</passno>
      9. <hidden>0</hidden>
      10. </mntent>

      Can I really just edit config.xml? No services or anything else have to be stopped before?

      Nevertheless, should this really be the normal method to remove a dead drive?

      Because I don't understand the inner workings of OMV, I am careful not using old Unix methods like editing fstab, samba conf files, etc.
      OMV 4.1.13-1 (typically everything up to date), only plugin: flash memory; HP Microserver, 4 internal ext4 HDDs, SSD for OS, SD-Card for booting (can't boot on SSD with 4 HDD used …), external USB3 HDDs (ext4 + NTFS)
    • macom wrote:

      s this the right way to remove shared folders and drives that do not exist any more?
      No. You should remove the shared folder from each service using it. Then delete the shared folder. Then when the filesystem is not referenced, you should be able to delete it in the filesystems tab. Deleting the mntent entry and the sharedfolder entry won't remove them from services which means those service(s) are still referencing a shared folder that doesn't have a filesystem underneath it.
      omv 4.1.14 arrakis | 64 bit | 4.15 proxmox kernel | omvextrasorg 4.1.13
      omv-extras.org plugins source code and issue tracker - github

      Please read this before posting a question and this and this for docker questions.
      Please don't PM for support... Too many PMs!