2

I have a CentOS 7 KVM host. A partition on one of the VM's seems to be corrupt. Image is qcow2. When trying to mount the image to troubleshoot I receive the following error:

[root@vmhost02 images]# guestmount -a cpanel-vm.qcow2 -m /dev/sbcd /mnt/temp
libguestfs: error: vfs_type: vfs_type_stub: /dev/sbcd: No such file or directory
libguestfs: error: mount_options: mount_options_stub: /dev/sbcd: No such file or directory
guestmount: '/dev/sbcd' could not be mounted.
guestmount: Did you mean to mount one of these filesystems?
guestmount:     /dev/sda1 (xfs)
guestmount:     /dev/centos/home (xfs)
guestmount:     /dev/centos/root (xfs)
guestmount:     /dev/centos/swap (swap)

[root@vmhost02 images]# guestmount -a cpanel-vm.qcow2 -m /dev/centos/root /mnt/temp
libguestfs: error: mount_options: /dev/centos/root on / (options: ''): mount: mount /dev/mapper/centos-root on /sysroot failed: Structure needs cleaning
guestmount: '/dev/centos/root' could not be mounted.

I am unsure of how to repair this as I can only use guestmount to my knowledge to access the partition but that is failing?

  • 1
    I get the following error when trying to mount the filesystem using guestfish: ><fs> mount /dev/centos/root / libguestfs: error: mount: /dev/centos/root on / (options: ''): mount: mount /dev/mapper/centos-root on /sysroot failed: Structure needs cleaning – user216260 Jun 17 '18 at 3:08
0

I wonder if that device /dev/sbcd isn't correct. You could try using guestfish first to boot the VM. From within guestfish you can then list the filesystems available.

For example, say I have a qcow2 file called disk:

$ guestfish --rw -a disk
Welcome to guestfish, the guest filesystem shell for
editing virtual machine filesystems and disk images.
Type: 'help' for help on commands
      'man' to read the manual
      'quit' to quit the shell
><fs> run
 100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒⟧ 00:00

You can then list the filesystems like so, and even attempt to mount them:

><fs> list-filesystems
/dev/sda1: xfs
><fs> mount /dev/sda1 /

Once mounted you can look at, here I'm looking at the /etc/shadow file:

><fs> edit /etc/shadow
...
root:$6$2c908VsVmGs.TSdO$eiSIj7k1vqMAQaW1ipKYxWhNFXYIaXHN1XbQ00oi8ZeDcR4QNo2aN4pCpmU8tP8KjwyXeyng5q3sAxT/XQO8n.:16259:0:99999:7:::
bin:*:16231:0:99999:7:::
daemon:*:16231:0:99999:7:::
adm:*:16231:0:99999:7:::
lp:*:16231:0:99999:7:::
sync:*:16231:0:99999:7:::
shutdown:*:16231:0:99999:7:::
halt:*:16231:0:99999:7:::
...

When you're done quit it:

><fs> edit /etc/shadow
><fs> quit
$
| improve this answer | |
  • Sorry I just put in /dev/sbcd to get a list of mountable options, then tried to mount /dev/centos/root which is when i have the error occur. It looks like the xfs file system is corrupt and needs repairing, I will try guestfish thank you! – user216260 Jun 17 '18 at 3:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.