Ubuntu

environment block not implemented on btrfs

Reported by atreju on 2011-03-17
This bug affects 311 people
Affects Status Importance Assigned to Milestone
grub
New
Undecided
Unassigned
grub2 (Ubuntu)
Wishlist
Unassigned

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)

atreju (atreju-tauschinsky) wrote :

Confirmed here. Though my configuration is a bit different it gives the same behaviour as here above described.
I run Natty alpha3 amd64 with kernel 2.6.38-7-generic.

sudo fdisk -l responds with the following:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x57853315

   Device Boot Start End Blocks Id System
/dev/sda1 1 13 102400 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 13 2563 20480000 83 Linux
/dev/sda3 2563 54428 416603136 83 Linux
/dev/sda4 * 54428 60802 51198976 7 HPFS/NTFS

With /dev/sda1 mounted as /boot formatted as reiserfs, /dev/sda2 is also formatted as reiserfs and mounted as /
/dev/sda3 is an ext4 partition mounted as /home and /dev/sda4 is my Windows partition.

lunarok (lunarok) wrote :

I get the same problem.
I just received a SSD Disk, so I did a fresh install of Natty Alpha 3 and get the error since the first boot (2.6.38-5)
Update to be up 2 date change nothing (2.6.38-7 essentially)

I didn't remember getting this issue with my old disk before (I was already in Natty since it was avalaible by updating from 10.10)

Glen Ditchfield (gjditchfield) wrote :

Same problem in Kubuntu Desktop Desktop i386 (natty-deskitop-i386.iso 20110329.1)

tags: added: iso-testing
Changed in grub2 (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Colin Watson (cjwatson) wrote :

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.

Changed in grub2 (Ubuntu):
importance: Medium → Wishlist
status: Confirmed → Triaged
summary: - boot error: sparse file not allowed
+ environment block not implemented on btrfs

For reference here is Colin's post to grub-devel, no followups since 2011-02 it seems.

http://lists.gnu.org/archive/html/grub-devel/2011-02/msg00011.html

Changed in grub2 (Ubuntu Oneiric):
importance: Undecided → High
Colin Watson (cjwatson) on 2011-04-15
Changed in grub2 (Ubuntu Oneiric):
status: New → Triaged
importance: High → Wishlist

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu Natty (development branch)
Release: 11.04
Codename: natty
grub2:
  Installed: (none)
  Candidate: 1.99~rc1-13ubuntu1
  Version table:
     1.99~rc1-13ubuntu1 0
        500 http://gb.archive.ubuntu.com/ubuntu/ natty/universe i386 Packages

Same here. Seems to be a btrfs thing as I have never seen this and is the first time I have used btrfs.

Thanks, but there's no need to post further reproduction information to
this bug. This is a missing feature and we know about it.

Russell Phillips (ignissport) wrote :

I've also run into this bug. However, it's on a machine (server) with no GPU and no keyboard. It's a bit of an annoyance because it means that I'd need manual intervention to reboot the machine (e.g. after power failure, where it would usually come back up on its own).

Not to nag or anything... but it would be nice if my bootup were unattended. I'll leave a keyboard atop my server until it's fixed.

Colin Watson (cjwatson) wrote :

I think you can probably make it unattended for the time being by
editing /etc/grub.d/00_header, commenting out the following lines with a
leading # sign on each line, and then running update-grub:

  cat << EOF
  if [ -s \$prefix/grubenv ]; then
    set have_grubenv=true
    load_env
  fi
  EOF

This has the effect of disabling features like savedefault and the
system that forces the menu to be displayed if the previous boot failed;
but you aren't getting those features on btrfs right now anyway.

Russell Phillips (ignissport) wrote :

Thanks for the tip, Colin. However, I think simply removing my GPU had the same effect. It reboots unattended now.

Inaldo (inaldo) wrote :

Confirmed here in natty final version.

no Name (chris-std) wrote :

Confirmed in natty final (64bit) too.

Colin Watson (cjwatson) wrote :

See comment 8, and please don't post further confirmation messages to this bug report.

With the risk of sound like another "me too, waa waa", I just want to ask a question based on the piece of info in #5 ("and so we could use 1KB of it for an environment block") compared to the piece of info on https://help.ubuntu.com/community/btrfs ("take care to keep about 1 Mib space free at the beginning of the disk").

Will doing this (keeping a meg free at the beginning of the disk) work around this semi-error? I forgot to do so when installing, and while it installed just fine, I ended up with this error message at boot. Just want to know if re-installing with a bit of space reserved in the beginning would help.

Sorry if I'm butting in where I should keep quiet :)

Nevermind, on closer inspection, my disk has exactly 1 MB free at the beginning, as it's been partitioned with ubiquity and therefore follows the best-practice of 4k properly aligned sectors.

So to answer my own question: No, this does not change this particular issue - these two things are not related :)

