Skip to content
Commit 9e680d0a authored by Yann E. MORIN's avatar Yann E. MORIN Committed by Peter Korsgaard
Browse files

fs/ext2: fix generation of ext4 filesystems



cset 7a58a4ea (e2fsprogs: bump to version 1.42.9) broke the generation
of ext4 filesystems.

This is because, in ext4, some metadata are dependent on the UUID.
If changing the UUID of an ext4 filesystem, tune2fs now exits with
exit-code 1, and prints a message to run fsck, to avoid trashing the
filesystem.

This condition is of utmost importance on a mounted filesysten (which
is not our case) to avoid corruption (yes, it is possible to change
the UUID of a mounted filesystem).

But the error is not valid for us, since we are working on an unmonted
filesystem image in the first place.

Since we change the UUID after we convert the filesystem (to ext4),
tune2fs just bails out.

We can not just ignore the exit code of tune2fs, since we still want
to catch any other failure.

It turns out that, changing the UUID before converting the filesystem
is just the way to go.

Fixes #6752.

Reported-by: default avatarDaniel Mentz <daniel@exxm.de>
Signed-off-by: default avatar"Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Daniel Mentz <daniel@exxm.de>
Signed-off-by: default avatarPeter Korsgaard <peter@korsgaard.com>
parent a5c4cde8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment