root@ubuntu:~# bash -x ./test-bcache-byuuid-links.sh + mountpoint /mnt /mnt is a mountpoint + umount -f /mnt + '[' -e /dev/bcache0 ']' + wipefs -a /dev/bcache0 /dev/bcache0: 2 bytes were erased at offset 0x00000438 (ext4): 53 ef + true ++ ls /sys/class/block/bcache0/bcache/stop + bdev_stop=/sys/class/block/bcache0/bcache/stop + '[' -n /sys/class/block/bcache0/bcache/stop -a -e /sys/class/block/bcache0/bcache/stop ']' + echo 'writing 1 to /sys/class/block/bcache0/bcache/stop' writing 1 to /sys/class/block/bcache0/bcache/stop + echo 1 + udevadm settle + sleep 1 + true ++ ls /sys/class/block/bcache0/bcache/stop ls: cannot access '/sys/class/block/bcache0/bcache/stop': No such file or directory + bdev_stop= + '[' -n '' -a -e '' ']' + break + true ++ ls /sys/fs/bcache/06727454-1020-4b7b-99ef-14789f7f7f3b/stop + cdev_stop=/sys/fs/bcache/06727454-1020-4b7b-99ef-14789f7f7f3b/stop + '[' -n /sys/fs/bcache/06727454-1020-4b7b-99ef-14789f7f7f3b/stop -a -e /sys/fs/bcache/06727454-1020-4b7b-99ef-14789f7f7f3b/stop ']' + echo 'writing 1 to /sys/fs/bcache/06727454-1020-4b7b-99ef-14789f7f7f3b/stop' writing 1 to /sys/fs/bcache/06727454-1020-4b7b-99ef-14789f7f7f3b/stop + echo 1 + udevadm settle + sleep 1 + true ++ ls '/sys/fs/bcache/*-*-*-*/stop' ls: cannot access '/sys/fs/bcache/*-*-*-*/stop': No such file or directory + cdev_stop= + '[' -n '' -a -e '' ']' + break + (( x=0 )) + (( x<50 )) + wipefs -a /dev/sdc /dev/sdc: 16 bytes were erased at offset 0x00001018 (bcache): c6 85 73 f6 4e 1a 45 ca 82 65 f5 7f 48 ba 6d 81 + rc=0 + '[' 0 = 0 ']' + break + '[' 0 '!=' 0 ']' + (( x=0 )) + (( x<50 )) + wipefs -a /dev/sdb /dev/sdb: 16 bytes were erased at offset 0x00001018 (bcache): c6 85 73 f6 4e 1a 45 ca 82 65 f5 7f 48 ba 6d 81 + rc=0 + '[' 0 = 0 ']' + break + '[' 0 '!=' 0 ']' + make-bcache --wipe-bcache -C /dev/sdc -B /dev/sdb UUID: 59306fe6-b5fd-439b-bea3-df7ee65d0b8d Set UUID: 89103ca3-a773-4fca-a456-f10bd3ea17b2 version: 0 nbuckets: 20480 block_size: 1 bucket_size: 1024 nr_in_set: 1 nr_this_dev: 0 first_bucket: 1 UUID: 8b8fb68a-8f3c-46ba-b656-0442b511bfe7 Set UUID: 89103ca3-a773-4fca-a456-f10bd3ea17b2 version: 1 block_size: 1 data_offset: 16 + udevadm settle --exit-if-exists /dev/bcache0 + '[' '!' -e /dev/bcache/by-uuid ']' + ls -al /dev/bcache/by-uuid/ total 0 drwxr-xr-x 2 root root 60 Feb 4 23:30 . drwxr-xr-x 3 root root 60 Feb 4 23:30 .. lrwxrwxrwx 1 root root 13 Feb 4 23:30 8b8fb68a-8f3c-46ba-b656-0442b511bfe7 -> ../../bcache0 + echo 'Creating filesystems on bcache0' Creating filesystems on bcache0 + mkfs.ext4 /dev/bcache0 mke2fs 1.45.3 (14-Jul-2019) Discarding device blocks: done Creating filesystem with 2621438 4k blocks and 655360 inodes Filesystem UUID: 48988989-b276-42c1-b999-e29928353796 Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632 Allocating group tables: done Writing inode tables: done Creating journal (16384 blocks): done Writing superblocks and filesystem accounting information: done + echo 'mounting bcache0 to /mnt' mounting bcache0 to /mnt + mount /dev/bcache0 /mnt + udevadm settle --exit-if-exists /dev/bcache0 + '[' '!' -e /dev/bcache/by-uuid ']' + echo 'bcache0 mounted and /dev/bcache/by-uuid does not exist!' bcache0 mounted and /dev/bcache/by-uuid does not exist! + exit 2