[Problem feedback] 第二硬盘启动
Tofloor
poster avatar
hezm
deepin
2026-02-18 21:42
Author

第一硬盘原来安装win7,mbr+legacy.第二硬盘安装deepin,gpt+uefi。第二硬盘能正常启动。自从第一硬盘换成win11以后,第二硬盘不能启动,error,grub-is lockdown,recude mode.现在我知道用u盘启动了,请告诉我怎样用命令行修复不能启动的问题。

Reply Favorite View the author
All Replies
pzm9012
Moderator
2026-02-18 22:57
#1

在BIOS中还能找到deepin启动项的话可以调至第一;或者试一下Live系统中用grub-install命令出现安装grub

Reply View the author
hezm
deepin
2026-02-19 13:29
#2
pzm9012

在BIOS中还能找到deepin启动项的话可以调至第一;或者试一下Live系统中用grub-install命令出现安装grub

能不能具体讲Live系统中用grub-install,

Reply View the author
LiuYongzhang
deepin
2026-02-19 19:55
#3
hezm

能不能具体讲Live系统中用grub-install,

帮你问了豆包

进入deepin25的镜像第一项进入live

在终端运行修改密码

sudo -i

passwd liveuser

输入新密码2次

我直接给你 Deepin Live 系统里用 grub-install 修复引导 的完整、可照抄命令版,适合你现在就在 U 盘 Live 里操作。


一、先搞清楚你要装到哪个盘

1. 查看磁盘

sudo fdisk -l

或者

sudo lsblk

找到你的系统盘,一般是:

  • /dev/sda
  • /dev/nvme0n1

下面我统一用 /dev/sda 举例,你自己替换成你的盘。


二、挂载 root 分区 + EFI 分区(UEFI 必做)

1. 先挂载根分区(你的 Deepin 系统分区)

sudo mount /dev/sda2 /mnt

sda2 是你根分区,改成你实际的)

2. 挂载 EFI 分区(UEFI 启动必须)

sudo mount /dev/sda1 /mnt/boot/efi

sda1 一般是 EFI 分区,fat32、大小 200M~500M)

3. 挂载虚拟文件系统

bash

运行

sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo mount --bind /run /mnt/run

4. chroot 进你的系统

sudo chroot /mnt

进入后提示符会变成 root@xxx 说明成功。


三、真正执行 grub-install

① UEFI 模式(现在几乎都是)

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Deepin

② 传统 BIOS/MBR 模式

grub-install /dev/sda

最后更新 grub 配置

update-grub

四、退出重启

exit
sudo reboot

五、最常见报错 & 解决

  1. EFI 目录找不到
    → 你没挂载 /boot/efi

  2. cannot find EFI directory
    → 加 --efi-directory=/boot/efi

  3. failed to get canonical path of /cow
    → 你没 chroot,直接在 Live 里执行了,必须 chroot!

  4. 提示要安装 i386-pc 模块

    apt update
    apt install grub-pc-bin
    

你告诉我两件事,我能直接给你一字不改就能用的专属命令

  1. 你是 UEFI 还是 BIOS
  2. 发一下 sudo lsblk 的截图 / 结果
Reply View the author
hezm
deepin
2026-02-19 21:35
#4
LiuYongzhang

帮你问了豆包

进入deepin25的镜像第一项进入live

在终端运行修改密码

sudo -i

passwd liveuser

输入新密码2次

我直接给你 Deepin Live 系统里用 grub-install 修复引导 的完整、可照抄命令版,适合你现在就在 U 盘 Live 里操作。


一、先搞清楚你要装到哪个盘

1. 查看磁盘

sudo fdisk -l

或者

sudo lsblk

找到你的系统盘,一般是:

  • /dev/sda
  • /dev/nvme0n1

下面我统一用 /dev/sda 举例,你自己替换成你的盘。


二、挂载 root 分区 + EFI 分区(UEFI 必做)

1. 先挂载根分区(你的 Deepin 系统分区)

sudo mount /dev/sda2 /mnt

sda2 是你根分区,改成你实际的)

2. 挂载 EFI 分区(UEFI 启动必须)

sudo mount /dev/sda1 /mnt/boot/efi

sda1 一般是 EFI 分区,fat32、大小 200M~500M)

3. 挂载虚拟文件系统

bash

运行

sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo mount --bind /run /mnt/run

4. chroot 进你的系统

sudo chroot /mnt

进入后提示符会变成 root@xxx 说明成功。


三、真正执行 grub-install

