fsck the destination boot partition after dd
This commit is contained in:
24
rpi-clone
24
rpi-clone
@@ -27,11 +27,22 @@ if ! rsync --version > /dev/null
|
||||
then
|
||||
echo -e "\nOoops! rpi-clone needs the rsync program but cannot run it."
|
||||
echo "Make sure rsync is installed:"
|
||||
echo " $ apt-get update"
|
||||
echo -e " $ apt-get install rsync\n"
|
||||
echo " $ sudo apt-get update"
|
||||
echo -e " $ sudo apt-get install rsync\n"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -e /sbin/fsck.vfat
|
||||
then
|
||||
HAVE_FSCK_VFAT="yes"
|
||||
else
|
||||
|
||||
echo "[Note] fsck.vfat was not found."
|
||||
echo "It is recommended to install dosfstools:"
|
||||
echo " $ sudo apt-get update"
|
||||
echo " $ sudo apt-get install dosfstools"
|
||||
fi
|
||||
|
||||
usage()
|
||||
{
|
||||
echo ""
|
||||
@@ -250,8 +261,17 @@ then
|
||||
|
||||
echo ""
|
||||
echo "Imaging the partition structure, copying $DD_COUNT megabytes..."
|
||||
sync
|
||||
dd if=/dev/mmcblk0 of=/dev/$DST_DISK bs=1M count=$DD_COUNT
|
||||
|
||||
# Partition was copied live so fsck to clean up for possible future
|
||||
# "Volume was not properly unmounted" warnings.
|
||||
if [ "$HAVE_FSCK_VFAT" = "yes" ]
|
||||
then
|
||||
echo "Running fsck on $DST_BOOT_PARTITION..."
|
||||
fsck -p $DST_BOOT_PARTITION &> /dev/null
|
||||
fi
|
||||
|
||||
# But, though Partion 1 is now imaged, partition 2 is incomplete and
|
||||
# maybe the wrong size for the destination SD card. So fdisk it to
|
||||
# make it fill the rest of the disk and mkfs it to clean it out.
|
||||
|
Reference in New Issue
Block a user