Bug 743136

Summary: grub2-mkconfig emits ERROR: unsupported sector size 4096
Product: [Fedora] Fedora Reporter: Bayard R. Coolidge <n1ho>
Component: grub2Assignee: Peter Jones <pjones>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 16CC: awilliam, dennis, mads, myroslav, pjones, the.ridikulus.rat, vgulch
Target Milestone: ---Keywords: CommonBugs
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: https://fedoraproject.org/wiki/Common_F16_bugs#4k-sectors
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-30 22:41:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
grub.cfg from newly installed system on a 4096 byte sector 3TB USB drive none

Description Bayard R. Coolidge 2011-10-04 00:27:17 UTC
Description of problem: Unable to perform grub2-install on external 3TB USB drive with 4096 byte sectoring on x86_64 non-EFI BIOS laptop with GPT (or MBR) partition tables

Version-Release number of selected component (if applicable): Fedora 16 Beta RC4


How reproducible: Consistently


Steps to Reproduce:
1. Boot and use installation DVD to attempt installation
2. Select 'use all' of the external drive.
3. Allow Anaconda to partition drive (which will properly create a bios_grub partition, a 500MB /boot partition with an ext4fs on it, and use the rest of the space to create LVM with root, swap and user space.

(parted) print                                                            
Model: Seagate FA GoFlex Desk (scsi)
Disk /dev/sdb: 3001GB
Sector size (logical/physical): 4096B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  2097kB  1049kB                     bios_grub
 2      2097kB  526MB   524MB                ext4  boot
 3      526MB   3001GB  3000GB                     lvm

4. Designate the whole USB drive (/dev/sdc) as the boot block installation target

Actual results: Installation fails to actually boot. (Can be booted by copying /boot to a subdirectory of an existing openSUSE 11.4 installation that boots using Legacy Grub, and adding appropriate stanza to its menu.lst). When troubleshooting, I mv'd grub.cfg to grub.cfg.orig and then issued 'grub2-mkconfig -o /boot/grub2/grub.cfg to see what grub2 might see, got the following:

[root@hislap grub2]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.1.0-0.rc8.git0.0.fc16.x86_64
Found initrd image: /boot/initramfs-3.1.0-0.rc8.git0.0.fc16.x86_64.img
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/dm-0.
ERROR: unsupported sector size 4096 on /dev/dm-1.
ERROR: unsupported sector size 4096 on /dev/dm-2.
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/dm-0.
ERROR: unsupported sector size 4096 on /dev/dm-1.                               
ERROR: unsupported sector size 4096 on /dev/dm-2.                               
ERROR: unsupported sector size 4096 on /dev/sdc.                                
ERROR: unsupported sector size 4096 on /dev/dm-0.                               
ERROR: unsupported sector size 4096 on /dev/dm-1.                               
ERROR: unsupported sector size 4096 on /dev/dm-2.
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/dm-0.
ERROR: unsupported sector size 4096 on /dev/dm-1.
ERROR: unsupported sector size 4096 on /dev/dm-2.
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/dm-0.
ERROR: unsupported sector size 4096 on /dev/dm-1.
ERROR: unsupported sector size 4096 on /dev/dm-2.
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/dm-0.
ERROR: unsupported sector size 4096 on /dev/dm-1.
ERROR: unsupported sector size 4096 on /dev/dm-2.
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/dm-0.
ERROR: unsupported sector size 4096 on /dev/dm-1.
ERROR: unsupported sector size 4096 on /dev/dm-2.
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/dm-0.
ERROR: unsupported sector size 4096 on /dev/dm-1.
ERROR: unsupported sector size 4096 on /dev/dm-2.
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/dm-0.
ERROR: unsupported sector size 4096 on /dev/dm-1.
ERROR: unsupported sector size 4096 on /dev/dm-2.
Found Windows XP Media Center Edition on /dev/sda1
Found Windows NT/2000/XP on /dev/sda2
Found Microsoft Windows XP Embedded on /dev/sda3
done

Note that it did NOT spot the openSUSE 11.4 installation on /dev/sdb, either!
(/dev/sda and /dev/sdb are 80GB Toshiba SATA internal drives with 512 byte
sectoring).



Expected results: Expect it to boot off of USB drive, in the same manner as my MBR-partitioned 512-byte sectored 250GB drive.


Additional info: Tried grub-install to /dev/sdc2 as well, and that didn't work, either. This issue was originally mentioned in https://bugzilla.redhat.com/show_bug.cgi?id=741781#c24 and I was asked to file a separate bug report.
Hardware: HP dv9000z laptop, 4GB memory, AMD Turion64 dual core CPU, NVIDIA GeForce 6150, Broadcom BCM4311, two 80GB Toshiba SATA drives (512 byte sectoring), Phoenix BIOS with no EFI capability. Boot parameters include
'nomodeset' and exclude 'quiet'.

Comment 1 Mads Kiilerich 2011-10-24 15:33:16 UTC
Do grub2-mkconfig work despite these errors? How do grub.cfg look like?

I guess most of these errors come from os-prober which is invoked by grub2-mkconfig. Can you try to run 'os-prober' manually?

Comment 2 Bayard R. Coolidge 2011-10-24 17:37:29 UTC
Created attachment 529933 [details]
grub.cfg from newly installed system on a 4096 byte sector 3TB USB drive

Comment 3 Adam Williamson 2011-10-24 17:48:47 UTC
So for background here, it seems to be Western Digital which is actually putting drives with 4K sector sizes out into the market, and afaict it seems to be their Green line. Western Digital's term for 4K sector sizes is 'Advanced Format': the marketing info for any drive with this sector size mentions the 'Advanced Format' buzzword.

pjones is of the opinion that this has basically never worked without EFI: he expects that prior to F16, grub-legacy would have tried to install itself on disks with 4K sector sizes, but ought to have failed to produce a bootable system.

Comment 4 Bayard R. Coolidge 2011-10-24 17:58:08 UTC
The grub2.cfg attached above is from a newly installed "TC" system. It was installed in the same manner as my original attempt(s). I tried os-prober (after duly checking for last-minute updates) and it emitted:

[root@hislap-f16TC bayard]# which os-prober
/usr/bin/os-prober
[root@hislap-f16TC bayard]# os-prober --help
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/sdc.
ERROR: unsupported sector size 4096 on /dev/sdc.
  No volume groups found
/dev/sda1:Windows XP Media Center Edition:Windows:chain
/dev/sda2:Windows NT/2000/XP:Windows1:chain
/dev/sda3:Microsoft Windows XP Embedded:Windows2:chain
/dev/sdb2:openSUSE 11.4 (x86_64):SuSE:linux
/dev/sdc6:Ubuntu 11.10 (11.10):Ubuntu:linux
/dev/sdc7:openSUSE 12.1 RC 1 (x86_64):SuSE1:linux

Note that it did see my systems on /dev/sda1, /dev/sda2 and /dev/sdb2.
(Adam was sending me comments via e-mail and updating this BZ while
I was attempting to insert this comment, so forgive the disorder!)

Comment 5 Adam Williamson 2011-10-24 18:01:06 UTC
Seagate also has 4K disks, and also call it 'Advanced Format'. Their Barracuda Green drives appear to use this, inc. the 1.5TB model.

Hitachi's green-style drives (high capacity, low spindle speed) also appear to use 'Advanced Format', according to the comments on http://ncix.com/products/?sku=59651&vpn=0S03230&manufacture=Hitachi .

Comment 6 Mads Kiilerich 2011-10-24 19:14:03 UTC
(Reintroduce lost CommonBugs keyword)

So, 3 issues here:
0: The 4k disk was sdb but now it showed up as sdc - ok, no problem
1: os-prober issues warnings (but is able to detect openSUSE 12.1 anyway)
2: grub2-mkconfig fails to detect it anyway
3: booting from 4k drives might not work anyway (which could explain why they are ignored)

???

Comment 7 Bayard R. Coolidge 2011-10-25 20:11:08 UTC
0.) Not an issue - typical "bus" renumbering/redesignation depending on if it booted off of a DVD, etc.