① UEFI 模式(现在几乎都是)

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Deepin

② 传统 BIOS/MBR 模式

grub-install /dev/sda

最后更新 grub 配置

update-grub

四、退出重启

exit
sudo reboot

五、最常见报错 & 解决

  1. EFI 目录找不到
    → 你没挂载 /boot/efi

  2. cannot find EFI directory
    → 加 --efi-directory=/boot/efi

  3. failed to get canonical path of /cow
    → 你没 chroot,直接在 Live 里执行了,必须 chroot!

  4. 提示要安装 i386-pc 模块

    apt update
    apt install grub-pc-bin
    

你告诉我两件事,我能直接给你一字不改就能用的专属命令

  1. 你是 UEFI 还是 BIOS
  2. 发一下 sudo lsblk 的截图 / 结果

用UEFi+gpt

Reply View the author
pzm9012
Moderator
2026-02-19 21:45
#5
hezm

能不能具体讲Live系统中用grub-install,

参考2.2章节 https://www.yuque.com/pzm9012/ct5ume/ihc99w#u7aGz ,后半部分不用看了对磐石的V25无效

如果安装失败可以试试手动指定 --target=x86_64-efi

Reply View the author
文盲振伟🍀
deepin
2026-02-20 16:15
#6

如果嫌麻烦,可以有简单粗暴的方法,先进live系统把deepin所在磁盘做镜像备份。然后重装deepin,自然可以恢复双引导。然后再把备份就镜像恢复回去。你说棒不棒

Reply View the author
金声玉振
deepin
2026-03-09 19:05
#7
LiuYongzhang

帮你问了豆包

进入deepin25的镜像第一项进入live

在终端运行修改密码

sudo -i

passwd liveuser

输入新密码2次

我直接给你 Deepin Live 系统里用 grub-install 修复引导 的完整、可照抄命令版,适合你现在就在 U 盘 Live 里操作。


一、先搞清楚你要装到哪个盘

1. 查看磁盘

sudo fdisk -l

或者

sudo lsblk

找到你的系统盘,一般是:

  • /dev/sda
  • /dev/nvme0n1

下面我统一用 /dev/sda 举例,你自己替换成你的盘。


二、挂载 root 分区 + EFI 分区(UEFI 必做)

1. 先挂载根分区(你的 Deepin 系统分区)

sudo mount /dev/sda2 /mnt

sda2 是你根分区,改成你实际的)

2. 挂载 EFI 分区(UEFI 启动必须)

sudo mount /dev/sda1 /mnt/boot/efi

sda1 一般是 EFI 分区,fat32、大小 200M~500M)

3. 挂载虚拟文件系统

bash

运行

sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo mount --bind /run /mnt/run

4. chroot 进你的系统

sudo chroot /mnt

进入后提示符会变成 root@xxx 说明成功。


三、真正执行 grub-install

① UEFI 模式(现在几乎都是)

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Deepin

② 传统 BIOS/MBR 模式

grub-install /dev/sda

最后更新 grub 配置

update-grub

四、退出重启

exit
sudo reboot

五、最常见报错 & 解决

  1. EFI 目录找不到
    → 你没挂载 /boot/efi

  2. cannot find EFI directory
    → 加 --efi-directory=/boot/efi

  3. failed to get canonical path of /cow
    → 你没 chroot,直接在 Live 里执行了,必须 chroot!

  4. 提示要安装 i386-pc 模块

    apt update
    apt install grub-pc-bin
    

你告诉我两件事,我能直接给你一字不改就能用的专属命令

  1. 你是 UEFI 还是 BIOS
  2. 发一下 sudo lsblk 的截图 / 结果

root@deepin:/# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Deepin
正在为 x86_64-efi 平台进行安装。
grub-install: 警告: EFI variables cannot be set on this system.
grub-install: 警告: You will have to complete the GRUB setup manually.
安装完成。没有报告错误。
root@deepin:/#

请教:出现这个警告怎么办?前面安装称功过一次,结果一高兴重启前把U盘拔出来了。后来再安装就出这错误了……看到最后说安装完成,就继续下面的步骤,最后重启后还是只有WIN10的启动,进不了原来的deepin了……