Dan Dart (dandart) wrote :

Yet again confirmed - I added a new btrfs at the end of my disk - going to try again in ext4. Shame!

jcwinnie (jcwinnie) wrote :

I have a multi-boot system. Ubuntu Natty is on an ext4 partition. Boots with no error. Xubuntu 11.04 is on a btrfs partition and upon boot I get the same the error message:

'sparse file not allowed.
press any key to continue'

As Colin pointed out in #8, there's no need to add any more confirmations and "me too"s - the bug is known and being attended too.

I think it's a bit strange you consider this bug 'wishlist'. In server environment, where remote reboot is a must, it's quiet a showstopper. You might say no one using btrfs on servers. Maybe, but many servers using reiser (which is also affected).

Not booting after upgrade, well... I think its a very serius bug, not a 'wishlist'.

Colin Watson (cjwatson) wrote :

In my tests this did not actually impede automatic booting even though
it claims to require input.

In any case, new feature = wishlist. You should not take that to mean
that I consider it low priority.

Mathew (mathewc) wrote :

Correctly booting an operating system is a wish list :)
Is this effecting boot times?

amurphy (arielm0rph) wrote :

First time trying btrfs and I got the same error right after grub menu:
"error: sparse file not allowed. Press any key to continue ..."

I had another problem with the package apt-xapian-index refusing to configure on upgrade so I removed it and now the system merely hangs on the error above for a few seconds before booting without pressing any key ...

So is this a grub2 bug or a python bug?

Thanks.

Amedee Van Gasse (amedee) wrote :

Sorry for the "me too" comment, but I can confirm the bug for Oneiric beta 2.
Just so you know, because Oneiric wasn't mentioned yet.

Nicolas Diogo (nicolasdiogo) wrote :

First time trying btrfs and I got the same error right after grub menu:
 "error: sparse file not allowed. Press any key to continue ..."

same problem

after a few seconds the system boots but it is a bit sinister . . to have this message greeting users

Extasy (henrik-nyberg) wrote :

Same problem in final version of Oneiric.

adel (adel-abdullin) wrote :

Same problem in Ubuntu 11.10 32bit

ill (illumilore) wrote :

Is there a way to get grub2 to ignore this error?

This affects me (oneiric ocelot, amd64).
Can anybody test it on ubuntu precise(pre-alpha)?
If this error is still present in precise, it could be fixed before precise final will be released.

ubuntulyb (blogspot) wrote :

Same problem in Ubuntu 11.10 32bit

Gary M (garym) on 2011-11-10
tags: added: oneiric
Kangarooo Jānis (kangarooo) wrote :

I justclean installed 11.10 in / using btrfs and got same error
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000585b6

   Device Boot Start End Blocks Id System
/dev/sda1 * 261316608 312580095 25631744 7 HPFS/NTFS/exFAT
/dev/sda2 237316094 261316607 12000257 5 Extended
/dev/sda5 257316864 261316607 1999872 82 Linux swap / Solaris
/dev/sda6 237316096 257316863 10000384 83 Linux

Partition table entries are not in disk order

Sander Jonkers (jonkers) wrote :

I have the same problem with Precise Pangolin 12.04 Alpha 1 and a btrfs partition : immediately after the BIOS screen, I see a message "error: sparse file not allowed". After a few seconds, the Linux boots starts successfully.

Andrey Zaytsev (andzaytsev) wrote :

Every time I boot Ubuntu 11.10 on btrfs, I have to "press any key to continue". It is very annoying!

Andrey Zaytsev (andzaytsev) wrote :

Well, seems it boots even without pressing a key. But it boots too long...

wilbur.harvey (wilbur-harvey) wrote :

There are some other problems, not sure what they are.
I installed Oneiric on an BTRF partition and it has trouble booting, after
pressing the key it goes back to the BIOS quite often.
On the exact same machine, reinstalling to an EXT4 filesystem and it boots
every time.
I realize that this is not scientific or enough for a bug report, but maybe
it will be familiar to someone else.
Regards
Wilbur

On Wed, Dec 7, 2011 at 11:26 AM, Andrey Zaytsev
<email address hidden>wrote:

> Every time I boot Ubuntu 11.10 on btrfs, I have to "press any key to
> continue". It is very annoying!
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/736743
>
> Title:
> environment block not implemented on btrfs
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/grub/+bug/736743/+subscriptions
>

Same problem.

Ubuntu 12.04 LTS Beta 1 - 64 bits
Fresh install on btrfs formatted from Ubiquity

$ mount
/dev/sda1 on / type btrfs (rw,subvol=@)
...
/dev/sda1 on /home type btrfs (rw,subvol=@home)

