grub-installer fails to install when using btrfs
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| grub-installer |
New
|
Undecided
|
Unassigned | ||
| grub-installer (Ubuntu) |
Undecided
|
Unassigned | |||
Bug Description
With the daily Kubuntu 14.04 installer I tried to install with a btrfs root filesystem and a swap partition (there's also a Dell specific DOS partition, but I'm leaving that alone) the installer says it fails to install grub.
Jan 5 12:02:24 kubuntu grub-installer: info: Installing grub on '/dev/sda'
Jan 5 12:02:25 kubuntu grub-installer: info: grub-install does not support --no-floppy
Jan 5 12:02:25 kubuntu grub-installer: info: Running chroot /target grub-install --force "/dev/sda"
Jan 5 12:02:26 kubuntu grub-installer: /usr/sbin/
Jan 5 12:02:26 kubuntu grub-installer: /usr/sbin/
Jan 5 12:02:26 kubuntu grub-installer: error: Running 'grub-install --force "/dev/sda"' failed.
Needless to say the system fails to boot after that. :-(
ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: ubiquity 2.17.3
ProcVersionSign
Uname: Linux 3.12.0-7-generic x86_64
ApportVersion: 2.12.7-0ubuntu3
Architecture: amd64
CasperVersion: 1.336ubuntu1
CurrentDesktop: KDE
Date: Sun Jan 5 23:02:33 2014
InstallCmdLine: file=/cdrom/
LiveMediaBuild: Kubuntu 14.04 LTS "Trusty Tahr" - Alpha amd64 (20140105)
MarkForUpload: True
SourcePackage: grub-installer
UpgradeStatus: No upgrade log present (probably fresh install)
| Phillip Susi (psusi) wrote : | #2 |
| Chris Samuel (chris-csamuel) wrote : | #3 |
I had deleted the existing Linux partitions and created new ones in the installer, was that not enough?
| Phillip Susi (psusi) wrote : | #4 |
That should do it... can you run parted -l and make sure the first partition starts at sector 2048?
| Chris Samuel (chris-csamuel) wrote : | #5 |
Remember I still have the Dell created first partition, then the first Linux extended partition starts at 41.9MB (parted doesn't appear to have options to output in sectors I'm afraid).
Using fdisk it appears the Dell partition (type de) starts at sector 63 and my extended partition starts at 81918 and my first Linux partition starts at 81920.
Note that this is after I got a working install by creating an ext4 /boot partition (which is the partition that starts at 81920).
It is a test machine though, so I could blow it away and test a new install if necessary.
| Chris Murphy (dr4-b5gpiyla-tff) wrote : | #6 |
Ideally the installer should test for a properly sized MBR gap earlier on, so it can fail before going to the trouble of installing the OS, only to have grub-install inevitably fail. Windows 7 uses LBA 2048/1MB aligned first partition, and maybe even Vista did. XP does not, it starts the first partition at LBA 63. Older versions of parted do the same.
Next, the use of the --force flag for grub-install on a whole block device seems ill advised. As far as I know, it's useful when directed to a partition formatted ext[234] so that the boot strap code and block list is placed in the VBR instead of the MBR gap. The --force flag will fail on XFS and Btrfs.
In any case, the work around is to repartition with something even somewhat recent, so that partition 1 starts at LBA 2048.
| Launchpad Janitor (janitor) wrote : | #7 |
Status changed to 'Confirmed' because the bug affects multiple users.
| Changed in grub-installer (Ubuntu): | |
| status: | New → Confirmed |
| Sam Vervaeck (samvv) wrote : | #8 |
Any fix for this? I have my EFI partition aligned at sector 2048 and I'm getting the same error.


It seems that you used a very old tool to partition the disk. You will need to repartition it so that the partition is correctly aligned to a 1 MiB boundary.