Skip to content

Instantly share code, notes, and snippets.

@AndreiCherniaev
Last active October 6, 2023 11:16
Show Gist options
  • Save AndreiCherniaev/12e360601b1bfe15cdb1e79ce3a8e31e to your computer and use it in GitHub Desktop.
Save AndreiCherniaev/12e360601b1bfe15cdb1e79ce3a8e31e to your computer and use it in GitHub Desktop.
safe dd check does usb drive size == 32GB and after dd .img
# never use this if you have 32 GB hard drive
# never use this if you mount 2 or more 32GB usb flash card in one time
varvar=`blockdev --getsize64 /dev/sda`
# 32GB == 30765219840
if [ $varvar -eq 30765219840 ]; then
dd if=disk.img of=/dev/sda bs=4M conv=fsync status=progress
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment