Mac OS X更新后的GRUB 2问题


在双启动Mac OS X / Ubuntu 12.04(精确的穿山甲)中有一台MacBook Pro当我启动它时,我有一个rEFIt菜单,并且可以在Mac OS X和Linux之间进行选择。几天前,我已使用我公司提供的.dmg映像将Mac OS X从10.7(Lion)更新到10.8(Mountain Lion)。从那时起,当我在rEF中选择Linux时,它说:


  1. 我已经尝试过使用rEFIt分区工具。这就是我得到的:


正如Mac OSX更新建议的那样,无法启动Ubuntu时,我想以与AndrewM相同的方式解决此问题,但是我没有“必须更新MBR表”选项。

  1. Then I booted on Ubuntu 12.04 CD, chose repair broken system, chose root patition /dev/sda6 as this is where my Ubuntu file system is. I got a shell, but I don't really know how to repair the poblem since if it was just Windows dual boot. A GRUB update would solve the issue, but here I don't know where the GRUB 2 is installed.

Here are results from Parted, and it is a bit confusing for me as the Mac partition is the one with boot:


As you can see the entry 1 is an EFI system partition and is the boot partition, so I wonder if I should install GRUB there or in sda6, which is the Ubuntu filesystem.

I am not sure should I work on rEFIt shell or Ubuntu. Unfortunately, I don't remember where GRUB was before update.

UPDATE: using same link above I have tried RoundSparrow hilltx answer and installed rEFInd, but the result is same.... still no bootable device when I select Linux.

UPDATE 2: just used alternate CD again, mounted on /dev/sda6 and the ran update-grub. It seemed to wok and started listing all my kernels. But after rebooting several times still no bootable device when I select Linux in rEFInd.

UDATE 3: Have tried to boot from Ubuntu cd and select "boot from first available filesystem. I got error and dropped to grub rescue shell. I even followed the indications on this link but was unable to boot as I tried to use sdb6 but no luck

UPDATE 4 as per Rob Smith request here is out put from ls -l $(find /EFI -iname "*.efi")


-rw-r--r--@ 1 root  admin    55048 29 oct 17:44 /EFI/refind/drivers_x64/btrfs_x64.efi
-rw-r--r--@ 1 root  admin    38888 29 oct 17:44 /EFI/refind/drivers_x64/ext2_x64.efi
-rw-r--r--@ 1 root  admin    39304 29 oct 17:44 /EFI/refind/drivers_x64/ext4_x64.efi
-rw-r--r--@ 1 root  admin    43432 29 oct 17:44 /EFI/refind/drivers_x64/hfs_x64.efi
-rw-r--r--@ 1 root  admin    38984 29 oct 17:44 /EFI/refind/drivers_x64/iso9660_x64.efi
-rw-r--r--@ 1 root  admin    43656 29 oct 17:44 /EFI/refind/drivers_x64/reiserfs_x64.efi
-rw-r--r--@ 1 root  admin   175016 29 oct 17:44 /EFI/refind/refind_x64.efi
-rw-rw-r--  1 root  admin    73232  7 mar  2010 /EFI/tools/dbounce.efi
-rw-rw-r--  1 root  admin   763248  7 mar  2010 /EFI/tools/dhclient.efi
-rw-rw-r--  1 root  admin    67024  7 mar  2010 /EFI/tools/drawbox.efi
-rw-rw-r--  1 root  admin    71312  7 mar  2010 /EFI/tools/dumpfv.efi
-rw-rw-r--  1 root  admin    84848  7 mar  2010 /EFI/tools/dumpprot.efi
-rw-rw-r--  1 root  admin   472912  7 mar  2010 /EFI/tools/ed.efi
-rw-rw-r--  1 root  admin   143856  7 mar  2010 /EFI/tools/edit.efi
-rw-rw-r--  1 root  admin  1801008  7 mar  2010 /EFI/tools/ftp.efi
-rw-r--r--@ 1 root  admin    47848 29 oct 17:44 /EFI/tools/gptsync_x64.efi
-rw-rw-r--  1 root  admin   320560  7 mar  2010 /EFI/tools/hexdump.efi
-rw-rw-r--  1 root  admin   286384  7 mar  2010 /EFI/tools/hostname.efi
-rw-rw-r--  1 root  admin   534416  7 mar  2010 /EFI/tools/ifconfig.efi
-rw-rw-r--  1 root  admin   395344  7 mar  2010 /EFI/tools/loadarg.efi
-rw-rw-r--  1 root  admin   587408  7 mar  2010 /EFI/tools/ping.efi
-rw-rw-r--  1 root  admin   730416  7 mar  2010 /EFI/tools/pppd.efi
-rw-rw-r--  1 root  admin   561360  7 mar  2010 /EFI/tools/route.efi
-rw-rw-r--  1 root  admin  1961712  7 mar  2010 /EFI/tools/shell.efi 
-rw-rw-r--  1 root  admin   750224  7 mar  2010 /EFI/tools/tcpipv4.efi
-rw-rw-r--  1 root  admin     4048  7 mar  2010 /EFI/tools/textmode.efi
-rw-rw-r--  1 root  admin   320656  7 mar  2010 /EFI/tools/which.efi


