Public bug reported: Below is the script we're running. tune2fs doesn't set UUID (can be checked with blkid) and exits abnormally (so that commands after tune2fs call are not getting executed).
If we move tune2fs call above the mount command, everything works fine. Also, it works fine everywhere else including Ubuntu 16.04.3. #!/bin/bash set -e FOREMAN_SIZE=100 UUID="7b48ec41-a9fc-4937-b368-dfeae01c49f7" MNT=$(mktemp -d -t mnt.XXXXXXXXXX) trap "[[ -z "$MNT" ]] || rm -rf $MNT ||:" 0 1 2 3 15 if [[ -f foreman.tar.xz ]] && [[ ! -f foreman.img ]]; then echo "Creating \"foreman\" home image ..." qemu-img create -f raw -o size=${FOREMAN_SIZE}G foreman.img lo=$(sudo losetup --show -f foreman.img) echo -e "n\np\n\n\n\nw" | sudo fdisk $lo ||: sudo kpartx -asv $lo sudo mkfs.ext4 /dev/mapper/${lo##*/}p1 sudo mount /dev/mapper/${lo##*/}p1 $MNT sudo tar -C $MNT -Jxvf foreman.tar.xz sudo umount $MNT sudo tune2fs /dev/mapper/${lo##*/}p1 -U $UUID sudo kpartx -d $lo sudo losetup -d $lo fi ProblemType: Bug DistroRelease: Ubuntu 17.10 Package: e2fsprogs 1.43.5-1 ProcVersionSignature: Ubuntu 4.13.0-31.34-generic 4.13.13 Uname: Linux 4.13.0-31-generic x86_64 ApportVersion: 2.20.7-0ubuntu3.7 Architecture: amd64 CurrentDesktop: XFCE Date: Wed Jan 24 12:02:26 2018 InstallationDate: Installed on 2018-01-10 (14 days ago) InstallationMedia: Xubuntu 17.10 "Artful Aardvark" - Release amd64 (20171017.1) SourcePackage: e2fsprogs UpgradeStatus: No upgrade log present (probably fresh install) ** Affects: e2fsprogs (Ubuntu) Importance: Undecided Status: New ** Tags: amd64 apport-bug artful -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to e2fsprogs in Ubuntu. https://bugs.launchpad.net/bugs/1745186 Title: tune2fs doesn't set UUID on a loopback device after mount/unmount Status in e2fsprogs package in Ubuntu: New Bug description: Below is the script we're running. tune2fs doesn't set UUID (can be checked with blkid) and exits abnormally (so that commands after tune2fs call are not getting executed). If we move tune2fs call above the mount command, everything works fine. Also, it works fine everywhere else including Ubuntu 16.04.3. #!/bin/bash set -e FOREMAN_SIZE=100 UUID="7b48ec41-a9fc-4937-b368-dfeae01c49f7" MNT=$(mktemp -d -t mnt.XXXXXXXXXX) trap "[[ -z "$MNT" ]] || rm -rf $MNT ||:" 0 1 2 3 15 if [[ -f foreman.tar.xz ]] && [[ ! -f foreman.img ]]; then echo "Creating \"foreman\" home image ..." qemu-img create -f raw -o size=${FOREMAN_SIZE}G foreman.img lo=$(sudo losetup --show -f foreman.img) echo -e "n\np\n\n\n\nw" | sudo fdisk $lo ||: sudo kpartx -asv $lo sudo mkfs.ext4 /dev/mapper/${lo##*/}p1 sudo mount /dev/mapper/${lo##*/}p1 $MNT sudo tar -C $MNT -Jxvf foreman.tar.xz sudo umount $MNT sudo tune2fs /dev/mapper/${lo##*/}p1 -U $UUID sudo kpartx -d $lo sudo losetup -d $lo fi ProblemType: Bug DistroRelease: Ubuntu 17.10 Package: e2fsprogs 1.43.5-1 ProcVersionSignature: Ubuntu 4.13.0-31.34-generic 4.13.13 Uname: Linux 4.13.0-31-generic x86_64 ApportVersion: 2.20.7-0ubuntu3.7 Architecture: amd64 CurrentDesktop: XFCE Date: Wed Jan 24 12:02:26 2018 InstallationDate: Installed on 2018-01-10 (14 days ago) InstallationMedia: Xubuntu 17.10 "Artful Aardvark" - Release amd64 (20171017.1) SourcePackage: e2fsprogs UpgradeStatus: No upgrade log present (probably fresh install) To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/e2fsprogs/+bug/1745186/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp