How to solve hard disk damage when Linux cropping system
In the system cropping, in order to reduce the waiting time, generally choose to hang the host and directly run the target system, but too frequent operation, often causes the hard disk can not be synchronized in time, causing the hard disk partition damage, resulting in the target system can not start normally. In this case, it would be too cumbersome to reformat the partition again.
This paper solves the problem by means of archive packing, and avoids the tedious repairing process effectively.
First, go to the root directory of the target system package compressed files to the specified location (assuming the host's/mnt/sysroot directory)
Find. | Cpio-h NEWC--quiet-o | gzip >/root/sysroot.2.gz
Second, uninstall the damaged partition
Fuser-km/mnt/sysroot
umount/mnt/sysroot/
Third, reformat and mount the partition
Mke2fs-j/dev/hda2
mount/dev/hda2/mnt/sysroot/
Iv. return to the root of the target system again, restore the files and perform the synchronization
cd/mnt/sysroot/
zcat/root/sysroot.2.gz | Cpio-id
Sync
Five, hang the host, open the target system of the virtual machine, the general will be able to run normally
This article from "Not Daze" blog, please make sure to keep this source http://tobeys.blog.51cto.com/10620284/1775170
How to solve hard disk damage when Linux cropping system