[Bug 2081163] Please test proposed package
Timo Aaltonen
2081163 at bugs.launchpad.net
Fri Nov 15 12:25:21 UTC 2024
Hello gerald.yang, or anyone else affected,
Accepted xfsprogs into focal-proposed. The package will build now and be
available at
https://launchpad.net/ubuntu/+source/xfsprogs/5.3.0-1ubuntu2.1 in a few
hours, and then in the -proposed repository.
Please help us by testing this new package. See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
to enable and use -proposed. Your feedback will aid us getting this
update out to other Ubuntu users.
If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested, what testing has been
performed on the package and change the tag from verification-needed-
focal to verification-done-focal. If it does not fix the bug for you,
please add a comment stating that, and change the tag to verification-
failed-focal. In either case, without details of your testing we will
not be able to proceed.
Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in
advance for helping!
N.B. The updated package will be released to -updates after the bug(s)
fixed by this package have been verified and the package has been in
-proposed for a minimum of 7 days.
--
You received this bug notification because you are a member of Ubuntu
Sponsors, which is subscribed to the bug report.
https://bugs.launchpad.net/bugs/2081163
Title:
fix fsck.xfs run by different shells when fsck.mode=force is set
Status in xfsprogs package in Ubuntu:
Fix Released
Status in xfsprogs source package in Focal:
Fix Committed
Status in xfsprogs source package in Jammy:
Fix Committed
Status in xfsprogs source package in Noble:
Incomplete
Status in xfsprogs source package in Oracular:
Fix Committed
Status in xfsprogs source package in Plucky:
Fix Released
Bug description:
[Impact]
tl;dr: fsck.mode=force is not correctly applied in the initramfs, causing XFS to not be checked or repaired.
When fsck.mode=force is specified in the kernel command line, fsck.xfs
is executed during the boot process. However, when the default shell is
not bash, $PS1 should be a different value, consider the following script:
cat ps1.sh
echo "$PS1"
run ps1.sh with different shells:
ash ./ps1.sh
$
bash ./ps1.sh
dash ./ps1.sh
$
ksh ./ps1.sh
zsh ./ps1.sh
On systems like Ubuntu, where dash is the default shell during the boot
process to improve startup speed. This results in FORCE being incorrectly
set to false and then xfs_repair is not invoked:
if [ -n "$PS1" -o -t 0 ]; then
FORCE=false
fi
Other distros may encounter this issue too if the default shell is set
to anoother shell.
Check "-t 0" is enough to determine if we are in interactive mode, and
xfs_repair is invoked as expected regardless of the shell used.
[Test Case]
1. install Ubuntu Focal with two disks (one for the system, the other for test xfs partition)
2. create partition and xfs file system on the second drive (in my case it is /dev/vdb (the disk), /dev/vdb1 (the xfs partition))
3. create mount point dir (ie, /data) and add appropriate line to the /etc/fstab, ie:
/dev/vdb1 /data xfs defaults 0 2
4. sudo mount --all to test the above, next: sudo umount /data
5. break the xfs fs on /dev/vdb1:
sudo xfs_db -x -c blockget -c "blocktrash -s 512109 -n 1000" /dev/vdb1
6. verify it's broken:
sudo mount --all
7. add the "fsck.mode=force" to the kernel boot option in grub (/etc/default/grub):
GRUB_CMDLINE_LINUX_DEFAULT="console=tty1 console=ttyS0 fsck.mode=force"
8. sudo update-grub
9. reboot the system and make sure xfs is repaired
[Where things could go wrong]
The patche removes $PS1 check, "-t 0" is already enough to determine if it's in interactive mode in different shells, check $PS1 is more likely causing unexpected issues mentioned above, in this case, this change won't cause other issues.
This has been merged into upstream:
https://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git/commit/?h=for-next&id=19dde7fac0f38af2990e367ef4dd8ec512920c12
[ Original Bug Report ]
https://bugs.launchpad.net/ubuntu/+source/xfsprogs/+bug/2071474
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/xfsprogs/+bug/2081163/+subscriptions
More information about the Ubuntu-sponsors
mailing list