Install to 3TB disk fails with "attempt to read or write outside of disk" error on reboot
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubiquity (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
I performed a test installation of Trusty server to a VirtualBox installation with a 3TiB virtual disk. I chose default options for the most part, although I opted for a non-LVM partition layout. Ubiquity seemed to successfully install Ubuntu, but on reboot, I got the following GRUB error:
Error: attempt to read or write outside of disk `hd0'.
Entering rescue mode...
grub rescue>
It appears that Ubiquity set up a single giant root (/) partition; as shown by gdisk:
Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 6442450944 sectors, 3.0 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 042174C8-
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 6442450910
Partitions will be aligned on 2048-sector boundaries
Total free space is 4029 sectors (2.0 MiB)
Number Start (sector) End (sector) Size Code Name
1 2048 4095 1024.0 KiB EF02
2 4096 6440355839 3.0 TiB 8300
3 6440355840 6442448895 1022.0 MiB 8200
My suspicion is that the kernel ended up above the 2TiB mark and so became unloadable to GRUB, either because of a limitation of GRUB or of the BIOS used by VirtualBox. Re-running the installation with manual partitioning and a separate /boot partition at the start of the disk resulted in a working installation.
This issue could result in failures of automated installations and certification testing, should the target system have an over-2TiB disk. My recommendation is that ubiquity default to creating a separate /boot partition at the start of the disk when doing a BIOS-mode installation on an over-2TiB disk.
Upon further investigation, it seems to be the placement of the grub.cfg file, not of the kernel, that's causing GRUB to flake out. Using debugfs, I found that grub.cfg resides at blocks 748716118 and 748716119. Given a 4KiB block size, that works out to about the 2.79TiB mark on the disk, which is presumably above a GRUB or BIOS 2^32 sector limit. Attempting to do an "ls (hd0,gpt2) /boot/grub" from the "grub rescue>" prompt results in the same "attempt to read or write outside disk" error message noted earlier.
This therefore looks like a GRUB and/or BIOS limitation; however, because larger disks are becoming increasingly common, I believe it's prudent to work around this bug in Ubiquity, at least unless and until a workaround or fix can be added to GRUB.