问题描述
我安装了Ubuntu,但未创建交换分区,而在btrfs上安装了/
。#现在,每次启动时都收到消息“不允许稀疏文件”。该消息出现在splash-screen之前。有没有办法消除此警告?
最佳方案
确定后,我发现一个how-to也至少暂时摆脱了这个问题,这很简单,但是我没有带btrfs的系统set-up,所以我无法确认此修复程序。
注释掉或删除此行:
if [ -n ${have_grubenv} ]; then save_env recordfail; fi
要么
if [ -n "\${have_grubenv}" ]; then if [ -z "\${boot_once}" ]; then save_env \
recordfail; fi; fi
在这个文件中
/etc/grub.d/00_header
然后跑
update-grub
不直接编辑/boot/grub/grub.cfg
的原因是,每次grub更新时,它都会被覆盖,在这种情况下,如果grub通用软件包已更新,则只需要”re do”修复即可。
如果要添加自己,这是启动板上的错误bug #736743
在错误报告中引用Colin Watson
This is actually a misleading error message: what’s happening is that GRUB’s btrfs implementation doesn’t implement the file read hook interface for returning blocklists to calling code. I posted to grub-devel about this and the upstream maintainer pointed out that, even aside from multi-device problems, writing to btrfs from GRUB is fundamentally risky because:
the same block may be used by multiple snapshots every tree which uses a given block will contain its checksum, and so on recursively
However, btrfs reserves space at the start for the boot loader. This space is more than GRUB needs to embed itself, and so we could use 1KB of it for an environment block.
In any case, this is not a new problem that arose from using subvolumes, nor does it prevent booting (you get a spurious “Press any key to continue” prompt, but if you just ignore it it’ll boot anyway). Downgrading to wishlist.
希望这可以帮助