VM filesystem corrupted

jlgarnier

Active Member
May 25, 2021
32
3
28
Auriol, France
Dear Community,

I struggled last week-end to restart a VM which stopped during a power outage (this is running on a homelab server). I manage to open the Proxmox application once the power is back but the VM (OpenMediaVault) cannot restart and display
Bash:
SELinux : could not open policy file <=/etc/selinux/targeted/policy/policy.33 : no such file or directory
[FAILED] Failed to start File System Check on /dev/disk/by-uuid/[...]_41a3cab08e5b

I can't go further as the engine requests the admin password to run a minimal system and there's a US/FR keyboard mapping issue (I MUST take this into account when creating complex passwords )...

I don't really know how I could repair the VM and am afraid of killing / recreating it as it hosts many other services.

Any help would be greatly appreciated!
 
Hi, @jlgarnier
You probably may boot the VM from some rescue CD image (e.g. Systemrescue). It doesn't require the password of the VM. And then without mounting the original filesystem you can fsck it.
 
Repairing an system inside a VM is not really different from repairing a system on bare-metal. This is not Proxmox specific and other guides on the internet will apply.
Since this is filesystem corruption, maybe a better idea is to restore the VM from a backup?
 
@Onslow : this seems effective. So I need to upload this ISO image to the node first, then attach it to the VM, then boot on this image, right?
@leesteken : shame on me, I don't have any backup! I was actually reorganizing the VMs and planned to make a backup after that... Karma stroke first. ‍;)

However, do the error messages I reported bring any clue on the issue? I'm not a Linux specialist, so any guidance on the repair tools that could help would be great!

Eg. running testdisk returns 5 deleted Linux partitions (4 identified as 'Linux' and the last one identified as 'Linux swap'). I can change their type as primary bootable, primary, logical or extended.
I suppose the first one should be changed to primary but what about the remaining ones, especially the swap?

1771855061680.png
 
Last edited:
So I need to upload this ISO image to the node first, then attach it to the VM, then boot on this image, right?
I'm not sure about the wording. But probably yes. You must attach it to the (virtual) optical drive and change the boot options so that the VM boots from it.
I haven't met the error message you quoted, but as the VM wants to execute a fs check, do it and see what happens next.
If the VM boots from its normal disk, great. If not, we'll see. Maybe you'll have to temporary disable SELinux at boot command line.

This "TestDisk" I don't know. It's a little strange that it marks the partitions as deleted. I suggest not messing with the partitions at this stage.