You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
371 B
21 lines
371 B
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
if [ "$#" -ne 3 ]; then
|
|
echo "$0 src.img head.img tail.img" >&2
|
|
exit 1
|
|
fi
|
|
|
|
srcimg=$1
|
|
headimg=$2
|
|
tailimg=$3
|
|
|
|
disksize=$(stat -c %s $srcimg)
|
|
|
|
mycount=`expr $disksize \/ 1024 \/ 1024 - 1`
|
|
|
|
dd if=$srcimg of=$headimg ibs=1M obs=1M count=1
|
|
dd if=$srcimg of=$tailimg ibs=1M obs=1M count=1 skip=$mycount
|
|
#dd if=/dev/zero of=file.txt count=3083 bs=1M
|