Last active
May 23, 2018 11:15
-
-
Save rifatx/b3edda7532d3b9ae9ba66f90d6d174c4 to your computer and use it in GitHub Desktop.
sd card backup, restore and partition resize
This file contains 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
#backup | |
dd bs=4M if=/dev/sdb | gzip > sdcard.gz | |
#restore | |
gzip -dc sdcard.gz | dd bs=4M of=/dev/sdb | |
#recreate partition | |
fdisk | |
p | |
# note start sector of partition 2 -> start | |
d | |
2 | |
n | |
p | |
2 | |
#<-start | |
#default | |
n | |
w | |
#check for errors & resize | |
umount /dev/sdb2 | |
e2fsck -f /dev/sdb2 | |
resize2fs /dev/sdb2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment