用LiveCD覆盖Windows启动设置

从LiveCD启动并打开一个终端(terminal).你需要运行几条命令,比如sudo -i,来获得root权限.小心任何一个输入错误,这在root下可能带来不可挽回的结果.

我们需要找到安装Ubuntu的分区.用fdisk -l命令得到分区信息,例如:

$ sudo fdisk -l

Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1           8       64228+  83  Linux
/dev/hda2               9        1224     9767520   83  Linux
/dev/hda3   *        1225        2440     9767520   a5  FreeBSD
/dev/hda4            2441       14593    97618972+   5  Extended
/dev/hda5           14532       14593      498015   82  Linux swap / Solaris
/dev/hda6            2441       14530    97112862   83  Linux

Partition table entries are not in disk order

Here I have three Linux partitions. /dev/hda2 is my root partition, /dev/hda1 is my /boot partition and /dev/hda6 is my /home partitoins. If you only have one, obviously this is the one your Ubuntu system is installed on. If you have more than one and you don't know which one your Ubuntu is installed on, we'll look for it later. First, create a mountpoint for your partition, for example :

$ mkdir /mnt/root

Then mount your partition in it. If you don't know which one it is, then mount any of them, we'll se if it's the correct one.

$ mount -t ext3 /dev/hda2 /mnt/root

Of course, replace /dev/hda2 with the correct name of your partition. You can check if it's the correct one by running ls /mnt/root, which should output something like this :

bin    dev      home        lib    mnt   root     srv  usr
boot   etc      initrd      lib64  opt   sbin     sys  var
cdrom  initrd.img  media  proc  selinux  tmp  vmlinuz

If what you have looks not at all like this, you didn't mount the correct partition. Do umount /mnt/root to unmount it and try another one. You also need to mount your /boot partition if you made one, like this :

$ mount -t ext3 /dev/hda1 /mnt/root/boot

To make sure it was the correct one, run ls /mnt/root/boot, which sould output something like this :

config-2.6.18-3-686      initrd.img-2.6.18-3-686.bak  System.map-2.6.18-3-686
grub                     lost+found                   vmlinuz-2.6.18-3-686
initrd.img-2.6.18-3-686  memtest86+.bin

Once again, if what you have doesn't fit, unmount it and try another partition.

Now that everything is mounted, we just need to reinstall GRUB :

$ grub-install --root-directory=/mnt/root /dev/hda

If you got BIOS warnings try:

$ grub-install --root-directory=/mnt/root /dev/hda --recheck

Of course, replace /dev/hda with the location you want to install GRUB on. If all went well, you should see something like this :

Installation finished. No error reported.

This is the contents of the device map /boot/grub/device.map.

Check if this is correct or not. If any of the lines is incorrect,

fix it and re-run the script `grub-install'.

(hd0) /dev/hda

Now you can reboot and the GRUB menu should appear. If you see a warning message regarding XFS filesystem, you can ignore it.

重装windows后如何找回我的ubuntu相关推荐

  1. 重装windows后 用live cd修复ubuntu启动gurb

    一般安装windows 和 linux双系统, 都是先安装windows, 然后安装linux, 那么linux的grub安装会加入windows启动的选项, 开机时就能选择启动进入哪个系统了. 但是 ...

  2. 双系统安装红旗linux,Linux双系统电脑重装Windows后进入红旗Linux的方法

    本教程分享有关红旗linux操作系统图文教程内容,希望对您有用 部分安装了红旗Linux6.0和Windows双系统的Linux用户,在使用过称中遇到了一些问题,导致Windows系统进行了重装,重装 ...

  3. linux系统启动项没了,重装Windows后找回丢失的Linux启动项

    众所周知,安装Windows和linux双系统的时候最好是先装Windows,然后安装linux.因为linux可以寻找硬盘下的Windows系统,从而显示引导菜单.而霸道的Windows直接无视其他 ...

  4. 重装Windows后修复Linux引导

    装了双系统(Windows和Linux)的机器重新安装Windows后会导致Linux的引导丢失而无法进入原先的Linux系统[其原因是Windows会覆盖原先MBR中的Linux的BootLoade ...

  5. 重装windows后必安装软件(个人习惯)

    文章目录 火绒拦截广告弹窗: V2 ra y 客户端官网: 截图 & 录屏: 自动清理内存: 实时显示网速,CPU,内存: 设置任务栏磨砂 | 透明: 照片查看: gif 录制 & 加 ...

  6. 双系统重装windows后修复UBUNTU的GRUB

    1.问题背景 本子是win7和ubuntu10.04双系统,用的还算好,虽然只有在用QQ的时候还会用到win7,但还是保留windows.可是几天 前,win7突然总是蓝屏.死机,更重要是的背景变成黑 ...

  7. 双系统重装windows后如何恢复ubuntu启动项

    解决方法有两种: 一.把Ubuntu的启动位置加入到Windows的boot里(我没有去尝试这种方法). 二.把硬盘的引导位置,设置成到Ubuntu的分区,具体操作如下: 1.用安装Ubuntu的光盘 ...

  8. 双系统重装windows后恢复ubuntu

    sudo -i fdisk -l mount /dev/sda# /mnt grub-install --root-directory=/mnt /dev/sda umount /mnt reboot ...

  9. android移植jdk,重装windows后移植jdk和Android Studio

    转载: 对与Android的开发者,同样安装JDK+Android Studio + Adnroid SDK + 各种虚拟机 + 各种个性化的环境配置,同样没有小半天时间无法搞定! 那么问题来了?对于 ...

最新文章

  1. 作为程序员,要取得非凡成就需要记住的15件事。
  2. Instagram个性化推荐工程中三个关键技术是什么?
  3. html ajax put请求,javascript – PUT Ajax请求
  4. Spring Cloud Alibaba---服务注册、发现、管理中心Nacos
  5. Java并发学习之玩转线程池
  6. 前端获取浏览器标识_浏览器缓存机制
  7. 你必须足够强大,这个世界才会更加公平
  8. eclipse定义和修改模板
  9. 区别Ruby的require,load,和include
  10. Python基本操作(四) 循环与判断
  11. oracle的rownum理解
  12. Java 获取日期间的日期 根据日期获取星期
  13. rabbitmq使用_RabbitMQ 简介以及使用场景
  14. 特征提取算法 知乎_对话 | 港科大教授权龙:为什么三维重建才是计算机视觉的灵魂?...
  15. Linux中vim命令详解
  16. 哔哩哔哩轻视频怎么去水印
  17. java计算机毕业设计青岛地区常见昆虫图鉴与论坛源码+数据库+lw文档+系统
  18. 心电信号系统GUI系统
  19. opencv通过dll调用matlab函数,图片作为参数
  20. vlc-for-android

热门文章

  1. 【ADS层表-V1】前端页面所需的数据库设计——大数据开发实战项目(五)
  2. caffe2学习笔记一:图像预处理
  3. mysql连oracle方法_Oracle数据库三种连接方式
  4. python之矩阵的旋转
  5. sliverlight有关下载
  6. (二十二)岁月无声 - 9
  7. win10桌面不停自动刷新闪屏解决方法
  8. 在UE4.27下打包VR程序并部署到PICO 3
  9. 适合女生玩的可爱网站
  10. 【图解深度学习】连小学生都能看懂的深度学习基础总结【第一章什么是神经网络?】