Dump all disk (include vd[a-z]) on Linux (work for mbr and gpt disk)
This commit is contained in:
parent
8c4be9fc0d
commit
d8b6fe9d87
|
@ -135,8 +135,12 @@ mkdir -p -m 700 /home/backup
|
||||||
|
|
||||||
## Dump MBR / table partitions with dd and sfdisk
|
## Dump MBR / table partitions with dd and sfdisk
|
||||||
## Linux
|
## Linux
|
||||||
# dd if=/dev/sda of=/home/backup/MBR bs=512 count=1 2>&1 | egrep -v "(records in|records out|512 bytes)"
|
#for disk in $(ls /dev/{s,v}d[a-z] 2>/dev/null); do
|
||||||
# sfdisk -d /dev/sda > /home/backup/partitions 2>&1 | egrep -v "(Warning: extended partition does not start at a cylinder boundary|DOS and Linux will interpret the contents differently)"
|
# name=$(basename $disk)
|
||||||
|
# dd if=$disk of=/home/backup/MBR-$name bs=512 count=1 2>&1 | egrep -v "(records in|records out|512 bytes)"
|
||||||
|
# fdisk -l $disk > /home/backup/partitions-$name
|
||||||
|
#done
|
||||||
|
#cat /home/backup/partitions-* > /home/backup/partitions
|
||||||
## OpenBSD
|
## OpenBSD
|
||||||
# disklabel sd0 > /home/backup/partitions
|
# disklabel sd0 > /home/backup/partitions
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue