summaryrefslogtreecommitdiff
path: root/nfs/scripts/image_capture_I6510.sh
blob: 7a0fd4aa72cba354414b9576300e30bbcf8fd82a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/busybox sh
# Should only started from image_capture.sh, it defines some helper functions and variables)
# echo_color() <text-color> <background-color> <message>
# $outdir is the also the current working dir, garanted to be empty and writable
# Many cloning/partitioning tools are available for use, see make-boot-image.sh

echo_color white blue ">>> Capturing ${firstdisk} boot sectors"
dd if=${firstdisk} count=2048 2>logs/sda-dd.log | pigz --fast > sda-dd.gz 2>logs/sda-pigz.log

echo_color white blue ">>> Capturing ${firstdiskp}1 NTFS WinRecovery"
partclone.ntfs --clone -s ${firstdiskp}1 -L logs/sda1-partclone.log --no_check | pigz --fast >sda1-partclone.gz 2>logs/sda1-pigz.log

echo_color white blue ">>> Capturing ${firstdiskp}2 FAT32 EFI"
partclone.vfat --clone -s ${firstdiskp}2 -L logs/sda2-partclone.log --no_check | pigz --fast >sda2-partclone.gz 2>logs/sda2-pigz.log

echo_color white blue ">>> Capturing ${firstdiskp}3 RAW M$ Reserved"
dd if=${firstdiskp}3 2>logs/sda3-dd.log | pigz --fast >sda3-dd.gz 2>logs/sda3-pigz.log

#echo_color white blue ">>> Capturing ${firstdiskp}4 NTFS Win10"
#partclone.ntfs --clone -s ${firstdiskp}4 -L logs/sda4-partclone.log --no_check | pigz --fast >sda4-partclone.gz 2>logs/sda4-pigz.log

echo_color white blue ">>> Capturing ${firstdiskp}5 EXT4 LINUX"
partclone.ext4 --clone -s ${firstdiskp}5 -L logs/sda5-partclone.log --no_check | pigz --fast >sda5-partclone.gz 2>logs/sda5-pigz.log

echo_color white blue ">>> Capturing ${firstdiskp}6 Swap"
dd if=${firstdiskp}6 2>logs/sda6-dd.log | pigz --fast >sda6-dd.gz 2>logs/sda6-pigz.log

echo_color white blue ">>> End of capture"