error: sparse file not allowed with reiserfs

Bug #464743 reported by Kevin Rogers on 2009-10-30
112
This bug affects 25 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Undecided
Unassigned

Bug Description

Binary package hint: grub-pc

I have just upgraded my laptop to Ubuntu 9.10 and thought I would try to switch to Grub2. I followed the instructions from https://help.ubuntu.com/community/Grub2 and the installation did not show any errors. The version of grub-pc that was installed was 1.97~beta4-1ubuntu3

When I rebooted, I got the legacy grub menu and chose the "Chainload" option. The Grub 2 menu screen came up, with the choices I expected for Ubuntu, Memory test and Windows. When I select the "Ubuntu, Linux 2.6.31-14-generic" option, grub shows:

error: sparse files not allowed

Press any key to continue.

I tried the options for "Memory test" and "Windows", which worked just fine. I followed the instructions at

https://help.ubuntu.com/community/Grub2#Command Line & Rescue Mode

specifically, I dropped to the command line mode and issued the following commands:

set root=(hd0,3)
linux /boot/vmlinuz-2.6.31-14-generic root=/dev/sda3 ro
initrd /boot/initrd.img-2.6.31-14-generic
boot

and the system booted... I then rebooted and chose to edit the "Ubuntu, Linux 2.6.31-14-generic" grub 2 menu entry. Looking through all the commands, I chose to remove the following lines:

recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi

when I removed these entries, the system booted just fine.

I have no idea why these two lines would cause a problem, but they appear to. It is not clear if I would have had this problem if I had performed a fresh install of 9.10, but I expect I would have - which would have landed less technical users with an unusable Ubuntu installation!

Related branches

Odd - we didn't see this in any of our pre-release testing (which
included quite a number of from-scratch installations and upgrades, of
course). What filesystem type are you using for /boot?

I have a simple partitioning scheme, one root and one swap. The root partition is:

/dev/sda3 on / type reiserfs (rw,noatime)

billbear (ninth-9) wrote :

I backed up a 9.10 install ( without backing up /boot/grub ), then restored the backup to a reiserfs partition on another machine, and chroot into it to run "grub-install /dev/sda" and "update-grub". After reboot I saw this:

error: sparse file not allowed
Failed to boot default entries.

Even worse, I can not enter the grub2 command line. Booted from CD I removed those two lines Kevin mentioned and ubuntu boots ok. After booting into ubuntu i ran "grub-install /dev/sda" and "update-grub" and everything went ok.

I tried to repeat the process:
restored the backup ( without /boot/grub ) to a reiserfs partition on another machine, and chroot into it to run "grub-install /dev/sda" TWICE and then "update-grub", it boots ok.
on other filesystems, ext2,3,4,xfs,jfs, grub-install only once will work, but reiser need to do this twice. I have had similar problems with grub 0.97 on reiserfs, grub-install also need to run twice.

Steve Newcomb (srn-coolheads) wrote :

I have a similar bug after running

grub-install /dev/sde
update-grub

It doesn't seem to matter how many times I run these commands, unlike billBear's experience. Booting doesn't happen until I get rid of those two lines that are identified above:

recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi

I am running reiserfs on a raid5 (/dev/md1) mounted on /.

Steve Newcomb (srn-coolheads) wrote :

This is still broken, and it's quite a serious matter because when I upgrade the machine (which sometimes overwrites /boot/grub/grub.cfg) and reboot, I lose access to it. It can't boot unless someone is physically present with the machine, who can remove the lines

recordfail=1
if [ -n ${have_grubenv} ]; then save_env recordfail; fi

from the boot script. Frequently, there's nobody where the machine is, so it remains totally useless, while chewing up watt-hours, with "Error: sparse file not allowed" displayed on the console.

Is there something I can do to help debug this mystery? I'd be happy to do what I can to help!

Linux qat 2.6.31-16-generic #53-Ubuntu SMP Tue Dec 8 04:02:15 UTC 2009 x86_64 GNU/Linux

Am Samstag, den 12.12.2009, 19:31 +0000 schrieb Steve Newcomb:
> Is there something I can do to help debug this mystery? I'd be happy
> to
> do what I can to help!

