Qemu-img 5.2.91 无法打开 vmdk,Failed to lock byte 100: Input/output 错误,但 qemu-img 2.5 工作

Qemu-img 5.2.91 can't open vmdk, Failed to lock byte 100: Input/output error, but qemu-img 2.5 work

openstack:~/qemu-6.0.0-rc1/build$ qemu-img --version
qemu-img version 2.5.0 (Debian 1:2.5+dfsg-5ubuntu10.51), Copyright (c) 2004-2008 Fabrice Bellard
openstack:~/qemu-6.0.0-rc1/build$ sudo qemu-img check /mnt/esxi/name.vmdk
No errors were found on the image.

openstack:~/qemu-6.0.0-rc1/build$ ./qemu-img -V
qemu-img version 5.2.91
Copyright (c) 2003-2021 Fabrice Bellard and the QEMU Project developers
openstack:~/qemu-6.0.0-rc1/build$ sudo ./qemu-img check /mnt/esxi/name.vmdk
qemu-img: Could not open '/mnt/esxi/name.vmdk': Failed to lock byte 100: Input/output error

作为命令输出,qemu-img 5.2.91 无法检查 vmdk 文件,但 qemu-img 2.5 工作正常。

qemu-img 5.2.91 --help 得到这个:

Supported formats: blkdebug blklogwrites blkverify bochs cloop compress copy-on-read dmg file host_cdrom host_device luks nbd null-aio null-co nvme preallocate qcow qcow2 qed quorum raw rbd replication throttle vdi vhdx vmdk vpc vvfat

我该如何解决?谢谢

因为NFS目录下的vmdk文件,添加这个选项-o nolock修复了。

nolock — Disables file locking. This setting is occasionally required when connecting to older NFS servers. noexec — Prevents execution of binaries on mounted file systems. This is useful if the system is mounting a non-Linux file system via NFS containing incompatible binaries.