<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Wow! Ubuntu &#187; O湛狼O-aitilife</title>
	<atom:link href="http://wowubuntu.com/author/lijiantao/feed" rel="self" type="application/rss+xml" />
	<link>http://wowubuntu.com</link>
	<description>Ubuntu 及 Linux 新闻、技巧、软件及游戏！</description>
	<lastBuildDate>Wed, 15 May 2013 09:13:16 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Ubuntu 10.10+Win7 双系统重装 Win7 后恢复 Ubuntu 引导方法</title>
		<link>http://wowubuntu.com/fix-grub.html</link>
		<comments>http://wowubuntu.com/fix-grub.html#comments</comments>
		<pubDate>Sat, 05 Mar 2011 01:14:48 +0000</pubDate>
		<dc:creator>O湛狼O-aitilife</dc:creator>
				<category><![CDATA[技巧]]></category>
		<category><![CDATA[grub]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://wowubuntu.com/?p=3294</guid>
		<description><![CDATA[起因: 虽然一直在ubuntu下工作,但是前几天突然发现dreamweaver有wordpress的代码提示功 [...]]]></description>
				<content:encoded><![CDATA[<p><strong><span style="text-decoration: underline;">起因:</span></strong><br />
虽然一直在ubuntu下工作,但是前几天突然发现dreamweaver有wordpress的代码提示功能,让小狼心动不已,所以就打算在一直当成游戏机的win7上去搭建iis的php环境,鼓捣了一阵子后....悲剧地发现竟然无法打开was服务,说是找不到这个服务,百度,google了一阵，发现只有两个办法，尝试了一下都不成功，没办法.只能选择重装了,正好装个windows server 2008感觉感觉服务器版的windows有什么优点。</p>
<p><span id="more-3294"></span></p>
<p>装完server 2008之后重启就更加悲剧地发现grub启动菜单不见了....不是重装了windows之后又要重装ubuntu吧....配置了好久的说,OMG!小狼决定说什么也不能重装ubuntu，就虚心地向google求救,经过一段时间的折腾,终于成功引导回ubuntu。现在就说说一下引导过程吧,注意了小狼用的是liveCD方法,就是装系统时用的光盘,没有的童鞋可以跳过了，当然想参考一下的也可以继续往下看。</p>
<p><strong>恢复引导方法：</strong></p>
<p>1.放进liveCD,重启,看到有界面出来的时候,选择试用,不要点安装。</p>
<p>2.进入ubuntu试用版后,打开终端,在左上角的<span style="color: #ff0000;">应用程序-&gt;附件-&gt;终端</span>那</p>
<p>3.输入以下命令:</p>
<p>sudo fdisk -l   //得到的结果类似下面。查看ubuntu的根目录在那,这里没办法直接看出来,只能靠你自己识别,可以从分区的大小判断是不是根分区，就是在装ubuntu时，挂载点为 <span style="color: #ff0000;">/ </span>的那个分区</p>
<p><img class="alignnone size-medium wp-image-738" src="http://www.aitilife.com/wp-content/uploads/2011/03/fdisk-300x127.png" alt="fdisk" width="300" height="127" /></p>
<p>从图中的结果看出来，根分区在sda12.因为小狼记得分/分区的时候是分了20G的大小，并且当时是先分了/分区，然后再分了一个20G的/home分区的。所以判断出sda12是/分区，而不是sda13，虽然它也是20G.把sda12记住。</p>
<p><strong><span style="color: #ff0000;">注意：<span style="color: #000000;">如果</span></span><span style="color: #000000;">分区的时候，你单独把boot分区分出来了，还要多一步工作，就是找出boot分区:</span></strong></p>
<p>从上图可以看出,boot分区在sda8，因为它是最小的，只有200M.（你装ubuntu的时候分了多少就是多少）</p>
<p>记住sda8。</p>
<p>4.输入</p>
<blockquote><p>sudo mount /dev/sda8 /mnt</p></blockquote>
<p>因为小狼的单独把boot分区分出来了,并且它的位置在sda8.如果你没有单独把boot分区分出来.那就修改一下位置,改为</p>
<blockquote><p>sudo mount /dev/你的/分区所在位置 /mnt</p></blockquote>
<p>5.输入</p>
<blockquote><p>sudo grub-install --root-directory=/mnt /dev/sda8</p></blockquote>
<p>同样，如果你没有把boot分区单独分出来就改成</p>
<blockquote><p>sudo grub-install --root-directory=/mnt /dev/你的/分区的位置</p></blockquote>
<p>这里应该不会有什么问题，因为如果位置不对，无法安装，你可以一直输这个命令直到位置对了为止.</p>
<p>6.如果出现了no error report。那你就差不多成功了.然后sudo init 6.重启。</p>
<p>7.重启之后你会无奈地发现......windows也无法启动了，进入的是grub的命令行.....不要怕。进到这里你已经离成功不远了.</p>
<p>输入:</p>
<p>root (hdX,Y）   //x为硬盘位置，如果你只有一快硬盘,X=0,如果有多块，相应设置x。Y为boot分区所在位置,这里是8.如果没有单独分boot分区,y就是你的/分区所在位置</p>
<p>linux /vmlinuz-2.xxxxx-generic root=/dev/sda12(无论你有没有把boot分区单独分出来,这里都要写/根分区的位置，否则无法完成启动,这里可以按tab完成填写)</p>
<p>如果没有单独把boot分区分出来，就是</p>
<blockquote><p>linux /boot/vmlinuz-2.xxxxx-generic root=/dev/sda12<br />
initrd /initrd.img-2.xxxxx-generic</p></blockquote>
<p>或</p>
<blockquote><p>initrd /boot/initrd.img-2.xxxxx-generic<br />
boot</p></blockquote>
<hr />
<p>到这里已经差不多完成了.因为你已经可以进入原来的ubuntu了，但是如果就这样不管了，那么下一次重启还需要重复一次上面的工作。这也太渗人了。。。</p>
<p>那最后就修复一下grub吧.</p>
<p>打开终端,输入</p>
<blockquote><p>sudo update-grub</p></blockquote>
<p>看到</p>
<blockquote><p>Generating grub.cfg ...<br />
Found linux image: /boot/vmlinuz-2.6.35-27-generic<br />
Found initrd image: /boot/initrd.img-2.6.35-27-genericFound Windows Server 2008 (loader) on /dev/sda1<br />
done</p></blockquote>
<p>恭喜，现在已经全线完工了。赶快重启一下看看熟悉的grub引导菜单是不是回来了～</p>
<hr />
<p>关于grub看以看看小狼以前的文章:<a href="http://www.aitilife.com/how-to-decrease-grub-menu-item-in-ubuntu/">http://www.aitilife.com/how-to-decrease-grub-menu-item-in-ubuntu/</a></p>
-- 在 <a href="http://t.sina.com.cn/utips">微博上关注我们 @utips</a> 

<hr>

# 本文采用<a href="http://creativecommons.org/licenses/by/2.5/cn/">CC协议</a>进行授权，转载本文请注明<a href="http://wowubuntu.com/fix-grub.html" title="Permalink">本文链接<a>。/  15  条留言 <br>

- <a href="http://twitter.com/ubuntu_tips">Twitter</a> 
/ <a href="http://wowubuntu.com/ask">问答</a> 
/ <a href="http://wowubuntu.com/submit">投稿</a>
/ <a href="http://wowubuntu.com/join">加入我们</a> wow0slx6bcs721xo1udcc<br>- 高性价比 <a href="http://wowubuntu.com/vps.html">Ubuntu VPS</a> / 本站架设于<a href="http://www.photonvps.com/billing/aff.php?aff=129"> PhotonVPS </a>

<p><a href="http://www.linode.com/?r=8f172925d426d78cd6f6119de00b34f209a66abd" target="_blank"><img src="http://wowubuntu.com/wp-content/uploads/2012/12/Linode_AD.png"></a></p><div class="wp-about-author-containter-top" style="background-color:#e8e8e8;"><div class="wp-about-author-pic"><img alt='' src='http://0.gravatar.com/avatar/281439e51bb4ae60bbc80c05b6281d35?s=100&amp;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D100&amp;r=G' class='avatar avatar-100 photo' height='100' width='100' /></div><div class="wp-about-author-text"><h3><a href='http://wowubuntu.com/author/lijiantao' title='O湛狼O-aitilife'>O湛狼O-aitilife</a></h3><p></p><p><a href='http://wowubuntu.com/author/lijiantao' title='More posts by O湛狼O-aitilife'>More Posts</a> </p></div></div>]]></content:encoded>
			<wfw:commentRss>http://wowubuntu.com/fix-grub.html/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>
