安装ubuntu出错:无法将GRUB安装到/dev/sda(as superuser) 执行‘grub-install/

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
ttwlqqj
帖子: 5
注册时间: 2015-10-26 23:11
系统: ubuntu

安装ubuntu出错:无法将GRUB安装到/dev/sda(as superuser) 执行‘grub-install/

#1

帖子 ttwlqqj » 2015-10-26 23:23

安装ubuntu-14.10-desktop-amd64 的时候出现提示:
“无法将GRUB安装到/dev/sda(as superuser) 执行‘grub-install/dev/sda'失败 这是个致命错误。”
安装环境:Windows 10 ,安装方法:U盘,进入“现在安装”前有个“安装启动引导的设备”选项,我有尝试过 默认的“dev/sda.....”和我自己新增的‘/boot’ 挂载点的设备“dev/sda11”都不行。挂载点我新建了“/”25G. "/swap"4G. "/boot"200M. "/home"30G.
作为linux初学者遇到这样的问题,希望前辈帮助!
bu zhi dao wei shen me wo wu fa ti jiao hui fu,zhi neng zhe yang zi shi shi le:
ubuntu@ubuntu:~$ sudo fdisk -l /dev/sda

Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 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
Disklabel type: gpt
Disk identifier: 542F5D7D-1E4E-4C38-AE14-5348C8719320

Device Start End Sectors Size Type
/dev/sda1 2048 1230847 1228800 600M Windows recovery environment
/dev/sda2 1230848 1845247 614400 300M EFI System
/dev/sda3 1845248 2107391 262144 128M Microsoft reserved
/dev/sda4 2107392 165947391 163840000 78.1G Microsoft basic data
/dev/sda5 165947392 306358271 140410880 67G Microsoft basic data
/dev/sda6 432187392 677947391 245760000 117.2G Microsoft basic data
/dev/sda7 677947392 945762303 267814912 127.7G Microsoft basic data
/dev/sda8 945764352 976773119 31008768 14.8G Windows recovery environment

ubuntu@ubuntu:~$ sudo parted /dev/sda unit B print
Model: ATA TOSHIBA MQ01ABF0 (scsi)
Disk /dev/sda: 500107862016B
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 1048576B 630194175B 629145600B ntfs Basic data partition hidden, diag
2 630194176B 944766975B 314572800B fat32 EFI system partition boot, esp
3 944766976B 1078984703B 134217728B Microsoft reserved partition msftres
4 1078984704B 84965064703B 83886080000B ntfs Basic data partition msftdata
5 84965064704B 156855435263B 71890370560B ntfs Basic data partition msftdata
6 221279944704B 347109064703B 125829120000B ntfs Basic data partition msftdata
7 347109064704B 484230299647B 137121234944B ntfs Basic data partition msftdata
8 484231348224B 500107837439B 15876489216B ntfs Basic data partition hidden, diag

ubuntu@ubuntu:~$ sudo gdisk -l /dev/sda
GPT fdisk (gdisk) version 0.8.8

Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 542F5D7D-1E4E-4C38-AE14-5348C8719320
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 125833197 sectors (60.0 GiB)

Number Start (sector) End (sector) Size Code Name
1 2048 1230847 600.0 MiB 2700 Basic data partition
2 1230848 1845247 300.0 MiB EF00 EFI system partition
3 1845248 2107391 128.0 MiB 0C01 Microsoft reserved part
4 2107392 165947391 78.1 GiB 0700 Basic data partition
5 165947392 306358271 67.0 GiB 0700 Basic data partition
6 432187392 677947391 117.2 GiB 0700 Basic data partition
7 677947392 945762303 127.7 GiB 0700 Basic data partition
8 945764352 976773119 14.8 GiB 2700 Basic data partition
ubuntu@ubuntu:~$
上次由 ttwlqqj 在 2015-10-27 18:55,总共编辑 1 次。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 安装ubuntu出错:无法将GRUB安装到/dev/sda(as superuser) 执行‘grub-inst

#2

帖子 poloshiao » 2015-10-27 0:26

