Lin, HongYi - Dell Team
2023-Aug-04 22:44 UTC
[Libguestfs] debug a corrupted VHDX file with libguestfs
Hi I am using libguestfs-1.46.2 on Ubuntu 22.04 I already enabled export LIBGUESTFS_DEBUG=1 export LIBGUESTFS_TRACE=1 I want to mount a vhdx file (which is known to be corrupted) with root at HenrikUbuntu2204:/mnt/sdj# guestmount -a 8b062ac7-00000006-d6ac6b69-64ac6b69-002b5000-4a448456 -m /dev/sda1 --ro /mnt/sdk/ the attached file 5TB is the output of the command above where I can see the following error message from output [ 46.629055] EXT4-fs (sda1): ext4_check_descriptors: Block bitmap for group 524288 not in group (block 0)! [ 46.629656] EXT4-fs (sda1): group descriptors corrupted! command: mount returned 32 I want to actually add debug logs into ext4_check_descriptors with printk To print out the hex values of superblock in the corrupted vhdx file I tried to recompile Ubuntu kernel and add some printk messages, they don't show up in dmesg when I run root at HenrikUbuntu2204:/mnt/sdj# guestmount -a 8b062ac7-00000006-d6ac6b69-64ac6b69-002b5000-4a448456 -m /dev/sda1 --ro /mnt/sdk/ I guess the following messages are from libvirt / KVM ? [ 46.629055] EXT4-fs (sda1): ext4_check_descriptors: Block bitmap for group 524288 not in group (block 0)! [ 46.629656] EXT4-fs (sda1): group descriptors corrupted! How do I use printk to add logs in the kernel messages from libguestfs? Regards Henrik Internal Use - Confidential -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libguestfs/attachments/20230804/72383c90/attachment-0001.htm> -------------- next part -------------- A non-text attachment was scrubbed... Name: 5TB Type: application/octet-stream Size: 81295 bytes Desc: 5TB URL: <http://listman.redhat.com/archives/libguestfs/attachments/20230804/72383c90/attachment-0001.obj>