Sven Romeike (lun4tic) wrote :

same problem on 32bit 12.04 Beta using btrfs. Installed from USB Stick.

Manveru (manveru) wrote :

It affect Precise Pangolin too with btrfs. Very annoying.

no longer affects: btrfs-grub2
Sven Romeike (lun4tic) wrote :

i don't know if its allready in there but btrfs should definately be marked as experimental in the final LTS if the problem persists until release

Thomas Juberg (thomas-juberg) wrote :

Just installed Precise Pangolin 64bit as a fresh install from USB using btrfs as filesystem for / and /home and have encountered the same issue.

kamahat (kamahat) wrote :

Same problem.

Ubuntu 12.04 LTS Beta 1 - 64 bits
Fresh install on btrfs formatted from Ubiquity

$ mount
/dev/sda1 on / type btrfs (rw,subvol=@)

Linux maria 3.2.0-23-lowlatency #31-Ubuntu SMP PREEMPT Wed Apr 11 02:24:03 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Gary M (garym) on 2012-04-14
tags: added: precise
andreas (a-ansorge) wrote :

again "sparse file not allowed"
but my system is *not* booting.

Ubuntu 12.04 LTS Beta 2 - 64 bits
     (Linux ubuntu 3.2.0-20-generic #33-Ubuntu SMP Tue Mar 27 16:42:26 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux)
on fresh SSD with one btrfs partition in the root (and not in a subvolume, what was intended)

Colin Watson's fixed seems to work for me ... after commenting out the lines suggested in 00_header and running update-grub it seems to have cleared it ...

GPT partition table
1) non-fs (bios_grub)
2) swap
3) btrfs (root mount)

kubuntu 12.04 3.2.0-23-generic on a AMD64 cpu

Bracken (abdawson) wrote :

Breakthrough!

Messing around with netdown in /etc/init.d/halt is a waste of time.

Shutting down like this:
  ifconfig eth0 down; shutdown -h now

WORKS!

Bracken (abdawson) wrote :

Gah, wrong defect, ignore.

Andrew (andrewkk) wrote :

Confirmed in Ubuntu 12.04 LTS 64-bit (final release) using the native btrfs option in Ubiquity.

erlinda urban (erlinda-urban) wrote :

Ubuntu 12.04 LTS 32-bit Final Version, using the btrfs format option during Installation.
but still encounter the o.g. Error Message. After a few second (or pressing any key) the system is booting with no further problems

Phillip Susi (psusi) wrote :

"me too" comments are not helpful. If you wish to make it known that you are affected by this, please check the "affects me" box at the top of the bug. This bug is well understood and needs no further input.

Jakob Kramer (jakobk) wrote :

Same problem with Xubuntu 12.04 (Precise Pangolin):

$ sudo fdisk -l
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000cb13b

   Device Boot Start End Blocks Id System
/dev/sda1 * 2048 48828415 24413184 83 Linux
/dev/sda2 48828416 52733951 1952768 82 Linux swap / Solaris
/dev/sda3 52733952 234440703 90853376 83 Linux
$

tags: added: quantal
Typhoe (spamistrash) wrote :

Quantal alpha 3 also affected...

Max (bubuta) wrote :

1.5 years to apply 4-line long patch...
confirmed in 12.04.1

Dimitri John Ledkov (xnox) wrote :

Well, it's not a patch. It's a workaround for those who have btrfs installed. The rest non-btrfs based systems still want those 4 lines. Please note that cjwatson is maintainer of grub2 and he proposed this as a dirty workaround not a solution that we can apply and upload into the archive.

no longer affects: grub2 (Ubuntu Oneiric)
Dimitri John Ledkov (xnox) wrote :

Reading the documentation [1] it leads to believe that load_env is excluded from certain type of systems. Yet reading the code I did not find those guards (maybe they are not explicit). In any case, until blocklists are implemented for btrfs, load_env should not stall the boot. Showing warnings is fine, but should not stall the boot. load_env can fail for many reasons outside of grub's control, but I don't see why this is so important to require user input.

I will try this again with recent 2.00 packages.

[1] http://www.gnu.org/software/grub/manual/html_node/Environment-block.html

Ivo Anjo (knuckles) wrote :

I don't like to comment when I don't have nothing to add, but I just did a 12.10 install with btrfs, and I would not consider "do not show an erroneous scary message to users that stalls boot every time" as wishlist/new feature.

The only wish here is "I wish this worked properly"...

TheOldFellow (theoldfellow) wrote :

Confirmed that this still exists in released Quantal.

grasscap (grasscap) wrote :

Still exist in kubuntu 12.10.

damahevi (damahevi) wrote :

Just upgraded to Kubuntu 12.10 - again the bug. However commenting out the lines in 00_header does not work anymore?

