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:



    systemctl status sharedfolders-Elements.mount yields:



    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:

    Code
    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:

    Code
    root@hpms:~# systemctl enable monit
    monit.service is not a native service, redirecting to systemd-sysv-install.
    Executing: /lib/systemd/systemd-sysv-install enable monit
    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)

  • Can't anybody help or give a hint?

    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)

  • Hi,
    I'm facing exactly the same issue, same error message. I'm running omv 4, and I can't modify nor delete any share folders.
    After the modification, omv tries to remount all shared folders and fail with this error.


    @buers,
    did you manage to fix the issue?

    OMV5 64bits - Intel i5-7400

    4 * 2TB Hdd Raid 5 + 1 SSD 128Go

  • 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).

    OMV5 64bits - Intel i5-7400

    4 * 2TB Hdd Raid 5 + 1 SSD 128Go

    • Offizieller Beitrag

    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.

  • 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.

    OMV5 64bits - Intel i5-7400

    4 * 2TB Hdd Raid 5 + 1 SSD 128Go

    • Offizieller Beitrag

    BTW: The test run was done on OMV4.

    - 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.

  • 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.

    OMV5 64bits - Intel i5-7400

    4 * 2TB Hdd Raid 5 + 1 SSD 128Go

    • Offizieller Beitrag

    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.

    • Offizieller Beitrag

    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.

  • Thanks for your advises flmaxey :thumbup:
    Server rebuilt completely (I took this opportunity to upgrade the hardware) and OMV is behaving properly now.
    I will for sure set up OS backups now to prevent this situation.

    OMV5 64bits - Intel i5-7400

    4 * 2TB Hdd Raid 5 + 1 SSD 128Go

  • @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 :)

    Bilder

    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)

    Einmal editiert, zuletzt von buers ()

  • Well, I guess I should start removing this section:


    Code
    <sharedfolder>
            <uuid>bf729f44-bbee-4615-bc34-327fc7b9642a</uuid>
            <name>Seagate</name>
            <comment/>
            <mntentref>3743292e-fa2d-49d7-a035-161469f18961</mntentref>
            <reldirpath>./</reldirpath>
            <privileges>
    ...
    </privileges>
          </sharedfolder>


    I concluded this from the mntent entry:


    Code
    <mntent>
            <uuid>3743292e-fa2d-49d7-a035-161469f18961</uuid>
            <fsname>/dev/disk/by-id/ata-ST4000DM000-1F2168_Z302YX7G-part2</fsname>
            <dir>/srv/dev-disk-by-id-ata-ST4000DM000-1F2168_Z302YX7G-part2</dir>
            <type>ntfs</type>
            <opts>defaults,nofail</opts>
            <freq>0</freq>
            <passno>2</passno>
            <hidden>0</hidden>
          </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)

    • Offizieller Beitrag

    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 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Jetzt mitmachen!

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