Description of problem: I want to mount CentOS7 vmdk disk with write permission run command: ```shell $ virt-filesystems -a /v2v/images1/centos7-disk1.vmdk /dev/sda1 /dev/centos/root $ sudo guestmount -w -a /v2v/images1/centos7-disk1.vmdk -m /dev/centos/root /v2v/images2/ libguestfs: error: mount_options: mount exited with status 32: mount: /sysroot: can't read superblock on /dev/mapper/centos-root. guestmount: ‘/dev/centos/root’ could not be mounted. guestmount: Did you mean to mount one of these filesystems? guestmount: /dev/sda1 (xfs) guestmount: /dev/centos/root (xfs) guestmount: /dev/centos/swap (swap) ``` but I use read-only permissions is no problem ```shell $ sudo guestmount -r -a /v2v/images1/centos7-disk1.vmdk -m /dev/centos/root /v2v/images2/ $ sudo ls /v2v/images2 bin boot data dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var ``` Version-Release number of selected component (if applicable): $ dpkg -l | grep -i guestfs ii libguestfs-hfsplus:amd64 1:1.38.1-1 amd64 ii libguestfs-perl 1:1.38.1-1 amd64 ii libguestfs-reiserfs:amd64 1:1.38.1-1 amd64 ii libguestfs-tools 1:1.38.1-1 amd64 ii libguestfs-xfs:amd64 1:1.38.1-1 amd64 ii libguestfs0:amd64 1:1.38.1-1 amd64 ii python-guestfs 1:1.38.1-1 amd64 OS: $ uname -a Linux debian 4.15.0-2-amd64 #1 SMP Debian 4.15.11-1 (2018-03-20) x86_64 GNU/Linux How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Please add ‘guestmount -v -x’ options to the failing command and attach the complete output to the bug.
Created attachment 1458680 [details] log file I found this machine enbale selinux, Is it related to selinux? SELINUX=enforcing If so, can I turn it off via libguestfs?
sorry , this machine is centos7.vmdk guest os
No, the problem is that the qemu driver for VMDK does not support writes to the VMDK subformat (streamOptimized). This is a bug / shortcoming in qemu. The only workaround is to convert to a simpler format, eg. raw. qemu-system-x86_64: Could not write to allocated cluster for streamOptimized qemu-system-x86_64: Could not write to allocated cluster for streamOptimized qemu-system-x86_64: Could not write to allocated cluster for streamOptimized [ 3.628276] sd 2:0:0:0: [sda] tag#2 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 3.632265] sd 2:0:0:0: [sda] tag#2 Sense Key : Aborted Command [current] [ 3.632265] sd 2:0:0:0: [sda] tag#2 Add. Sense: I/O process terminated [ 3.632265] sd 2:0:0:0: [sda] tag#2 CDB: Write(10) 2a 00 01 70 32 e4 00 00 48 00 [ 3.632265] print_req_error: I/O error, dev sda, sector 24130276 [ 3.632265] sd 2:0:0:0: [sda] tag#1 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 3.632265] sd 2:0:0:0: [sda] tag#1 Sense Key : Aborted Command [current] [ 3.632265] sd 2:0:0:0: [sda] tag#1 Add. Sense: I/O process terminated [ 3.632265] sd 2:0:0:0: [sda] tag#1 CDB: Write(10) 2a 00 01 70 28 e4 00 0a 00 00 [ 3.632265] print_req_error: I/O error, dev sda, sector 24127716 [ 3.632265] sd 2:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [ 3.632265] sd 2:0:0:0: [sda] tag#0 Sense Key : Aborted Command [current] [ 3.632265] sd 2:0:0:0: [sda] tag#0 Add. Sense: I/O process terminated [ 3.632265] sd 2:0:0:0: [sda] tag#0 CDB: Write(10) 2a 00 01 70 23 2c 00 05 b8 00 [ 3.632265] print_req_error: I/O error, dev sda, sector 24126252 [ 3.632265] XFS (dm-1): xfs_do_force_shutdown(0x1) called from line 1217 of file /build/linux-jIx23a/linux-4.15.11/fs/xfs/xfs_buf.c. Return address = 0x00000000834a9276 [ 3.731935] XFS (dm-1): I/O Error Detected. Shutting down filesystem [ 3.737333] XFS (dm-1): Please umount the filesystem and rectify the problem(s) [ 3.743614] XFS (dm-1): metadata I/O error: block 0x110132c ("xlog_bwrite") error 5 numblks 8192 [ 3.751021] XFS (dm-1): failed to locate log tail [ 3.755130] XFS (dm-1): log mount/recovery failed: error -5 [ 3.759962] XFS (dm-1): log mount failed
You might try upgrading to a later version of qemu if one is available for Debian.
Closing this as CANTFIX. Libguestfs just uses the capabilities of qemu. In this case qemu cannot write to a particular VMDK subformat, so there's nothing we can do about it. I suggest opening a bug about this in the qemu bug tracker.
Yes, this is indeed a problem with qemu. Thank you