I have commented out these lines:
#cat << EOF
#if [ -s \$prefix/grubenv ]; then
# set have_grubenv=true
# load_env
#fi
#EOF

and_

# if [ -n "\${have_grubenv}" ]; then if [ -z "\${boot_once}" ]; then save_env recordfail; fi; fi

I also did not forget to issue a
sudo update-grub
afterwards.

Any Ideas?

Ivo Anjo (knuckles) wrote :

Comment 59:
The workaround did work for me on 12.10, but I only commented the first part (the lines from cat << EOF to EOF).

The second part wasn't needed.

klaib (klaib) wrote :

On comment 60 : Works for me MINT 14

Oscar Rivera (oscarivera9) wrote :

With a btrfs install, I started getting the grub screen with the error message:

'sparse file not allowed.
press any key to continue'

I tried the temporary "fix" by Colin on comment #10 which temporarily fixed the problem. After a few successfull boots without any error messages, I then began to get a different error message:

'recordfail...
press any key to continue'

I then tried what's suggested in bug 669481
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/669481
Unfortunately the problem was still there.
For now, everything is working ok. What I've done is follow the advice on comment #10 from this bug, but I've also removed the #s from /etc/grub.d/00_header where it says:

function recordfail {
   set recordfail=1
   if [ -n "\${have_grubenv}" ]; then if [ -z "\${boot_once}" ]; then save_env recordfail; fi; fi
}

Everything is working fine now.

Daniel Richard G. (skunk) wrote :

Short of implementing btrfs environment-block support for GRUB, we need a better workaround that doesn't involve manually hacking config files.

The scripts in /etc/grub.d/ can determine the type of the root filesystem---we see this in /etc/grub.d/10_linux, assigning to GRUBFS---so there's no reason why the workaround Colin gave in comment 10 cannot be automated.

I'm attaching a proof-of-concept patch, against /etc/grub.d/00_header as of Quantal, that conditionalizes inclusion of the grubenv code on the type of the root filesystem. If "/" is on btrfs, then a warning is printed, and an alternate bit of code is put into /boot/grub/grub.cfg.

Ubuntu folks: Can we get something like this in, for the time being? The "sparse file not allowed" error prompt is a rough edge that *needs* to go away.

The attachment "Proof-of-concept patch against /etc/grub.d/00_header" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
steve77 (funmaker-11) wrote :

I just rebuilt my system using Kubuntu 12.10. I thought I would try BTRFS. Now I get this same error message while booting. I hope this bug gets squashed soon.

ill (illumilore) wrote :

It's been a bug for two years now. It has a known, easy to implement fix. If the ubuntu devs wanted to fix it they would have done it a long time ago.

On 13-02-21 03:10 AM, ill wrote:
> It's been a bug for two years now. It has a known, easy to implement
> fix. If the ubuntu devs wanted to fix it they would have done it a long
> time ago.

Indeed. It's this apathy for the real problems real users have that is
driving me away from Ubuntu. All new installs are Fedora now.

I guess they are too focused on tablets and TVs any more.

+1

I'm suffering from this as well, and I'm very often under the impression that Ubuntu's bug reporting system is there for getting users complains and le it be, not for solving them.

Over years I filled hundreds of bug reports here, almost all of them never got any solution nor fix, until the upstream fixed things someday, probably without having ever heard about bugs posted here :-/

Aki Rossi (lorkki) wrote :

I can't speak for Ubuntu maintainers, but this _is_ a wishlist-priority bug concerning a file system that's still considered experimental, and a patch was recognised just under a month ago. I've been annoyed by this bug as well, but I doubt a little patience will kill anyone at this point.

GeekSmith (lixo-geeksmith) wrote :

Aki Rossi, is reiserfs considered experimental? If you've read the previous comments, you are aware this affects more than just btrfs. That alone should bump the priority up a notch or two.

Harald Glatt (hachre) wrote :

Also the fact that this bug is two years old means the time span for patience has long been left standing in the dust...

On 13-04-06 06:05 AM, Harald Glatt wrote:
> Also the fact that this bug is two years old means the time span for
> patience has long been left standing in the dust...

Patience for this bug to be fixed or patience with Ubuntu in general?

I know which one it is for me.

EricDHH (ericdhh) wrote :

13.04 amd64

First HAPPY BIRTHDAY for this bug!!!

Found a cool technical upgrade, cannot press the key due usb keyboard to override the message. So i have to wait the full timeout.

Will this ever be fixed?

volRot (info-rothert) wrote :

Error is also available in 13:10 (save file not allowed)
Perhaps eliminate mel?
After so many years, this can not be true.

volRot (info-rothert) wrote :

Sorry, (spare file not allowed)

tags: added: raring
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related blueprints