summaryrefslogtreecommitdiff
path: root/old-school/mdadm-dup.sh
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2016-04-28 00:21:24 -0400
committerAndrew Cady <d@jerkface.net>2016-04-28 00:21:24 -0400
commit3d24cae4b9897c17ddcfc4c4d8f150931d2d1f98 (patch)
tree4fab631dd40e06670469ac4ec7679fcc8079205c /old-school/mdadm-dup.sh
parent7cc1d2e6379fde13193f98114c1bfe4a8ec5f6d8 (diff)
more samizdat-eject fixes
also, copy samizdat-eject from the initramfs to the new rootfs (into /sbin)
Diffstat (limited to 'old-school/mdadm-dup.sh')
-rw-r--r--old-school/mdadm-dup.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/old-school/mdadm-dup.sh b/old-school/mdadm-dup.sh
index fe18e92..c13a325 100644
--- a/old-school/mdadm-dup.sh
+++ b/old-school/mdadm-dup.sh
@@ -38,7 +38,7 @@ dm_snapshot()
38 persist=p 38 persist=p
39 chunksize=16 39 chunksize=16
40 dmsetup create "$new_dev_name" --table "0 $size snapshot $ro_dev $rw_dev $persist $chunksize" || return 40 dmsetup create "$new_dev_name" --table "0 $size snapshot $ro_dev $rw_dev $persist $chunksize" || return
41 wait_for_dm_device /dev/mapper/"$new_dev_name"; 41 wait_for_dm_device /dev/mapper/"$new_dev_name"
42 echo /dev/mapper/"$new_dev_name" 42 echo /dev/mapper/"$new_dev_name"
43} 43}
44 44
@@ -54,7 +54,7 @@ dm_snapshot_teardown()
54 # errors ignored because the loop dev can be configured to be 54 # errors ignored because the loop dev can be configured to be
55 # automatically removed upon disuse 55 # automatically removed upon disuse
56 losetup -d /dev/block/"$rw_dev" || true 56 losetup -d /dev/block/"$rw_dev" || true
57 eject /dev/block/"$ro_dev" || exit 1 57 eject /dev/block/"$ro_dev" || true
58 ) || return 58 ) || return
59 ;; 59 ;;
60 *) return 1 ;; 60 *) return 1 ;;
@@ -106,7 +106,7 @@ mdadm_dup()
106{ 106{
107 local input_dev="$1" md_name="$2" sectors="$3" 107 local input_dev="$1" md_name="$2" sectors="$3"
108 108
109 mdadm --build $md_name ${sectors:+--size=$((sectors / 2))} \ 109 mdadm --build "$md_name" "${sectors:+--size=$((sectors / 2))}" \
110 --level=1 --raid-devices=1 --force --write-mostly "$input_dev" || return 110 --level=1 --raid-devices=1 --force --write-mostly "$input_dev" || return
111} 111}
112 112
@@ -132,6 +132,7 @@ cryptsetup_temp()
132 set $parms 132 set $parms
133 133
134 wait_for_dm_device /dev/mapper/"$cryptname" 134 wait_for_dm_device /dev/mapper/"$cryptname"
135 rm "$temp_file"
135 echo /dev/mapper/"$cryptname" 136 echo /dev/mapper/"$cryptname"
136} 137}
137 138
@@ -140,7 +141,6 @@ mdadm_copy_eject_crypt()
140 local md_dev="$1" temp_file="$2" 141 local md_dev="$1" temp_file="$2"
141 142
142 [ -b "$md_dev" ] || return 143 [ -b "$md_dev" ] || return
143 [ ! -e "$temp_file" ] || return
144 144
145 local output_dev sectors 145 local output_dev sectors
146 146