1.) Yes, the openSUSE 12.1 issue isn't an issue anymore, but os-prober seems to be allergic to 4k drives, which is an issue (IMNSHO).

2.) grub2-mkconfig seems to run correctly, except for os-prober's issues.

3.) Booting from 4k drives wasn't explicitly disallowed by any documentation to date, and apparently GRUB2 won't be able to boot them. However, the installation processes seems to imply that a boot block was created and installed. What's in the remaining 4096-512=3584 bytes of the boot sector is a mystery to me.

And, it's quite probable that this corner case can't be resolved since the BIOS
on my particular laptop is most likely set up to deal with just 512 byte boot
blocks anyway; it's not EFI-capable, either. (Ironically, it appears that this laptop is dying, too, after almost 4 years - long story about heat dissipation in this particular model). It appears that it would take a significant amount of engineering time to develop a variant of GRUB2 that writes to a 4k sector, and can be read by a BIOS designed for 512 byte sectors which can then successfully boot such a drive.

Comment 8 Mads Kiilerich 2011-10-25 20:35:40 UTC
(In reply to comment #7)
> 2.) grub2-mkconfig seems to run correctly, except for os-prober's issues.

Ok, that did for unknown reasons change between the original report and comment 2 - I failed to notice that.

I suggest you file a separate issue for os-prober.

The remaining issue here is thus "grub2 can't boot from 4k disks". Some quick googling hints that it should work, but the functinality has not been released yet and is not included in 1.99:

revno: 3394
committer: Vladimir 'phcoder' Serbinenko <phcoder>
branch nick: grub
timestamp: Mon 2011-07-25 08:14:34 +0200
message:
        Support ATA disks with 4K sectors.

        * include/grub/ata.h (grub_ata): New member log_sector_size.
        * grub-core/disk/ata.c (grub_ata_dumpinfo): Show sector size.
        (grub_ata_identify): Read sector size.
        (grub_ata_readwrite): Use log_sector_size rather than hardcoded value.

Comment 9 Adam Williamson 2011-10-25 20:50:57 UTC
pjones: should we backport that fix?

Comment 10 Adam Williamson 2011-12-02 20:57:45 UTC

-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

Comment 11 Mads Kiilerich 2012-04-16 21:19:27 UTC
I doubt it will be backported to f16 now, but the patch is included in the version used in f17.

Comment 12 Mads Kiilerich 2012-04-30 22:41:08 UTC
grub2-2.0-0.24.beta4.fc17 includes the change from comment 8 and has been pushed to f17 stable. Closing.