root@deepin:/# update-grub
Generating grub configuration file ...
Found theme: /boot/grub/themes/deepin-fallback/theme.txt
Found background image: /boot/grub/themes/deepin-fallback/background.jpg
Found linux image: /boot/vmlinuz-6.6.84-amd64-desktop-hwe
Found initrd image: /boot/initrd.img-6.6.84-amd64-desktop-hwe
Found linux image: /boot/vmlinuz-6.6.40-amd64-desktop-hwe
Found initrd image: /boot/initrd.img-6.6.40-amd64-desktop-hwe
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
grub-probe: 错误: 无法找到 /dev/sdc2 对应的 GRUB 驱动器。请检查您的 device.map.
Found Windows Boot Manager on /dev/sdb1@/EFI/Microsoft/Boot/bootmgfw.efi
done
root@deepin:/#

Reply View the author
LiuYongzhang
deepin
2026-03-10 07:51
#8
金声玉振

root@deepin:/# grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Deepin
正在为 x86_64-efi 平台进行安装。
grub-install: 警告: EFI variables cannot be set on this system.
grub-install: 警告: You will have to complete the GRUB setup manually.
安装完成。没有报告错误。
root@deepin:/#

请教:出现这个警告怎么办?前面安装称功过一次,结果一高兴重启前把U盘拔出来了。后来再安装就出这错误了……看到最后说安装完成,就继续下面的步骤,最后重启后还是只有WIN10的启动,进不了原来的deepin了……

root@deepin:/# update-grub
Generating grub configuration file ...
Found theme: /boot/grub/themes/deepin-fallback/theme.txt
Found background image: /boot/grub/themes/deepin-fallback/background.jpg
Found linux image: /boot/vmlinuz-6.6.84-amd64-desktop-hwe
Found initrd image: /boot/initrd.img-6.6.84-amd64-desktop-hwe
Found linux image: /boot/vmlinuz-6.6.40-amd64-desktop-hwe
Found initrd image: /boot/initrd.img-6.6.40-amd64-desktop-hwe
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
grub-probe: 错误: 无法找到 /dev/sdc2 对应的 GRUB 驱动器。请检查您的 device.map.
Found Windows Boot Manager on /dev/sdb1@/EFI/Microsoft/Boot/bootmgfw.efi
done
root@deepin:/#

因为你的win7,mbr+legacy,不是uefi启动,进入bios把deepin调整为第一启动试试

在浏览器打开豆包,登陆手机号+验证码,把遇到的问题告诉他根据提示操作

Reply View the author
金声玉振
deepin
2026-03-10 11:52
#9
LiuYongzhang

因为你的win7,mbr+legacy,不是uefi启动,进入bios把deepin调整为第一启动试试

在浏览器打开豆包,登陆手机号+验证码,把遇到的问题告诉他根据提示操作

联想桌面一体机,sdb已经在BIOS里设置为第一启动了,是UEFI分区,sdb1就是EFI分区,后面安装了win10,然后安装了DEEPIN23.1,昨天估计是显卡坏了,正用着就出现花屏,重启几次后越花得严重了,然后DEEPIN的启动GRUB就不见了,再开机就直接进WIN10了。后来我找了一台同样的机器,把硬盘换上,仍然没有DEEPIN的启动,直接进WIN10。昨天看有贴子说备份了分区再重新装一遍,然后把分区写回去,今天早上照样做了一遍,写回去直接出错了,开机后出了一行文字,然后就是 grub>的提示符,现在不知道咋办了……

Reply View the author
金声玉振
deepin
2026-03-10 12:52
#10
LiuYongzhang

因为你的win7,mbr+legacy,不是uefi启动,进入bios把deepin调整为第一启动试试

在浏览器打开豆包,登陆手机号+验证码,把遇到的问题告诉他根据提示操作

阿弥陀佛,终于解决了!这次安装虽然失败了,但是BISO启动项已经变成了DEEPIN,说明GRUB安装成功了,然后再按照您上面的方法做了一遍,原来的系统终于回来了~joy

感谢大神的指导!👍

Reply View the author
LiuYongzhang
deepin
2026-03-10 12:54
#11
金声玉振

阿弥陀佛,终于解决了!这次安装虽然失败了,但是BISO启动项已经变成了DEEPIN,说明GRUB安装成功了,然后再按照您上面的方法做了一遍,原来的系统终于回来了~joy

感谢大神的指导!👍

应该是重新分区安装再还原后uuid对不上的事情

Reply View the author
金声玉振
deepin
2026-03-10 15:05
#12
LiuYongzhang

应该是重新分区安装再还原后uuid对不上的事情

没有重新分区,还是原硬盘,就是电脑突然花屏(半年来已经有两台同样的电脑出现了花屏,估计是散热口被灰尘堵住了,过热导致了核显出问题了),然后重启几次就没有了引导。

Reply View the author