]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
Debian: erase-other-disks: rescan partition tables after erasing whole disk
authorIan Campbell <ian.campbell@citrix.com>
Wed, 20 Jan 2016 15:06:21 +0000 (15:06 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 20 Jan 2016 16:39:59 +0000 (16:39 +0000)
This appears to happen anyway, but force it to be sure.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/Debian.pm

index 20f3de7483139b5a3e1c3e33468d8238e107f74e..e7b553843452971d5dd8d38d5d104153ac4de8d7 100644 (file)
@@ -1053,6 +1053,14 @@ zero () {
     fi
 }
 
+rescan () {
+    if ! test -b \${dev}; then
+       return
+    fi
+    log "Rescaning partition table on \${dev}"
+    echo 1 > /sys/block/\${dev#/dev/}/device/rescan
+}
+
 udevadm settle
 for sd in sd hd; do
     log "\${sd} devices present before: `echo /dev/\${sd}*`"
@@ -1063,6 +1071,7 @@ for sd in sd hd; do
 
         dev=/dev/\${sd}\${b}
         zero
+        rescan
     done
     udevadm settle
     log "\${sd} devices present after: `echo /dev/\${sd}*`"