grub-install failure on 2T disk and msdos partition table

Bug #1349538 reported by Scott Moser on 2014-07-28
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
UEC Live Build
High
Ben Howard

Bug Description

This was originally reported with subject 'Greater than 1TiB boot disks for the Cloud Image' [1]. When running grub-install to a large disk with MSDOS partition table that has a single partition, we are seeing errors.

  [1] https://lists.ubuntu.com/archives/ubuntu-cloud/2014-July/thread.html#969

## either of these exhibit the problem.
## 'current' for trusty=20140726 utopic=20140728
$ img_url="http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img"
$ img_url="http://cloud-images.ubuntu.com/utopic/current/utopic-server-cloudimg-amd64-disk1.img"

## Get the download image
$ wget "$img_url" -O "disk1.img.dist"

## create a seed image for cloud-init.
$ printf "#%s\n%s\n%s\n%s\n" "cloud-config" "password: passw0rd" \
    "chpasswd: { expire: False }" "ssh_pwauth: True" > my-user-data
$ cloud-localds my-seed.img my-user-data

## create a raw image from that and resize it to 2T
$ qemu-img convert -O raw disk1.img.dist disk1.img
$ qemu-img resize disk1.img 2T
$ qemu-img info disk1.img
image: disk1.img
file format: raw
virtual size: 2.0T (2199023255552 bytes)
disk size: 799M

## boot it, in qemu
$ qemu-system-x86_64 -enable-kvm \
    -drive if=virtio,file=disk1.img -drive if=virtio,file=my-seed.img \
    -device virtio-net-pci,netdev=net00 \
    -serial file:serial.log \
    -netdev type=user,id=net00 -m 1024

##
## now, logged in as 'ubuntu' and 'passw0rd'
##
% lsb_release -sc
utopic

% cat /etc/cloud/build.info
build_name: server
serial: 20140728

% dpkg-query --show grub-pc
grub-pc 2.02~beta2-10

% sudo sfdisk -l -uS /dev/vda
Disk /dev/vda: 4260880 cylinders, 16 heads, 63 sectors/track
Warning: The partition table looks like it was made
  for C/H/S=*/4/32 (instead of 4260880/16/63).
For this listing I'll assume that geometry.
Units = sectors of 512 bytes, counting from 0

   Device Boot Start End #sectors Id System
/dev/vda1 * 2048 4294967295 4294965248 83 Linux
/dev/vda2 0 - 0 0 Empty
/dev/vda3 0 - 0 0 Empty
/dev/vda4 0 - 0 0 Empty

% df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 2.0T 757M 1.9T 1% /

% cat /proc/partitions
major minor #blocks name

 253 0 2147483648 vda
 253 1 2147482624 vda1
 253 16 366 vdb
  11 0 1048575 sr0

% grep "resized:" /var/log/cloud-init.log
2014-07-28 18:50:11,906 - cc_growpart.py[INFO]: '/' resized: changed (/dev/vda, 1) from 2146435072 to 2199022206976

% sudo update-grub
Generating grub configuration file ...
grub-probe: error: unknown filesystem.

% sudo grub-install /dev/vda
Installing for i386-pc platform.
grub-install: error: unknown filesystem.

% sudo grub-install -v /dev/vda > grub-install-verbose-vda.log 2>&1
## see attached.

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: grub-pc 2.02~beta2-10
ProcVersionSignature: User Name 3.16.0-5.10-generic 3.16.0-rc6
Uname: Linux 3.16.0-5-generic x86_64
ApportVersion: 2.14.4-0ubuntu2
Architecture: amd64
Date: Mon Jul 28 18:10:47 2014
ProcEnviron:
 TERM=linux
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: grub2
UpgradeStatus: No upgrade log present (probably fresh install)

Scott Moser (smoser) wrote :
description: updated

Also hitting this issue when upgrading grub via apt-get in a cloud instance (Ubuntu 14.04 LTS image) backed by a 2 TiB volume as the boot drive.

Have there been any updates that anyone is aware of?

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grub2 (Ubuntu):
status: New → Confirmed
Changed in grub2 (Ubuntu):
importance: Undecided → High

Setting to Triaged; looks like grub-install is likely failing to recognize the filesystem type because of the size of the disk, or in any case that's what seems to be a good starting assumption. Given that we have clear reproduction steps and a very clear error message, it should be possible to track this down, write a small reproducer, etc. to fix the issue.

Changed in grub2 (Ubuntu):
status: Confirmed → Triaged

I can't reproduce this on the latest daily for trusty or utopic; and the one for trusty also seems to be the latest released image for that Ubuntu release.

I will give it a bit more inspection with released images closer to the time this bug was reported; but it may be required to do more bisecting work to find out what/how this fixed itself in later versions of the image.

Changes between the manifest for the two images is attached; but nothing immediately jumped out to affect grub-probe's identifying filesystems.

Scott Moser (smoser) wrote :

Mattieu,
  It would seem that the fix is here:
  http://bazaar.launchpad.net/~ubuntu-on-ec2/live-build/cloud-images/revision/1881

all in all, still odd that resize2fs was ok, but grub was what failed.

Just as bit of info, i found that by looking at the tool-version-info.txt files

  http://cloud-images.ubuntu.com/releases/trusty/release-20141125/tool-version-info.txt
and
  http://cloud-images.ubuntu.com/releases/trusty/release-20150123/tool-version-info.txt

affects: grub2 (Ubuntu) → ubuntu
tags: added: cloud-images-build
Changed in ubuntu:
assignee: nobody → Ben Howard (utlemming)
status: Triaged → Fix Released
affects: ubuntu → cloud-images
affects: cloud-images → uec-live-build
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers