LVM: Cannot create volume group on /dev/md0

  • Hello,


    I am testing OMV in a proxmox VM with a bunch of virtual disks that form a RAID5 as /dev/md0. However, I run into a problem when creating a volume group on /dev/md0:


    devices: The value '/dev/md0' doesn't match the pattern '^(.+[,;])*.+$'.


    Error #0:OMV\Json\SchemaValidationException: devices: The value '/dev/md0' doesn't match the pattern '^(.+[,;])*.+$'. in /usr/share/php/openmediavault/json/schema.inc:478Stack trace:#0 /usr/share/php/openmediavault/json/schema.inc(370): OMV\Json\Schema->checkPattern('/dev/md0', Array, 'devices')#1 /usr/share/php/openmediavault/json/schema.inc(297): OMV\Json\Schema->validateString('/dev/md0', Array, 'devices')#2 /usr/share/php/openmediavault/json/schema.inc(624): OMV\Json\Schema->validateType('/dev/md0', Array, 'devices')#3 /usr/share/php/openmediavault/json/schema.inc(395): OMV\Json\Schema->checkProperties(Object(stdClass), Array, '')#4 /usr/share/php/openmediavault/json/schema.inc(285): OMV\Json\Schema->validateObject(Object(stdClass), Array, '')#5 /usr/share/php/openmediavault/json/schema.inc(257): OMV\Json\Schema->validateType(Object(stdClass), Array, '')#6 /usr/share/php/openmediavault/rpc/paramsvalidator.inc(59): OMV\Json\Schema->validate(Object(stdClass))#7 /usr/share/php/openmediavault/rpc/serviceabstract.inc(178): OMV\Rpc\ParamsValidator->validate('{"name":"testvg...')#8 /usr/share/openmediavault/engined/rpc/logicalvolumemgmt.inc(381): OMV\Rpc\ServiceAbstract->validateMethodParams(Array, 'rpc.logicalvolu...')#9 [internal function]: OMVRpcServiceLogicalVolumeMgmt->createVolumeGroup(Array, Array)#10 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)#11 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('createVolumeGro...', Array, Array)#12 /usr/sbin/omv-engined(536): OMV\Rpc\Rpc::call('LogicalVolumeMg...', 'createVolumeGro...', Array, Array, 1)#13 {main}


    As I am new to OMV I am not really sure what causes this problem. But I know that


    vgcreate vg1 /dev/md0


    is no problem as I have it running on my production file server which is manually configured.


    Versions are:


    OMV 4.1.3
    LVM2: 4.0.7-1


    Thanks a lot,


    Ben

  • OK, thanks a lot for trying to help anyways.


    For the moment, I have created the volume group from the commandline. It then shows up in OMV and I can continue testing. Maybe I can find some time to have a closer look at what is going wrong in the PHP code.


    Best,


    Ben

  • OMV is running in a Proxmox VM. The hosts hardware is a Intel NUC. The drives for the raid are no real physical drives but rather virtual ones that are available as usual as /dev/sdx devices. OMV was able to create the RAID as /dev/md0 without problems.


    I used the openmediavault_4.1.3-amd64.iso. It is a fresh install from Thursday, so everything is up-to-date


    As mentioned in the original post, versions are:


    OMV 4.1.3
    LVM2: 4.0.7-1


    Best,


    Ben

  • OK, I waded my way through the code and found the following:


    What gets called in the schema validator using the checkPattern method is


    Code
    if (!preg_match('^(.+[,;])*.+$', '/dev/md0')) {
    ...

    I have extracted the relevant code into a small script to check in a shell. This then gives a warning:


    PHP Warning: preg_match(): No ending delimiter '^' found in /root/test.php on line 8


    and matching fails.


    Checking the documentation (my php is a bit rusty from time to time) it says that preg_match needs delimiters. So changing the call to



    Code
    if (!preg_match('/^(.+[,;])*.+$/', '/dev/md0')) {
    ...

    giving a perfect match. I then changed the rexexp in the relevant datamodel (rpc.logicalvolumemgmt.json) just for testing and voila, volume group can be created.


    Best,


    Ben

    • Offizieller Beitrag

    I am sorry to say but your system is not up to date, the latest version is 4.1.21. Use the UI to update your system.


    And about your finding in the code, above the mentioned Code there is a comment



    Code
    // Note, the pattern is defined according to the ECMA 262 regular
    		// expression dialect. So it must be adapted to the PHP syntax.
    		$regex = sprintf("/%s/u", $schema['pattern']);
    		if (!preg_match($regex, $value)) {

    sorry, can not link to the code using the smartphone.


    So the problem is something different. Note, this issue only happens on a really really really really small number of systems.

  • Oh yes, entirely my vault with the outdated version. I am used to use docker containers for almost all of my services so I didn't even thought about that the iso image could be pretty ancient.


    Also, for some unknown reason the Update Manager in my case does not show any new versions, but also no error. However, I was able to install the LVM-Plugin.


    The code fragment strongly indicates that my problem is fixed in a newer version, so I have to find out why I cannot update.


    I think I better try a clean reinstall.


    Thanks a lot,


    Ben

Jetzt mitmachen!

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