With reiserfs you can mount the filesystem with notail option.
Then delete /boot/grub/grubenv and create it again with `sudo
grub-editenv create'
Maybe there's some way to tell the system to create the env file without
tail packing
Hm or we should just revert the change of Okuji to make it only 1024
bytes big instead of initial 8192.

--
Felix Zielcke
Proud Debian Maintainer and GNU GRUB developer

I had the same issue.

I use reiserfs too.
> With reiserfs you can mount the filesystem with notail option
Indeed, adding "-o notail" after "mount" in the command fixes it.
See also the note about the notail option in the man page of mount.

But the following pages (at least) do not mention it :
https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20LiveCD
https://wiki.ubuntu.com/Grub2#Recover%20Grub%202%20via%20LiveCD

I think they should. But (again) they are difficult to edit.

Launchpad Janitor (janitor) wrote :
Download full text (4.0 KiB)

This bug was fixed in the package grub2 - 1.98-1ubuntu1

---------------
grub2 (1.98-1ubuntu1) lucid; urgency=low

  * Resynchronise with Debian (bug-fixes relative to previous snapshot
    release). Remaining changes:
    - Adjust for default Ubuntu boot options ("quiet splash").
    - Default to hiding the menu; holding down Shift at boot will show it.
    - Set a monochromatic theme for Ubuntu.
    - Apply Ubuntu GRUB Legacy changes to legacy update-grub script: title,
      recovery mode, quiet option, tweak how memtest86+ is displayed, and
      use UUIDs where appropriate.
    - Conflict with grub (<< 0.97-54) as well as grub-legacy.
    - Fix backslash-escaping in merge_debconf_into_conf.
    - Remove "GNU/Linux" from default distributor string.
    - Add crashkernel= options if kdump and makedumpfile are available.
    - If other operating systems are installed, then automatically unhide
      the menu. Otherwise, if GRUB_HIDDEN_TIMEOUT is 0, then use keystatus
      if available to check whether Shift is pressed. If it is, show the
      menu, otherwise boot immediately. If keystatus is not available, then
      fall back to a short delay interruptible with Escape.
    - Allow Shift to interrupt 'sleep --interruptible'.
    - Don't display introductory message about line editing unless we're
      actually offering a shell prompt. Don't clear the screen just before
      booting if we never drew the menu in the first place.
    - Remove some verbose messages printed before reading the configuration
      file.
    - Suppress progress messages as the kernel and initrd load for
      non-recovery kernel menu entries.
    - Keep the loopback file open so that subsequent changes to the "root"
      environment variable don't affect it.
    - Change prepare_grub_to_access_device to handle filesystems
      loop-mounted on file images.
    - Ignore devices loop-mounted from files in 10_linux.
    - Show the boot menu if the previous boot failed, that is if it failed
      to get to the end of one of the normal runlevels.
    - Handle RAID devices containing virtio components.
    - Improve DM-RAID probing support.
    - Don't generate /boot/grub/device.map during grub-install by default.
    - Store grub-pc/install_devices as persistent device names under
      /dev/disk/by-id/.
    - Change priority to optional to match the priority of grub.
    - Shave eight bytes off the pre-partition-table part of boot.img.
    - Don't display "GRUB loading" unless Shift is held down.
    - Adjust versions of grub-doc and grub-legacy-doc conflicts to tolerate
      our backport of the grub-doc split.
    - Optimise hostdisk device handling, substantially speeding up
      grub-probe filesystem reads.

grub2 (1.98-1) unstable; urgency=low

  * New upstream release (closes: #572898).
    - Fix grub-script-check to handle empty lines (closes: #572302).
    - Fix offset computation when reading last sectors. Partition reads and
      writes within and outside a partition (closes: #567469, #567884).
    - Fix script execution error handling bug that meant that an error in a
      menuentry's last statement caused the whole menuentry to fail (closes:
     ...

Read more...

Changed in grub2 (Ubuntu):
status: New → Fix Released

This is also happening in Natty

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

Colin Watson (cjwatson) wrote :

The natty case is a different bug.

Syl21 (sylvain-gargasson) wrote :

Hi Collin,

I have the same symptom on my natty too.

If it's a different bug, can you replay with the new bug id???

Thanks in Advance

Brian Rogers (brian-rogers) wrote :

The new bug, relating to btrfs, is bug 736743.

Gvozdik Artem (gvozdik) wrote :

Also on Kubuntu 11.04 amd64, btrfs #12

Andrei B. Borisov (clinri) wrote :

Also on Ubuntu 11.10 x86, btrfs

Sven Romeike (lun4tic) wrote :

Same problem after installing Ubuntu 12.04 from a USB Stick to HD formated with btrfs

Stig Tore Aannø (staannoe) wrote :

Same thing. Installing Ubuntu 12.04 from a USB Stick to HD formated with btrfs

I installed Precise today, using one partition for swap and one for my btrfs. I'm using encrypted home. Installed from a usb stick.

Ludek (ludek-smolik) wrote :

The same problem on Ubuntu 12.04 beta 1 - 64bit, btrfs filesystem.. :-(

Vlad (badfiles) wrote :

Confirm
The same problem on Ubuntu 12.04 beta 2 - 64bit, btrfs filesystem.

eloaders (eloaders) wrote :

The same problem on Ubuntu 11.10 and 12.04 beta 2 - 64bit, btrfs filesystem.

Matt Sealey (mwsealey) wrote :

Wouldn't the fix to be to mark the /boot directory using btrfs tools as not able to create sparse files? Or do that on kernel posthook?

William Grant (wgrant) on 2012-04-23
no longer affects: grub
Phillip Susi (psusi) wrote :

This bug is specific to resierfs. Comment #12 points to the bug for btrfs.

summary: - error: sparse file not allowed
+ error: sparse file not allowed with reiserfs
Sina Morawej (sina-morawej) wrote :

Hi - I'm seeing the same issue with my new install.

Ubuntu 12.04 - on boot-up: sparse file not allowed. This is a BTRFS boot partition on a 64 bit architecture .

thanks
~sina

Phillip Susi (psusi) wrote :

Sina, please read before posting on bugs, especially my last comment.

Bastiaan Wakkie (bwakkie) wrote :

Same in 13.10 with btrfs!

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

Other bug subscribers