Mount xfs image with -o nouuid 01/50901/1
authorAlex Yang <yangyang1@zte.com.cn>
Mon, 22 Jan 2018 06:44:41 +0000 (14:44 +0800)
committerAlex Yang <yangyang1@zte.com.cn>
Mon, 22 Jan 2018 06:44:41 +0000 (14:44 +0800)
In [1], an error occured:
"XFS (dm-6): Filesystem has duplicate UUID ... - can't mount".

[1]: https://build.opnfv.org/ci/job/daisy-deploy-zte-pod9-daily-master/11/console

Change-Id: I84052f481662e370ef8d41d62d356ad9a5e6e3c2
Signed-off-by: Alex Yang <yangyang1@zte.com.cn>
tools/daisy-img-modify.sh

index 43fd186..8b3a21f 100755 (executable)
@@ -177,7 +177,13 @@ setup() {
     sleep 2
     dmsetup ls
     fdisk -l /dev/${loopdevice:0:5} || true
-    mount /dev/mapper/$loopdevice $mountdir
+
+    if [ "xfs" = "$(blkid -o value -s TYPE /dev/mapper/$loopdevice)" ]; then
+        mountopts="-o nouuid"
+    else
+        mountopts=""
+    fi
+    mount $mountopts /dev/mapper/$loopdevice $mountdir
     mount -t proc none ${mountdir}/proc
 
     if [[ -n $img_size ]]; then