Since Ubuntu 12.04 partition is not bootable I had to boot on live cd, so at first your command didn't work:

$ ls -l /boot/vmlinuz*
$ ls: cannot access /boot/vmlinuz*: No such file or directory

so I decided to mount my file system:

sudo mkdir /media/sda6
sudo mount -t ext4 -r /dev/sda6 /media/sda6
cd /media/sda6/
sudo ls -l boot/vmlinuz*

-rw-r--r-- 1 root root 4965840 Apr 25  2012 boot/vmlinuz-3.2.0-23-generic
-rw------- 1 root root 4965968 May 21  2012 boot/vmlinuz-3.2.0-24-generic
-rw------- 1 root root 4974672 Mar 25  2013 boot/vmlinuz-3.2.0-40-generic
-rw------- 1 root root 4978416 Jun  6 20:24 boot/vmlinuz-3.2.0-48-generic
-rw------- 1 root root 4978416 Jun 18 18:20 boot/vmlinuz-3.2.0-49-generic
-rw------- 1 root root 4978960 Jul 24 20:59 boot/vmlinuz-3.2.0-51-generic
-rw------- 1 root root 4980336 Aug 22 21:41 boot/vmlinuz-3.2.0-53-generic
Rod Smith

If you followed RoundSparrow hilltx's instructions precisely, including the use of the --alldrivers option to, you should see one or more new options in rEFInd, with descriptions that include the string vmlinuz. These new entries should boot Linux. If they do, you can remove the non-functional Linux entry by editing /EFI/refind/refind.conf, uncommenting the scanfor line, and ensuring that hdbios is not among the options.

If you did not use the --alldrivers option, or if you don't see the vmlinuz entry/entries, you should try installing the ext4fs driver that comes with rEFInd. Assuming you used the default rEFInd installation options, you need to create the /EFI/refind/drivers directory in OS X and then copy the ext4fs driver for your architecture (X64 or IA32) to that directory. When you reboot, you should see a new Linux option, with a name that includes vmlinuz. This should boot correctly.

EDIT: Could you please do the following and post the results (edit your original post to do this):

  1. In OS X, type ls -l $(find /EFI -iname "*.efi") and post the results here. (This assumes you installed rEFInd under OS X using the default options; if you installed it to the ESP, mount it and adjust the path from /EFI to your ESP's mount point.)
  2. In Linux, type ls -l /boot/vmlinuz* and post the results here.
  3. Check the refind.conf file for the presence of a line reading scan_all_linux_kernels. Be sure that it is present and that it is not commented out (by a leading # character).

You could also try to get BIOS-mode booting working again by fixing the hybrid MBR and/or by re-installing GRUB; however, hybrid MBRs are ugly and dangerous, so that's not the approach I recommend. If you do go down this road, try using the gptsync program from rEFInd rather than the one from rEFIt. The latter failed for you, but rEFInd's will probably work; or you can use gdisk for this job, as described on the page to which I linked earlier in this paragraph.

EDIT 2: Your kernels are all 3.2.x versions, which predate the EFI stub loader. This means that they won't work directly with rEFInd. Broadly speaking, there are two ways to work around this problem:

  • Add another EFI boot loader, such as ELILO or the EFI version of GRUB 2, to boot your existing 3.2.x kernel(s). This is fairly easy to do if you know how, but it's an unfamiliar process to most users. See my page on the topic for background and general instructions. Note that these instructions assume you've got a working Linux installation, though; you'll probably have to use a live CD to get things installed. Also, you need not run efibootmgr to register a boot loader with the firmware; just copy its files into place and set up its configuration file. Thereafter, rEFInd should detect whatever you install and enable you to launch it.
  • 将您的内核升级到3.3.x系列或更高版本。如果您可以引导当前的系统,这很容易做到,如此处所述,但这当然会导致22级的情况。您应该能够通过使用chroot紧急光盘来克服此障碍如此处所述。



如有侵权,请联系 [email protected] 删除。



0 条评论
登录 后参与评论