1. 使用 Ubuntu Live CD/DVD/USB 開機
登入 試用桌面 把下面指令 複製 貼進終端機 執行
1-1. sudo fdisk -l /dev/sda
1-2. sudo parted /dev/sda unit B print
1-3. sudo gdisk -l /dev/sda
把結果直接 選取/複製/貼上來
ttwlqqj
帖子: 5
注册时间: 2015-10-26 23:11
系统: ubuntu

Re: 安装ubuntu出错:无法将GRUB安装到/dev/sda(as superuser) 执行‘grub-inst

#3

帖子 ttwlqqj » 2015-10-27 18:51

poloshiao, ubuntu@ubuntu:~$ sudo fdisk -l /dev/sda

Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 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
Disklabel type: gpt
Disk identifier: 542F5D7D-1E4E-4C38-AE14-5348C8719320

Device Start End Sectors Size Type
/dev/sda1 2048 1230847 1228800 600M Windows recovery environment
/dev/sda2 1230848 1845247 614400 300M EFI System
/dev/sda3 1845248 2107391 262144 128M Microsoft reserved
/dev/sda4 2107392 165947391 163840000 78.1G Microsoft basic data
/dev/sda5 165947392 306358271 140410880 67G Microsoft basic data
/dev/sda6 432187392 677947391 245760000 117.2G Microsoft basic data
/dev/sda7 677947392 945762303 267814912 127.7G Microsoft basic data
/dev/sda8 945764352 976773119 31008768 14.8G Windows recovery environment

ubuntu@ubuntu:~$ sudo parted /dev/sda unit B print
Model: ATA TOSHIBA MQ01ABF0 (scsi)
Disk /dev/sda: 500107862016B
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number Start End Size File system Name Flags
1 1048576B 630194175B 629145600B ntfs Basic data partition hidden, diag
2 630194176B 944766975B 314572800B fat32 EFI system partition boot, esp
3 944766976B 1078984703B 134217728B Microsoft reserved partition msftres
4 1078984704B 84965064703B 83886080000B ntfs Basic data partition msftdata
5 84965064704B 156855435263B 71890370560B ntfs Basic data partition msftdata
6 221279944704B 347109064703B 125829120000B ntfs Basic data partition msftdata
7 347109064704B 484230299647B 137121234944B ntfs Basic data partition msftdata
8 484231348224B 500107837439B 15876489216B ntfs Basic data partition hidden, diag

ubuntu@ubuntu:~$ sudo gdisk -l /dev/sda
GPT fdisk (gdisk) version 0.8.8

Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 542F5D7D-1E4E-4C38-AE14-5348C8719320
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 125833197 sectors (60.0 GiB)

Number Start (sector) End (sector) Size Code Name
1 2048 1230847 600.0 MiB 2700 Basic data partition
2 1230848 1845247 300.0 MiB EF00 EFI system partition
3 1845248 2107391 128.0 MiB 0C01 Microsoft reserved part
4 2107392 165947391 78.1 GiB 0700 Basic data partition
5 165947392 306358271 67.0 GiB 0700 Basic data partition
6 432187392 677947391 117.2 GiB 0700 Basic data partition
7 677947392 945762303 127.7 GiB 0700 Basic data partition
8 945764352 976773119 14.8 GiB 2700 Basic data partition
ubuntu@ubuntu:~$
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 安装ubuntu出错:无法将GRUB安装到/dev/sda(as superuser) 执行‘grub-inst

#4

帖子 poloshiao » 2015-10-27 19:27

无法将GRUB安装到/dev/sda
Device Start End Sectors Size Type
/dev/sda1 2048 1230847 1228800 600M Windows recovery environment
/dev/sda2 1230848 1845247 614400 300M EFI System
/dev/sda3 1845248 2107391 262144 128M Microsoft reserved
/dev/sda4 2107392 165947391 163840000 78.1G Microsoft basic data
/dev/sda5 165947392 306358271 140410880 67G Microsoft basic data
/dev/sda6 432187392 677947391 245760000 117.2G Microsoft basic data
/dev/sda7 677947392 945762303 267814912 127.7G Microsoft basic data
/dev/sda8 945764352 976773119 31008768 14.8G Windows recovery environment
1. 你開機的時候 是不是在 UEFI enabled 情況下 ?
2. 你安裝 Ubuntu 時 把 / 掛載在哪個分割區 ? 有沒有勾選格式化 ?
3. 有沒有掛載 /boot/efi 到 /dev/sda2 ? (不要勾選格式化)
4. 你很多分割類型是 Basic data partition
要安裝 Ubuntu 可能會有辨識的問題
等你 2. 的回答 再建議你如何作
挂载点我新建了“/”25G. "/swap"4G. "/boot"200M. "/home"30G.
5. 你需要把掛載到哪幾個分割區的對照表 一同提供
ttwlqqj
帖子: 5
注册时间: 2015-10-26 23:11
系统: ubuntu

