tune2fs doesn't set UUID on a loopback device after mount/unmount
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
e2fsprogs (Ubuntu) |
New
|
Undecided
|
Unassigned |
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-
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=${
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/
sudo mount /dev/mapper/
sudo tar -C $MNT -Jxvf foreman.tar.xz
sudo umount $MNT
sudo tune2fs /dev/mapper/
sudo kpartx -d $lo
sudo losetup -d $lo
fi
ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: e2fsprogs 1.43.5-1
ProcVersionSign
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)