Kennisbank

fsck check of partition inside KVM image

Klantensysteem Home > Kennisbank > SolusVM > fsck check of partition inside KVM image

So here is a fun one. We have a corrupted Linux disk partition within a
KVM image. We want to run fsck on the root partition inside the KVM image.

To do this we can mount it as a loop device

losetup -vf path_to_your_image

we then

kpartx -av /dev/loop0

/dev/mapper now contains links to the partitions so we can simply run

fsck /dev/mapper/path_to_partition
kpartx -dv /dev/loop0 

when done

Was dit antwoord nuttig?
43 gebruikers vonden dit artikel nuttig 133 Stemmen

Lees ook