Databáze řešení

fsck check of partition inside KVM image

Portal Home > Databáze řešení > 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

Byla tato odpověď nápomocná?
43 Uživatelům pomohlo 133 Hlasů

Také čtěte