Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grub problems #8

Closed
thw-zz opened this issue Nov 2, 2011 · 4 comments
Closed

grub problems #8

thw-zz opened this issue Nov 2, 2011 · 4 comments
Assignees

Comments

@thw-zz
Copy link

thw-zz commented Nov 2, 2011

Hi Darik,

i have a few grub-related issues. In all cases i encountered these problems on a fresh
install via amd64 live-cd to an empty disk.

  1. Following this howto, i never ever got grub-pc installed. Not on 11.04, nor on 11.10. In step 5.6 when executing

    # apt-get install --no-install-recommends  linux-image linux-image-generic linux-headers-generic 
    

    i get

    The following extra packages will be installed:
      linux-firmware linux-headers-3.0.0-12 linux-headers-3.0.0-12-generic linux-image-3.0.0-12-generic  wireless-crda
    Suggested packages:
      fdutils linux-doc-3.0.0 linux-source-3.0.0 linux-tools
    Recommended packages:
      grub-pc grub-efi-amd64 grub-efi-ia32 grub lilo
    The following NEW packages will be installed:
      linux-firmware linux-headers-3.0.0-12 linux-headers-3.0.0-12-generic linux-headers-generic  linux-image linux-image-3.0.0-12-generic linux-image-generic wireless-crda
    0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
    

    You see, grub-pc is recommended but ignored due to the switch.

    In step 6.1 grub-probe is succesful but /boot/grub is missing and also grub-install and update-grub

    # grub-probe /
    zfs
    
    # ls /boot/grub/zfs*
    ls: cannot access /boot/grub/zfs*: No such file or directory
    
    # which update-grub
    # which grub-install
    #
    
    # dpkg -l | grep grub
    ii  grub-common                    1.99-12ubuntu5+zfs1~oneiric1       GRand Unified Bootloader (common files)
    
  2. /etc/grub.d/10_linux: 68: xUNKNOWN (0x2fc12fc1): not found

    apt-get install grub-pc resolves the problem regarding /boot/grub and the missing tools

    # grub-probe /
    zfs
    
    # ls /boot/grub/zfs*
    /boot/grub/zfsinfo.mod /boot/grub/zfs.mod
    
    # which update-grub
    /usr/sbin/update-grub
    # which grub-install
    /usr/sbin/grub-install
    #
    

    but it throws an error message

    Creating config file /etc/default/grub with new version
    Installation finished. No error reported.
    Generating grub.cfg ...
    [: 68: missing ]
    /etc/grub.d/10_linux: 68: xUNKNOWN (0x2fc12fc1): not found
    Found linux image: /boot/vmlinuz-3.0.0-12-generic
    Found initrd image: /boot/initrd.img-3.0.0-12-generic
    done  
    
  3. error: cannot find a GRUB drive for /dev/disk/by-id/ata-WDC_...CAWFxxxxxxx. Check your device.map.

    For the first time (i did numerous installations previous with 11.04 using /dev/sda) i used /dev/data/by-id/ addressing
    schema. /dev/disk/by-id/ has two entries for every disk/partition: an ata-* and a scsi-*. First, inspired by the howto, i used
    the scsi variant which worked until step 6.5

    # grub-install /dev/disk/by-id/scsi-SATA_WDC_WD2500AAJS-_WD-WCAWFxxxxxxx
    /usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/disk/by-id/scsi-SATA_WDC_WD2500AAJS-_WD-WCAWFxxxxxxx.  Check your device.map.
    

    I found that /boot/grub/device.map didnt exist and tried to fix this

    # cat /boot/grub/device.map
    cat: /boot/grub/device.map: No such file or directory
    
    # grub-mkdevicemap --no-floppy
    # cat /boot/grub/device.map
    (hd0)   /dev/disk/by-id/ata-WDC_WD2500AAJS-00V4A0_WD-WCAWFxxxxxxx
    

    Since grub-mkdevicemap only added the ata variant, i started over by erasing the hd and rebooting from live-cd
    using this id. I encountered all 3 issues.

    # grub-install /dev/disk/by-id/ata-WDC_WD2500AAJS-00V4A0_WD-WCAWFxxxxxxx
    /usr/sbin/grub-probe: error: cannot find a GRUB drive for /dev/disk/by-id/ata-WDC_WD2500AAJS-00V4A0_WD-WCAWFxxxxxxx.  Check your device.map.
    #
    # cat /boot/grub/device.map
    (hd0)   /dev/disk/by-id/ata-WDC_WD2500AAJS-00V4A0_WD-WCAWFxxxxxxx
    

    BUT (!!!!)

    # grub-install /dev/sda
    Installation finished. No error reported.
    

    After rebooting, the system is fully functional.

Best regards
Thomas

@nergdron
Copy link

I'm seeing the same problem trying to run update-grub from inside a chrooted env from the 11.10 live CD:

update-grub

Generating grub.cfg ...
[: 68: missing ]
/etc/grub.d/10_linux: 68: xUNKNOWN (0x2fc12fc1): not found
done

Looking at the code in /etc/grub.d/10_linux, it looks like the offending line is this:
LINUX_ROOT_STAT=stat -f --printf=%T / || true

That stat command returns "UNKNOWN (0x2fc12fc1)" on 11.10 for a zfs mount.

I don't see any similar lines in the upstream grub2 in 11.10, so I'm not sure what it's supposed to do (other than the obvious following stuff for btrfs).

Thankfully, it doesn't seem to affect setting up the grub.cfg, zfs entries.

@ghost ghost assigned dajhorn Dec 20, 2011
@rlaager
Copy link

rlaager commented Jan 7, 2012

The issue with the "[: 68: missing ]" error is this line in /etc/grub.d/10_linux:
if [ "x${LINUX_ROOT_FS}" = xbtrfs || "x${LINUX_ROOT_STAT}" = xbtrfs ]; then

The fix is to change it to this:
if [ "x${LINUX_ROOT_FS}" = xbtrfs ] || [ "x${LINUX_ROOT_STAT}" = xbtrfs ]; then

@dajhorn
Copy link
Member

dajhorn commented Jan 7, 2012

I already fixed this in-tree as

if [ "x${LINUX_ROOT_FS}" = xbtrfs -o "x${LINUX_ROOT_STAT}" = xbtrfs ]; then

Let me double check whether I published it for all distro releases.

@rlaager
Copy link

rlaager commented Apr 9, 2012

Can this issue be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants