Last active
October 6, 2023 11:16
-
-
Save AndreiCherniaev/12e360601b1bfe15cdb1e79ce3a8e31e to your computer and use it in GitHub Desktop.
safe dd check does usb drive size == 32GB and after dd .img
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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