This message occurs when leaving the Grub menu and before the Ubuntu splash screen.
How do I fix the problem to clear the message?
And what doe is it mean?
error: Diskfilter writes are not supported
System boots and seems to work just fine.
14.04bootgrub2
This message occurs when leaving the Grub menu and before the Ubuntu splash screen.
How do I fix the problem to clear the message?
And what doe is it mean?
error: Diskfilter writes are not supported
System boots and seems to work just fine.
Best Answer
It's a BUG!
This is a bug that occurs in the most recent version of Ubuntu Server LTS (Ubuntu Server 14.04 LTS), when you create the boot partition (or the root partition, when the boot partition doesn't exists) inside a LVM or a RAID partition.
You can get more info about this bug in Ubuntu Launchpad: Bug #1274320 "Error: diskfilter writes are not supported".
Update: This bug is already fixed in Ubuntu Server 14.04 and some newer Ubuntu versions. Probably, you only need to run
apt-get upgrade
.Why does this bug occur?
When the system is booting, GRUB reads (
load_env
) data in/boot/grub/grubenv
. This file is called GRUB Environment Block.From the GRUB Manual:
This behavior can be founded in
/etc/grub.d/00_header
(update-grub
uses this file to generate the/boot/grub/grub.cfg
file):The problem is that the
save_env
statement only works in simple installations (you can't runsave_env
inside a RAID or LVM disk). From the GRUB manual:The GRUB recordfail feature uses the
save_env
statement to update the recordfail state (see Ubuntu Help - Grub 2, "Last Boot Failed or Boot into Recovery Mode" section). However, in Ubuntu 14.04 (and in recent Debian versions), thesave_env
statement (inside the recordfail feature) is used even if GRUB is installed in a LVM or a RAID.Let's see the lines from 104 to 124 in
/etc/grub.d/00_header
:GRUB correctly skips the recordfail feature when using unsupported filesystems (btrfs, zfs, etc), but it doesn't skip LVM and RAID at any moment.
How does GRUB protect itself from writing inside RAID and LVM?
To read/write correctly in a filesystems, GRUB loads an appropriate module.
GRUB uses the diskfilter module (
insmod diskfilter
) in RAID partitions, and the lvm module in LVM partitions.Let's see the read/write implementation of the diskfilter module:
I'm pasting the code here (lines from 808 to 823). The warning showed in this question appears at line 821:
The
grub_diskfilter_read
function is implemented (and GRUB can read RAID filesystems). However, thegrub_diskfilter_write
function raises aGRUB_ERR_NOT_IMPLEMENTED_YET
error.Why does using
quick_boot=0
solve the problem? And why is it the wrong solution?If you look one more time in the
/etc/grub.d/00_header
code, you will see that the recordfail featured is only used whenquick_boot=1
. So, changingquick_boot
from 1 to 0 disables the recordfail feature, and disables writes in the RAID/LVM partition.However, it'll disable many other features too (run
grep \$quick_boot /etc/grub.d/*
and you'll see). More yet, if one day you change your/boot/grub
directory to outside the RAID/LVM, the recordfail feature will still disabled.Summarily, this solution unnecessarily disables features, and it's not generic.
What is the correct solution?
The correct solution should consider disable the
save_env
statements when GRUB is inside LVM or RAID partitions.One patch was proposed in the Debian Bug Tracker system to implement this solution. It can be found in: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=754921
The idea behind this patch is:
grub-probe --target=abstraction "${grubdir}"
command to get what kind of abstraction modules GRUB uses to read/write files in the/boot/grub
directory;diskfilter
orlvm
module, skip the recordfailsave_env
statement and write an appropriated comment in the/boot/grub/grub.cfg
file;# GRUB lacks write support for /dev/md0, so recordfail support is disabled.
How to apply the correct solution?
If you don't want to wait for this patch be applied by the Ubuntu/Debian guys in the official code, you can use my patched
00_header
: