Error trying to share btrfs subvolumes with '@' prefix in their names using NFS add shares GUI

  • I've been using btrfs for a few years and this week decided to make a dedicated NAS instead of relying on my PC. Installation of Debian and OMV went smoothly and I transplanted my data disks from my PC into my new (as new as you can get on freecycle and ebay for a £25 outlay :/ ) NAS. A few clicks and by btrfs RAID1 mirror was back.


    My NAS box is running OMV 3.0.59 erasmus, 64-bit AMD 4.7.0 backport kernel and omvextrasorg 3.4.15. (I'm using the 4.7 kernel because I use btrfs on my disks and want to use the most recent btrfs-progs that is currently available)


    I hit a snag when I tried to setup NFS shares for my various subvolumes which I have named using the semi-adopted convention of using an '@' symbol to prefix subvolume names to make it easy to distinguish subvolumes from directories at a glance, e.g. subvolume '@photos' vs a directory, e.g. 'Maldives_XMAS_2017'. However, it is impossible to share the subvolumes directly because of the '@' symbol in their names. As a workaround I have created symlinks to my subvolumes for now.


    The recreate the problem simply create a subvolume called '@test' then try to share it using OMV's NFS add share GUI which fails with:

    The problem does not occur when I dont use the '@' symbol in the subvolume name, e.g. test2 created with 'btrfs sub cre test2' can be shared without issue. Creating a symlink 'ln -s @test test3' and sharing the 'test3' symlink also works without problem.


    Is this actually a bug in OMV or am I doing something wrong :?: .


    Thanks in advance,
    Sophie x

  • there is maybe a restriction pattern in the datamodels conf file not sure. Also seeing your thread I recall someone else's mentioned this problem before....not sure.


    Cc @votdev


    Please open a bug report. I've looked into the code, but the regex was a little bit complicated to understand (without a comment ?( ), so i need to have a deeper look into it.


    Thank you votdev and subzero79, I see. I have learnt that the behaviour of almost everything in Linux can be modified through configuration files and so I went looking. The file that ultimately throws a SchemaValidationException is /usr/share/php/openmediavault/json/schema.inc, specifically the checkOneOf function. Unfortunately I don't unerstand enough to know which schemas that function is testing against or where they are defined. I have found some OMV specific schemas defined in /usr/share/php/openmediavault/datamodel/schema.inc but I suspect that this is not the place to look and I need to find where the default JSON schema definitions are stored.


    votdev can you tell me where the schema is defined please? I'd like to debug this myself if I can but fear my lack of experience is going to frustrate my efforts. I'd be grateful If you or anyone else can point me in the right direction. In the meantime I shall continue reading https://spacetelescope.github.…ng-json-schema/index.html for enlightenment :/



    Sophie x

  • Wow, you've fixed it already. I've been trying to get my head around regular expression syntax, a task where having Sherlock Holmes' 'Mind Palace' would help.


    I can happily confirm that after modifying the regex for dirpath in .../datamodel/schema.inc and rebooting my OMV NAS I am able to share my subvolumes without having to resort to renaming them or using symlinks.


    Thank you very much Volker :D
    Sophie x


    PS sorry for using the f**r word previously =O

Jetzt mitmachen!

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