未插入 USB 时无法启动 ubuntu,也无法使用常规方式安装 grub

未插入 USB 时无法启动 ubuntu,也无法使用常规方式安装 grub

我使用闪存自动安装了 ubuntu,但是没有 usb 就无法启动。我试过输入“ sudo grub-install/dev/sda”的方法,但就是不行!而且我仍然搞不清楚 grub2 应该安装在哪里。希望有人能帮助我。终端屏幕显示如下:

ubuntu@ubuntu:~$ sudo fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xa62b4079

Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1  1953525167   976762583+  ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/sdb: 7858 MB, 7858028544 bytes
90 heads, 30 sectors/track, 5684 cylinders, total 15347712 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc3072e18

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          24    15347711     7673844    c  W95 FAT32 (LBA)

ubuntu@ubuntu:~$ sudo grub-install/dev/sda
sudo: grub-install/dev/sda: command not found

答案1

grub-install和之间缺少一个空格/dev/sda

sudo grub-install/dev/sda

因此sudo查找grub-install/dev/sda命令。命令应遵循以下模式:

sudo [sudo-option] command [command-arguments]

因此就你的情况而言:

  • 命令是grub-install
  • 命令参数只有一个,即/dev/sda(设备节点)

顺便说一句,要修复启动问题,您需要挂载根分区,然后添加--root-directory选项。例如:

sudo grub-install --root-directory=/media/username/rootpartiton /dev/sda

参考:

从 dash 或使用 打开终端Ctrl+Alt+t,然后运行这些来查看手册

  • man sudo
  • man grub-install

要退出,请按q

相关内容