分享下重装windows7/8后恢复linuxdeepin启动项
Tofloor
poster avatar
skinnyshy
deepin
2013-10-14 21:03
Author
官方有针对好几种情况的方法,我等小白看了之后很晕,自己琢磨了下。

首先确定你的分区有没有/boot,这个安装时候你应该知道

之后用live CD试用linux deepin,打开终端
在终端中输入
  1. sudo -i
Copy the Code
  1. fdisk -l
Copy the Code
找到ID为83的
我的有两个
  1. Device Boot      Start         End      Blocks   Id  System
  2. /dev/sda1   *          63   106944704    53472321    7  HPFS/NTFS/exFAT
  3. Partition 1 does not start on physical sector boundary.
  4. /dev/sda2       106944766   945310784   419183009+   f  W95 Ext'd (LBA)
  5. Partition 2 does not start on physical sector boundary.
  6. /dev/sda3       945311744   971311103    12999680   83  Linux
  7. /dev/sda4       971311104   976771071     2729984   83  Linux
  8. /dev/sda5       106944768   396901889   144978561    7  HPFS/NTFS/exFAT
  9. /dev/sda6       396901953   686859074   144978561    7  HPFS/NTFS/exFAT
Copy the Code
如果你实在不知道这两个83哪个里面有/boot(因为我的没有分/boot分区所以这个/boot在上面两个ID为83的分区中)
分别挂在两个分区:
首先创建个目录备用
  1. mkdir /mnt1
Copy the Code
挂在sda3到/mnt
  1. mount /dev/sda3 /mnt
Copy the Code
进入目录/mnt ,并列出文件夹内容
  1. cd /mnt
  2. ll
Copy the Code
我的内容如下
  1. 总用量 116
  2. drwxr-xr-x  24 root root  4096 10月 14 12:32 ./
  3. drwxr-xr-x  24 root root  4096 10月 14 12:32 ../
  4. drwxr-xr-x   2 root root  4096  9月 14 16:39 bin/
  5. drwxr-xr-x   3 root root  4096  9月 15 18:17 boot/
  6. drwxr-xr-x   3 root root  4096  8月  6 18:39 dev/
  7. drwxr-xr-x 136 root root 12288 10月 14 12:44 etc/
  8. drwxr-xr-x   5 root root  4096 10月 14 12:32 grub/
  9. drwxr-xr-x   2 root root  4096  9月 14 16:33 home/
  10. lrwxrwxrwx   1 root root    32  9月 14 16:38 initrd.img -> boot/initrd.img-3.8.0-28-generic
  11. lrwxrwxrwx   1 root root    33  9月 14 16:33 initrd.img.old -> /boot/initrd.img-3.8.0-28-generic
  12. drwxr-xr-x  22 root root  4096  9月 15 18:15 lib/
  13. drwxr-xr-x   2 root root  4096  8月  6 18:39 lib64/
  14. drwx------   2 root root 16384  9月 14 16:33 lost+found/
  15. drwxr-xr-x   4 root root  4096 10月 14 11:31 media/
  16. drwxr-xr-x   2 root root  4096  4月 19 17:03 mnt/
  17. drwxr-xr-x   3 root root  4096  9月 15 16:49 opt/
  18. drwxr-xr-x   2 root root  4096  4月 19 17:03 proc/
  19. drwx------   8 root root  4096  9月 15 17:57 root/
  20. drwxr-xr-x   9 root root  4096  8月  6 18:43 run/
  21. drwxr-xr-x   2 root root  4096  9月 15 16:41 sbin/
  22. drwxr-xr-x   2 root root  4096  6月 12  2012 selinux/
  23. drwxr-xr-x   2 root root  4096  8月  6 18:39 srv/
  24. drwxr-xr-x   2 root root  4096  1月 30  2013 sys/
  25. drwxrwxrwt  10 root root  4096 10月 14 12:44 tmp/
  26. drwxr-xr-x  11 root root  4096  9月 15 18:15 usr/
  27. drwxr-xr-x  11 root root  4096  9月 17 11:24 var/
  28. lrwxrwxrwx   1 root root    29  9月 14 16:38 vmlinuz -> boot/vmlinuz-3.8.0-28-generic
Copy the Code
看到最后一行有vmlinuz-3.8.0-28-generic说明是这个分区,如果没有就在挂在sda4到mnt1
  1. mount /dev/sda4 /mnt1
Copy the Code
之后也是进去看内容。
之后按照官方帮助文档里面的:
如果/boot没有单独分区:
  1. sudo mount /dev/sda3 /mnt
  2. sudo grub-install --boot-directory=/mnt/boot /dev/sda
Copy the Code
如果/boot单独分区,则:
  1. sudo mount /dev/sda3 /mnt
  2. sudo grub-install --boot-directory=/mnt /dev/sda
Copy the Code
然后重新启动即可。

本人也是小白,分享下自己的解决方法,有不足之处请大家指出,我会更正。
Reply Favorite View the author
All Replies
skinnyshy
deepin
2013-10-14 21:04
#1
此方法就是针对重新安装Windows系统,导致grub启动管理器消失,直接进入Windows系统,无法进入Linux系统.
Reply View the author
a287740928
deepin
2013-10-14 23:05
#2
绝世好贴! :
Reply View the author
charmer
deepin
2013-10-17 18:22
#3
我按照说明执行到
  1. $ sudo grub-install --boot-directory=/mnt/boot /dev/sda
Copy the Code
时,执行结果提示:
grub-probe: error: failed to get canonical path of /cow.
/usr/sbin/grub-bios-setup: warning: this LDM has no Embedding Partition; embedding won't be possible.
/usr/sbin/grub-bios-setup: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
/usr/sbin/grub-bios-setup: error: will not proceed with blocklists.
请教:这是什么问题?
Reply View the author
skinnyshy
deepin
2013-10-17 19:43
#4
我按照说明执行到
  1. $ sudo grub-install --boot-directory=/mnt/boot /dev/sda
Copy the Code
时,执行结果提示:
grub-probe: error: failed to get canonical path of /cow.
/usr/sbin/grub-bios-setup: warning: this LDM has no Embedding Partition; embedding won't be possible.
/usr/sbin/grub-bios-setup: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..
/usr/sbin/grub-bios-setup: error: will not proceed with blocklists.
请教:这是什么问题?
之前我也出现过,确定是不是有/boot分区,目录挂在是否正确
Reply View the author
charmer
deepin
2013-10-17 22:40
#5
可以确定没有/boot分区。
折腾几次都不成功之后,该用DeepInWin方式了。实在没有时间反复折腾、测试、查资料,只好放弃本次学习机会 :cry:
Reply View the author