[Bug 736743] Re: environment block not implemented on btrfs
EmanueL Czirai
emanueLczirai at cryptoLab.net
Sun Jan 11 09:13:11 UTC 2015
Maybe I'm missing something(ubuntu specific?), but I can't believe no
one mentioned this simple obvious workaround yet (tested to work on
Gentoo with btrfs /boot on separate partition):
GRUB_SAVEDEFAULT=false
in your /etc/default/grub
(must rerun Grub after this change, depending on your OS (I'm not on
Ubuntu): ie. (Arch/Manjaro)$ sudo update-grub or (Gentoo)#
grub2-mkconfig -o /boot/grub/grub.cfg )
Now the `error: sparse file not allowed.` is gone because there's no
attempt made to write to the file /boot/grub/grubenv anymore, as were
the case when GRUB_SAVEDEFAULT=true
Optionally, also avoid using GRUB_DEFAULT=saved unless you understand
what it does if you do. I'm using GRUB_DEFAULT=0 (to have the cursor
always be positioned on the first entry in the menu)
Cheers.
E.
I'm copy/pasting relevant `info grub` here to save you some time(in case
you were not going to look this up anyway):
`GRUB_DEFAULT'
The default menu entry. This may be a number, in which case it
identifies the Nth entry in the generated menu counted from zero,
or the title of a menu entry, or the special string `saved'.
Using the id may be useful if you want to set a menu entry as the
default even though there may be a variable number of entries
before it.
For example, if you have:
menuentry 'Example GNU/Linux distribution' --class gnu-linux --id example-gnu-linux {
...
}
then you can make this the default using:
GRUB_DEFAULT=example-gnu-linux
Previously it was documented the way to use entry title. While
this still works it's not recommended since titles often contain
unstable device names and may be translated
If you set this to `saved', then the default menu entry will be
that saved by `GRUB_SAVEDEFAULT' or `grub-set-default'. This
relies on the environment block, which may not be available in all
situations (*note Environment block::).
The default is `0'.
`GRUB_SAVEDEFAULT'
If this option is set to `true', then, when an entry is selected,
save it as a new default entry for use by future runs of GRUB.
This is only useful if `GRUB_DEFAULT=saved'; it is a separate
option because `GRUB_DEFAULT=saved' is useful without this option,
in conjunction with `grub-set-default'. Unset by default. This
option relies on the environment block, which may not be available
in all situations (*note Environment block::).
15.2 The GRUB environment block
===============================
It is often useful to be able to remember a small amount of information
from one boot to the next. For example, you might want to set the
default menu entry based on what was selected the last time. GRUB
deliberately does not implement support for writing files in order to
minimise the possibility of the boot loader being responsible for file
system corruption, so a GRUB configuration file cannot just create a
file in the ordinary way. However, GRUB provides an "environment
block" which can be used to save a small amount of state.
The environment block is a preallocated 1024-byte file, which
normally lives in `/boot/grub/grubenv' (although you should not assume
this). At boot time, the `load_env' command (*note load_env::) loads
environment variables from it, and the `save_env' (*note save_env::)
command saves environment variables to it. From a running system, the
`grub-editenv' utility can be used to edit the environment block.
For safety reasons, this storage is only available when installed on
a plain disk (no LVM or RAID), using a non-checksumming filesystem (no
ZFS), and using BIOS or EFI functions (no ATA, USB or IEEE1275).
`grub-mkconfig' uses this facility to implement `GRUB_SAVEDEFAULT'
(*note Simple configuration::).
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/736743
Title:
environment block not implemented on btrfs
Status in GRand Unified Bootloader:
New
Status in grub2 package in Ubuntu:
Triaged
Bug description:
Binary package hint: grub2
I just installed natty alpha 3 on a samsung NC10 netbook. When booting, immediately after the grub screen I see the error message:
'sparse file not allowed.
press any key to continue'
after pressing any key the boot continues as normal.
This is with btrfs on / and a separate ext4 partition for /home. I had
created the btrfs partition manually (i.e. in a shell outside
ubiquity) simply running mkfs.btrfs /dev/sda1 and it was not
reformatted in ubiquity.
ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: grub-pc 1.99~rc1-4ubuntu1
ProcVersionSignature: Ubuntu 2.6.38-6.34-generic 2.6.38-rc7
Uname: Linux 2.6.38-6-generic i686
Architecture: i386
Date: Thu Mar 17 11:14:52 2011
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Alpha i386 (20110302)
ProcEnviron:
LANGUAGE=en_GB:en
LANG=en_US.UTF-8
LC_MESSAGES=en_GB.UTF-8
SHELL=/bin/bash
SourcePackage: grub2
UpgradeStatus: No upgrade log present (probably fresh install)
To manage notifications about this bug go to:
https://bugs.launchpad.net/grub/+bug/736743/+subscriptions
More information about the foundations-bugs
mailing list