树莓派系统内备份成IMG镜像
本文地址:http://tongxinmao.com/Article/Detail/id/308
sudo apt-get install dosfstools sudo apt-get install dumpsudo apt-get install parted sudo apt-get install kpartx #!/bin/sh sudo dd if=/dev/zero of=raspberrypi.img bs=1MB count=2500 sudo parted raspberrypi.img --script -- mklabel msdos sudo parted raspberrypi.img --script -- mkpart primary fat32 8192s 122879s sudo parted raspberrypi.img --script -- mkpart primary ext4 122880s -1 loopdevice=`sudo losetup -f --show raspberrypi.img` device=`sudo kpartx -va $loopdevice | sed -E 's/.*(loop[0-9])p.*/\1/g' | head -1` device="/dev/mapper/${device}" partBoot="${device}p1" partRoot="${device}p2" sudo mkfs.vfat $partBoot sudo mkfs.ext4 $partRoot sudo mount -t vfat $partBoot /media sudo cp -rfp /boot/* /media/ sudo umount /media sudo mount -t ext4 $partRoot /media/ cd /media sudo dump -0uaf - / | sudo restore -rf - cd sudo umount /media sudo kpartx -d $loopdevice sudo losetup -d $loopdevice
上一篇:内存卡IMG镜像瘦身
下一篇:bt-bluray58 热敏打印机USB描述符