مرکز آموزش

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 کاربر این را مفید یافتند 133 نظرات

در همین زمینه