Author Topic: 64-bit grub  (Read 708 times)

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3800
64-bit grub
« on: January 13, 2013, 11:14:06 PM »
I've been getting strange errors when I make changes to my boot setup in pcc. This is on my 64-bit install. Here's the error.
Code: [Select]
Installation of bootloader failed. The following error occurred:
:/boot/grub/install.sh: line 1:/sbin/grub: cannot execute binary file

When I google this error, it is usually associated with trying to run a 32-bit app in a 64-bit environment or vice-versa. So, I enter this code
Quote
file `which grub`
and to my surprise grub is 32-bit! The command gave this message.

Quote
[galen@localhost ~]$ file `which grub`
/sbin/grub: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped

It is possible that I've messed something up, but this is a very recent install and I haven't built or re-installed grub before. I tested some other programs to see if the file command was working and they were all 64-bit programs. I re-installed grub, no change. I've tried to build grub, but there are multiple errors. Any clues?

Galen

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2849
    • other projects...
Re: 64-bit grub
« Reply #1 on: January 14, 2013, 01:05:41 AM »
is it possible to re-package/re-compile grub on 64bit?

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3800
Re: 64-bit grub
« Reply #2 on: January 14, 2013, 01:56:07 AM »
is it possible to re-package/re-compile grub on 64bit?

I tried and it won't build. Surprisingly, the spec from mandriva's cooker did build, but I still get the same result. Unless I am missing something, it seems as if the specs are cross-compiling grub. I didn't read the spec yet, to see if there was something like that going on, but probably when I get this figured out, I'm going to be very embarrassed for bringing it up. ;D Did you try the file command on /boot/grub on a 64-bit install?

Galen

Offline pinoc

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2849
    • other projects...
Re: 64-bit grub
« Reply #3 on: January 14, 2013, 02:29:52 AM »
Quote
Did you try the file command on /boot/grub on a 64-bit install?

yes, it is a 32bit binary  :-\

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3800
Re: 64-bit grub
« Reply #4 on: January 14, 2013, 02:41:57 AM »
Quote
Did you try the file command on /boot/grub on a 64-bit install?

yes, it is a 32bit binary  :-\

"Curiouser and curiouser!"

Galen

Offline kjpetrie

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 4000
Re: 64-bit grub
« Reply #5 on: January 14, 2013, 06:55:05 AM »
Thanks for introducing me to the file command. This has helped me identify a broken package in the 64-bit repo as a 32-bit binary dynamically linked to 32-bit dependencies masquerading as a noarch rpm.

32-bit grub runs here on my 64-bit system.
-----------
KJP
-----------------------------------------------------------
PClos64 RC1 on Intel D945GCLF2 motherboard (Atom 330), 2GB DDR2 RAM, Maxtor STM325031, HL-DT-ST DVDRAM GSA-H42N, Amilo LSL 3220T monitor. Also Acer 5810TG (with custom kernel) and Asus eeePC 2G surf

Offline JohnW_57

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2137
Re: 64-bit grub
« Reply #6 on: January 14, 2013, 01:40:24 PM »
Comes here Grub2 in picture ?

JohnW
PCLinuxOS 2013 KDE4 (64 bit) on: home build system:  Intel Core 2 Quad (q6700) (2.66ghz), Asus P5K motherboard, 4 gig ddr2 memory, Asus Nvidia Geforce GTS 250 1024 mb gddr3, Crucial M4 128 SSD,  2x Samsung 500 gig HDD (sata), TSSTcorp CDDVDW SH-224BB.

Offline kjpetrie

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 4000
Re: 64-bit grub
« Reply #7 on: January 14, 2013, 02:23:44 PM »
Paste /boot/grub/install.sh here, in case there's something really weird in there.

Also what do you get if you open a terminal and type "grub"? (Type quit to exit if you get a grub prompt.)
« Last Edit: January 14, 2013, 02:25:48 PM by kjpetrie »
-----------
KJP
-----------------------------------------------------------
PClos64 RC1 on Intel D945GCLF2 motherboard (Atom 330), 2GB DDR2 RAM, Maxtor STM325031, HL-DT-ST DVDRAM GSA-H42N, Amilo LSL 3220T monitor. Also Acer 5810TG (with custom kernel) and Asus eeePC 2G surf

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3800
Re: 64-bit grub
« Reply #8 on: January 14, 2013, 07:30:13 PM »
Paste /boot/grub/install.sh here, in case there's something really weird in there.

Also what do you get if you open a terminal and type "grub"? (Type quit to exit if you get a grub prompt.)

Code: [Select]
[galen@localhost ~]$ cat /boot/grub/install.sh
grub --device-map=/boot/grub/device.map --batch <<EOF
root (hd0,4)
setup --stage2=/boot/grub/stage2 (hd0)
quit
EOF
[galen@localhost ~]$

I got a grub prompt.  :-\

Galen

Online Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11593
  • ----IOFLU----
Re: 64-bit grub
« Reply #9 on: January 14, 2013, 09:00:59 PM »
Paste /boot/grub/install.sh here, in case there's something really weird in there.

Also what do you get if you open a terminal and type "grub"? (Type quit to exit if you get a grub prompt.)

Code: [Select]
[galen@localhost ~]$ cat /boot/grub/install.sh
grub --device-map=/boot/grub/device.map --batch <<EOF
root (hd0,4)
setup --stage2=/boot/grub/stage2 (hd0)
quit
EOF
[galen@localhost ~]$

I got a grub prompt.  :-\

Galen


Which indicates that grub itself is working as it should, so the problem is elsewhere.

Just as an exercise in logic, grub has to work on both 32 and 64 bit systems. A 32 bit application will run on a 64 bit system, but a 64 bit application won't run on a 32 bit system, therefore it makes perfect sense that grub should be compiled only as a 32 bit application.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline wedgetail

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2444
  • Any Bugs in site?
Re: 64-bit grub
« Reply #10 on: January 14, 2013, 11:44:27 PM »
gseaman
Just for my own education, what is in your device.map? 
32 bit: KDE (older) & various KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen

Offline gseaman

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 3800
Re: 64-bit grub
« Reply #11 on: January 15, 2013, 12:37:10 AM »
[galen@localhost ~]$ cat /boot/grub/device.map
(hd0) /dev/sda
[galen@localhost ~]$

Offline wedgetail

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 2444
  • Any Bugs in site?
Re: 64-bit grub
« Reply #12 on: January 15, 2013, 01:59:14 AM »
When I saw your  topic I was and still am checking out a livecd KDE 2012.12
I run a desktop system at the moment and my device.map

Quote
(fd0) /dev/fd0
(hd0) /dev/sda

I seem to recall that fd0 = floppy disk drive but I am not sure. I have no floppy installed, but then again I have at least 3 hard drives, so I am not sure of the importance of device.map.

Could it be that above is expected?  Now I am getting a bit curious and will see if I can find my 64 bit livecd


32 bit: KDE (older) & various KDE-mini, ASUSTek P5P41D Rev X.0x, BIOS AMI0207 07/21/2009, "Pentium(R) Dual-Core CPU E5300 @ 2.60GHz", nVidia GeForce 9600 GT, 2x1GB Seagate Technology 1000528AS HDD
TV CompuPro VideoMate Vista E700 (not working in Linux), Acer X243HD LCD Screen