ubuntu下sudo gurb-install /dev/sda后windows无法启动

shaode01 2013-06-10 06:04:22
事情始末:
win7的C盘空间不够,用压缩卷的方法改变了分区,再此开机的时候grub rescue,网上的解决办法:


由于在Windows下面对分区修改,导致grub所在分区由sda3变成了sda2了,这样一来找不到grub了,Ubuntu开机就出现了

grub rescue >

在此情况下,可以如下解决,并不用重新安装系统

第一步,找出你的Linux盘在那个分区以及grub目录在什么位置。

如果你还记得最好,忘了也无所谓,使用下面命令逐个试探即可:

grub rescue>ls

回车后,ls命令会列出所有磁盘分区信息,如:

hd0,4),(hd0,7),(hd0,8),(hd0,9)

循环使用如下命令,直至显示该分区所包含文件内容而不是unknown filesystem以及其他一些不正常信息

grub rescue>ls (hd0,0)/boot/grub

(网上有写ls (hd0,0)/grub的,可能根据不同linux发行版本不同吧,Ubuntu 10.04是grub是放在/boot下面的。或者可以ls其他文件也一样)

假设我们试到(hd0,8)时,成功显示了文件内容,则表示。

第二步:

grub rescue>set root=(hd0,8)

//括号里分区为上一步尝试成功的分区,即linux grub 所在分区

grub rescue>set prefix=(hd0,8)/boot/grub

第三步:

grub rescue>insmod normal.mod

网上有些insmod /grub/normal.mod的,我的Ubuntu 10.04并不成功

至此,应该退出了grub rescue模式,进入了熟悉的grub模式

第四步:

grub>normal

第五步:修复grub

进入Linux系统后,在命令行里

sudo update-grub

第六步:

sudo grub-install /dev/sda //sda是你的启动磁盘


我的是试到(hd0,msdos7)的时候出现了信息,然后就有ubuntu的启动项选择界面,这个时候可以进入win7,但每次启动都有grub rescue,所以我进入了ubuntu做上面说的5/6步,我认为是这个命令sudo grub-install /dev/sda导致的结果,把win7的启动项弄没了,现在只能进ubuntu 。
启动界面显示的是从 (hd0,6)启动,下面是df -a的信息

网上说的有个win7安装盘办法,我想知道有没有在unbutu里面改的办法,我现在没win7安装盘
...全文
587 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
dust_dust 2013-08-26
  • 打赏
  • 举报
回复
楼主还是试试找个win7安装盘,启动进去dos界面,里面有修复启动项的选项的。你的是从win7分区开始错的,解铃还须系铃人
辰岡墨竹 2013-06-11
  • 打赏
  • 举报
回复
最好先用apt-get升级一下系统里的GRUB(你用的GRUB 2对吧)。 然后你可以sudo update-grub,这样它应该会自动发现Win7,并在GRUB菜单里加入对应的启动项。
shaode01 2013-06-10
  • 打赏
  • 举报
回复
关于分区的一些信息 Boot Info Script 0.55 dated February 15th, 2010 ============================= Boot Info Summary: ============================== => Grub 0.97 is installed in the MBR of /dev/sda and looks on the same drive in partition #7 for /boot/grub/stage2 and /boot/grub/menu.lst. sda1: _________________________________________________________________________ File system: ntfs Boot sector type: Windows Vista/7 Boot sector info: No errors found in the Boot Parameter Block. Operating System: Windows 7 Boot files/dirs: /bootmgr /Boot/BCD /Windows/System32/winload.exe /grldr /wubildr.mbr /ubuntu/winboot/wubildr.mbr /wubildr /ubuntu/winboot/wubildr sda2: _________________________________________________________________________ File system: Extended Partition Boot sector type: - Boot sector info: sda5: _________________________________________________________________________ File system: ntfs Boot sector type: Windows XP Boot sector info: According to the info in the boot sector, sda5 starts at sector 63. Operating System: Boot files/dirs: sda6: _________________________________________________________________________ File system: ntfs Boot sector type: Windows XP Boot sector info: According to the info in the boot sector, sda6 starts at sector 63. Operating System: Boot files/dirs: sda7: _________________________________________________________________________ File system: ext4 Boot sector type: Grub Boot sector info: Grub 0.97 is installed in the boot sector of sda7 and looks at sector 467969184 of the same hard drive for the stage2 file. A stage2 file is at this location on /dev/sda. Stage2 looks on partition #7 for /boot/grub/menu.lst. Operating System: Ubuntu 11.10 Boot files/dirs: /boot/grub/menu.lst /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img sda8: _________________________________________________________________________ File system: swap Boot sector type: - Boot sector info: sda9: _________________________________________________________________________ File system: ntfs Boot sector type: Windows XP Boot sector info: According to the info in the boot sector, sda9 starts at sector 63. Operating System: Boot files/dirs: sda10: _________________________________________________________________________ File system: ntfs Boot sector type: Windows XP Boot sector info: According to the info in the boot sector, sda10 starts at sector 63. Operating System: Boot files/dirs: sda11: _________________________________________________________________________ File system: ntfs Boot sector type: Windows Vista/7 Boot sector info: According to the info in the boot sector, sda11 starts at sector 640. But according to the info from fdisk, sda11 starts at sector 877600768. Operating System: Boot files/dirs: =========================== Drive/Partition Info: ============================= Drive: sda ___________________ _____________________________________________________ Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes Partition Boot Start End Size Id System /dev/sda1 * 63 81,915,434 81,915,372 7 HPFS/NTFS /dev/sda2 81,915,496 976,751,999 894,836,504 f W95 Ext d (LBA) /dev/sda5 81,915,498 286,712,054 204,796,557 7 HPFS/NTFS /dev/sda6 286,712,118 459,309,782 172,597,665 7 HPFS/NTFS /dev/sda7 459,311,104 487,464,959 28,153,856 83 Linux /dev/sda8 487,467,008 491,507,711 4,040,704 82 Linux swap / Solaris /dev/sda9 491,508,738 696,305,294 204,796,557 7 HPFS/NTFS /dev/sda10 696,305,358 877,600,127 181,294,770 7 HPFS/NTFS /dev/sda11 877,600,768 976,750,591 99,149,824 7 HPFS/NTFS blkid -c /dev/null: ____________________________________________________________ Device UUID TYPE LABEL /dev/sda10 96E03A06E039ECDD ntfs LEARNING /dev/sda11 7A8C5D5A8C5D124D ntfs 新加卷 /dev/sda1 CC801052801044FC ntfs /dev/sda2: PTTYPE="dos" PART_ENTRY_SCHEME="dos" PART_ENTRY_TYPE="0xf" PART_ENTRY_NUMBER="2" /dev/sda5 F084558B84555566 ntfs SOFTWARE /dev/sda6 A2884CA3884C77B5 ntfs MEDIA /dev/sda7 615d282e-58c9-498b-8d7d-b44dc6c90b8f ext4 /dev/sda8 240a4b47-ace0-4c1b-b8f5-272b419c7128 swap /dev/sda9 10FC4363FC4341E8 ntfs BACKUP /dev/sda: PTTYPE="dos" ============================ "mount | grep ^/dev output: =========================== Device Mount_Point Type Options /dev/sda7 / ext4 (rw,errors=remount-ro,commit=600)

742

社区成员

发帖
与我相关
我的任务
社区描述
该论坛主要探讨Linux系统在IBM Power平台的安装、部署、应用开发等话题,并为网友们提供自由交流的平台。
社区管理员
  • Power Linux社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