知識庫

fsck check of partition inside KVM image

客戶系統 > 知識庫 > 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

這篇文章有幫助嗎?
43 Users Found This Useful 133 Votes

Also Read