Re: 安装ubuntu出错:无法将GRUB安装到/dev/sda(as superuser) 执行‘grub-inst

#5

帖子 ttwlqqj » 2015-10-27 20:09

2. 你安裝 Ubuntu 時 把 / 掛載在哪個分割區 ? 有沒有勾選格式化 ?
是这样的,我首先在windoes 10 里压缩出一个空闲状态的60G 大小的磁盘,安装Ubuntu的时候用的就是那个空闲磁盘做的分区。我没有主动勾格式化,都是默认状态,也就是我不清楚它是否默认是格式化的。
ttwlqqj
帖子: 5
注册时间: 2015-10-26 23:11
系统: ubuntu

Re: 安装ubuntu出错:无法将GRUB安装到/dev/sda(as superuser) 执行‘grub-inst

#6

帖子 ttwlqqj » 2015-10-27 21:40

1. 你開機的時候 是不是在 UEFI enabled 情況下 ?
2. 你安裝 Ubuntu 時 把 / 掛載在哪個分割區 ? 有沒有勾選格式化 ?
3. 有沒有掛載 /boot/efi 到 /dev/sda2 ? (不要勾選格式化)
4. 你很多分割類型是 Basic data partition
要安裝 Ubuntu 可能會有辨識的問題
等你 2. 的回答 再建議你如何作
挂载点我新建了“/”25G. "/swap"4G. "/boot"200M. "/home"30G.
5. 你需要把掛載到哪幾個分割區的對照表 一同提供[/quote]
1.是在 UEFI enabled 情況下。
2.默认勾选了格式化。
3.没有挂载/boot/efi 到 /dev/sda2 。
4.那怎么办?
5.挂载的分割区,都是我自定义的分割区,是我在Windows10里压缩出来的那60G 中分出来的。(貌似终端机没有显示出我压缩出来的那60G)
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: 安装ubuntu出错:无法将GRUB安装到/dev/sda(as superuser) 执行‘grub-inst

#7

帖子 poloshiao » 2015-10-28 1:45

1.是在 UEFI enabled 情況下
Partition Table: gpt
3.没有挂载/boot/efi 到 /dev/sda2 。
1. UEFI enabled 情況下
把 Ubuntu 安裝到 GPT 的分割區
一定要掛載 /boot/efi 到 /dev/sda2 (Fat32) 但是不必/boot/efi 到 /dev/sda2勾選格式化
5.挂载的分割区,都是我自定义的分割区,是我在Windows10里压缩出来的那60G 中分出来的。(貌似终端机没有显示出我压缩出来的那60G)
2. 請使用
/dev/sdan
分割區代碼表示
2-1. 终端机没有显示出來 表示無法辨識
2-2. 建議 使用 Live USB/DVD 開機 登入試用桌面
使用 gparted 壓縮
https://help.ubuntu.com/community/Howto ... Partitions
2-2-1. 如果 Windows 分割區 有重要資料 請先備存 雖然風險不大
ttwlqqj
帖子: 5
注册时间: 2015-10-26 23:11
系统: ubuntu

Re: 安装ubuntu出错:无法将GRUB安装到/dev/sda(as superuser) 执行‘grub-inst

#8

帖子 ttwlqqj » 2015-10-28 7:39

感谢 poloshiao 的回复和指导。由于个人的时间原因没目前没有办法继续安装ubuntu,我打算在假期安装并且尝试 poloshiao, 所给的方法。我会把安装情况跟大家分享。
回复