root@ubuntu:/# grub-install /dev/sda
Installing for i386-pc platform.
grub-install: 警告: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
grub-install: 警告: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
grub-install: エラー: will not proceed with blocklists.
root@ubuntu:/# gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.5
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): p
Disk /dev/sda: 1953525168 sectors, 931.5 GiB
Model: WDC WDS100T2G0A-
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 373B9346-9FAF-4F8E-97E4-CCC8D92DEBB6
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 1953525134
Partitions will be aligned on 2048-sector boundaries
Total free space is 5692 sectors (2.8 MiB)
Number Start (sector) End (sector) Size Code Name
1 2048 616447 300.0 MiB 2700 Basic data partition
2 616448 819199 99.0 MiB EF00 EFI system partition
3 819200 1081343 128.0 MiB 0C01 Microsoft reserved ...
4 1081344 1828886320 871.6 GiB 0700 Basic data partition
5 1828886528 1830641663 857.0 MiB 2700
6 1830643712 1920210943 42.7 GiB 8300
7 1920210944 1953523711 15.9 GiB 8200
Command (? for help): n
Partition number (8-128, default 8): 8
First sector (34-1953525134, default = 1830641664) or {+-}size{KMGTP}: 34
Last sector (34-2047, default = 2047) or {+-}size{KMGTP}:
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): L
Type search string, or <Enter> to show all codes:
0700 Microsoft basic data 0c01 Microsoft reserved
2700 Windows RE 3000 ONIE boot
3001 ONIE config 3900 Plan 9
4100 PowerPC PReP boot 4200 Windows LDM data
4201 Windows LDM metadata 4202 Windows Storage Spaces
7501 IBM GPFS 7f00 ChromeOS kernel
7f01 ChromeOS root 7f02 ChromeOS reserved
8200 Linux swap 8300 Linux filesystem
8301 Linux reserved 8302 Linux /home
8303 Linux x86 root (/) 8304 Linux x86-64 root (/)
8305 Linux ARM64 root (/) 8306 Linux /srv
8307 Linux ARM32 root (/) 8308 Linux dm-crypt
8309 Linux LUKS 830a Linux IA-64 root (/)
830b Linux x86 root verity 830c Linux x86-64 root verity
830d Linux ARM32 root verity 830e Linux ARM64 root verity
830f Linux IA-64 root verity 8310 Linux /var
8311 Linux /var/tmp 8400 Intel Rapid Start
8500 Container Linux /usr 8501 Container Linux resizable rootfs
8502 Container Linux /OEM customization 8503 Container Linux root on RAID
8e00 Linux LVM a000 Android bootloader
a001 Android bootloader 2 a002 Android boot 1
Press the <Enter> key to see more codes, q to quit:
a003 Android recovery 1 a004 Android misc
a005 Android metadata a006 Android system 1
a007 Android cache a008 Android data
a009 Android persistent a00a Android factory
a00b Android fastboot/tertiary a00c Android OEM
a00d Android vendor a00e Android config
a00f Android factory (alt) a010 Android meta
a011 Android EXT a012 Android SBL1
a013 Android SBL2 a014 Android SBL3
a015 Android APPSBL a016 Android QSEE/tz
a017 Android QHEE/hyp a018 Android RPM
a019 Android WDOG debug/sdi a01a Android DDR
a01b Android CDT a01c Android RAM dump
a01d Android SEC a01e Android PMIC
a01f Android misc 1 a020 Android misc 2
a021 Android device info a022 Android APDP
a023 Android MSADP a024 Android DPO
a025 Android recovery 2 a026 Android persist
a027 Android modem ST1 a028 Android modem ST2
a029 Android FSC a02a Android FSG 1
a02b Android FSG 2 a02c Android SSD
Press the <Enter> key to see more codes, q to quit:
a02d Android keystore a02e Android encrypt
a02f Android EKSST a030 Android RCT
a031 Android spare1 a032 Android spare2
a033 Android spare3 a034 Android spare4
a035 Android raw resources a036 Android boot 2
a037 Android FOTA a038 Android system 2
a039 Android cache a03a Android user data
a03b LG (Android) advanced flasher a03c Android PG1FS
a03d Android PG2FS a03e Android board info
a03f Android MFG a040 Android limits
a200 Atari TOS basic data a500 FreeBSD disklabel
a501 FreeBSD boot a502 FreeBSD swap
a503 FreeBSD UFS a504 FreeBSD ZFS
a505 FreeBSD Vinum/RAID a580 Midnight BSD data
a581 Midnight BSD boot a582 Midnight BSD swap
a583 Midnight BSD UFS a584 Midnight BSD ZFS
a585 Midnight BSD Vinum a600 OpenBSD disklabel
a800 Apple UFS a901 NetBSD swap
a902 NetBSD FFS a903 NetBSD LFS
a904 NetBSD concatenated a905 NetBSD encrypted
a906 NetBSD RAID ab00 Recovery HD
Press the <Enter> key to see more codes, q to quit:
af00 Apple HFS/HFS+ af01 Apple RAID
af02 Apple RAID offline af03 Apple label
af04 AppleTV recovery af05 Apple Core Storage
af06 Apple SoftRAID Status af07 Apple SoftRAID Scratch
af08 Apple SoftRAID Volume af09 Apple SoftRAID Cache
af0a Apple APFS b300 QNX6 Power-Safe
bc00 Acronis Secure Zone be00 Solaris boot
bf00 Solaris root bf01 Solaris /usr & Mac ZFS
bf02 Solaris swap bf03 Solaris backup
bf04 Solaris /var bf05 Solaris /home
bf06 Solaris alternate sector bf07 Solaris Reserved 1
bf08 Solaris Reserved 2 bf09 Solaris Reserved 3
bf0a Solaris Reserved 4 bf0b Solaris Reserved 5
c001 HP-UX data c002 HP-UX service
e100 ONIE boot e101 ONIE config
e900 Veracrypt data ea00 Freedesktop $BOOT
eb00 Haiku BFS ed00 Sony system partition
ed01 Lenovo system partition ef00 EFI system partition
ef01 MBR partition scheme ef02 BIOS boot partition
f800 Ceph OSD f801 Ceph dm-crypt OSD
f802 Ceph journal f803 Ceph dm-crypt journal
Press the <Enter> key to see more codes, q to quit:q
Installing for i386-pc platform.
grub-install: 警告: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
grub-install: 警告: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
grub-install: エラー: will not proceed with blocklists.
root@ubuntu:/# gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.5
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): p
Disk /dev/sda: 1953525168 sectors, 931.5 GiB
Model: WDC WDS100T2G0A-
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 373B9346-9FAF-4F8E-97E4-CCC8D92DEBB6
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 1953525134
Partitions will be aligned on 2048-sector boundaries
Total free space is 5692 sectors (2.8 MiB)
Number Start (sector) End (sector) Size Code Name
1 2048 616447 300.0 MiB 2700 Basic data partition
2 616448 819199 99.0 MiB EF00 EFI system partition
3 819200 1081343 128.0 MiB 0C01 Microsoft reserved ...
4 1081344 1828886320 871.6 GiB 0700 Basic data partition
5 1828886528 1830641663 857.0 MiB 2700
6 1830643712 1920210943 42.7 GiB 8300
7 1920210944 1953523711 15.9 GiB 8200
Command (? for help): n
Partition number (8-128, default 8): 8
First sector (34-1953525134, default = 1830641664) or {+-}size{KMGTP}: 34
Last sector (34-2047, default = 2047) or {+-}size{KMGTP}:
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): L
Type search string, or <Enter> to show all codes:
0700 Microsoft basic data 0c01 Microsoft reserved
2700 Windows RE 3000 ONIE boot
3001 ONIE config 3900 Plan 9
4100 PowerPC PReP boot 4200 Windows LDM data
4201 Windows LDM metadata 4202 Windows Storage Spaces
7501 IBM GPFS 7f00 ChromeOS kernel
7f01 ChromeOS root 7f02 ChromeOS reserved
8200 Linux swap 8300 Linux filesystem
8301 Linux reserved 8302 Linux /home
8303 Linux x86 root (/) 8304 Linux x86-64 root (/)
8305 Linux ARM64 root (/) 8306 Linux /srv
8307 Linux ARM32 root (/) 8308 Linux dm-crypt
8309 Linux LUKS 830a Linux IA-64 root (/)
830b Linux x86 root verity 830c Linux x86-64 root verity
830d Linux ARM32 root verity 830e Linux ARM64 root verity
830f Linux IA-64 root verity 8310 Linux /var
8311 Linux /var/tmp 8400 Intel Rapid Start
8500 Container Linux /usr 8501 Container Linux resizable rootfs
8502 Container Linux /OEM customization 8503 Container Linux root on RAID
8e00 Linux LVM a000 Android bootloader
a001 Android bootloader 2 a002 Android boot 1
Press the <Enter> key to see more codes, q to quit:
a003 Android recovery 1 a004 Android misc
a005 Android metadata a006 Android system 1
a007 Android cache a008 Android data
a009 Android persistent a00a Android factory
a00b Android fastboot/tertiary a00c Android OEM
a00d Android vendor a00e Android config
a00f Android factory (alt) a010 Android meta
a011 Android EXT a012 Android SBL1
a013 Android SBL2 a014 Android SBL3
a015 Android APPSBL a016 Android QSEE/tz
a017 Android QHEE/hyp a018 Android RPM
a019 Android WDOG debug/sdi a01a Android DDR
a01b Android CDT a01c Android RAM dump
a01d Android SEC a01e Android PMIC
a01f Android misc 1 a020 Android misc 2
a021 Android device info a022 Android APDP
a023 Android MSADP a024 Android DPO
a025 Android recovery 2 a026 Android persist
a027 Android modem ST1 a028 Android modem ST2
a029 Android FSC a02a Android FSG 1
a02b Android FSG 2 a02c Android SSD
Press the <Enter> key to see more codes, q to quit:
a02d Android keystore a02e Android encrypt
a02f Android EKSST a030 Android RCT
a031 Android spare1 a032 Android spare2
a033 Android spare3 a034 Android spare4
a035 Android raw resources a036 Android boot 2
a037 Android FOTA a038 Android system 2
a039 Android cache a03a Android user data
a03b LG (Android) advanced flasher a03c Android PG1FS
a03d Android PG2FS a03e Android board info
a03f Android MFG a040 Android limits
a200 Atari TOS basic data a500 FreeBSD disklabel
a501 FreeBSD boot a502 FreeBSD swap
a503 FreeBSD UFS a504 FreeBSD ZFS
a505 FreeBSD Vinum/RAID a580 Midnight BSD data
a581 Midnight BSD boot a582 Midnight BSD swap
a583 Midnight BSD UFS a584 Midnight BSD ZFS
a585 Midnight BSD Vinum a600 OpenBSD disklabel
a800 Apple UFS a901 NetBSD swap
a902 NetBSD FFS a903 NetBSD LFS
a904 NetBSD concatenated a905 NetBSD encrypted
a906 NetBSD RAID ab00 Recovery HD
Press the <Enter> key to see more codes, q to quit:
af00 Apple HFS/HFS+ af01 Apple RAID
af02 Apple RAID offline af03 Apple label
af04 AppleTV recovery af05 Apple Core Storage
af06 Apple SoftRAID Status af07 Apple SoftRAID Scratch
af08 Apple SoftRAID Volume af09 Apple SoftRAID Cache
af0a Apple APFS b300 QNX6 Power-Safe
bc00 Acronis Secure Zone be00 Solaris boot
bf00 Solaris root bf01 Solaris /usr & Mac ZFS
bf02 Solaris swap bf03 Solaris backup
bf04 Solaris /var bf05 Solaris /home
bf06 Solaris alternate sector bf07 Solaris Reserved 1
bf08 Solaris Reserved 2 bf09 Solaris Reserved 3
bf0a Solaris Reserved 4 bf0b Solaris Reserved 5
c001 HP-UX data c002 HP-UX service
e100 ONIE boot e101 ONIE config
e900 Veracrypt data ea00 Freedesktop $BOOT
eb00 Haiku BFS ed00 Sony system partition
ed01 Lenovo system partition ef00 EFI system partition
ef01 MBR partition scheme ef02 BIOS boot partition
f800 Ceph OSD f801 Ceph dm-crypt OSD
f802 Ceph journal f803 Ceph dm-crypt journal
Press the <Enter> key to see more codes, q to quit:q
Hex code or GUID (L to show codes, Enter = 8300): ef02
Changed type of partition to 'BIOS boot partition'
Command (? for help):p
Changed type of partition to 'BIOS boot partition'
Command (? for help):p
Number Start (sector) End (sector) Size Code Name
1 2048 616447 300.0 MiB 2700 Basic data partition
2 616448 819199 99.0 MiB EF00 EFI system partition
3 819200 1081343 128.0 MiB 0C01 Microsoft reserved ...
4 1081344 1828886320 871.6 GiB 0700 Basic data partition
5 1828886528 1830641663 857.0 MiB 2700
6 1830643712 1920210943 42.7 GiB 8300
7 1920210944 1953523711 15.9 GiB 8200
8 34 2047 1007.0 KiB EF02 BIOS boot partition
1 2048 616447 300.0 MiB 2700 Basic data partition
2 616448 819199 99.0 MiB EF00 EFI system partition
3 819200 1081343 128.0 MiB 0C01 Microsoft reserved ...
4 1081344 1828886320 871.6 GiB 0700 Basic data partition
5 1828886528 1830641663 857.0 MiB 2700
6 1830643712 1920210943 42.7 GiB 8300
7 1920210944 1953523711 15.9 GiB 8200
8 34 2047 1007.0 KiB EF02 BIOS boot partition
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sda.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sda.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
root@ubuntu:/# grub-install /dev/sda
Installing for i386-pc platform.
Installation finished. No error reported.
Installing for i386-pc platform.
Installation finished. No error reported.
root@ubuntu:/# update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Linux イメージを見つけました: /boot/vmlinuz-5.4.0-167-generic
Found initrd image: /boot/initrd.img-5.4.0-167-generic
Linux イメージを見つけました: /boot/vmlinuz-5.4.0-165-generic
Found initrd image: /boot/initrd.img-5.4.0-165-generic
grub-probe: エラー: cannot find a GRUB drive for /dev/sdb1. Check your device.map.
Adding boot menu entry for UEFI Firmware Settings
完了
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Linux イメージを見つけました: /boot/vmlinuz-5.4.0-167-generic
Found initrd image: /boot/initrd.img-5.4.0-167-generic
Linux イメージを見つけました: /boot/vmlinuz-5.4.0-165-generic
Found initrd image: /boot/initrd.img-5.4.0-165-generic
grub-probe: エラー: cannot find a GRUB drive for /dev/sdb1. Check your device.map.
Adding boot menu entry for UEFI Firmware Settings
完了
sdbでエラーというのは、別にGRUB driveじゃないので問題なし。
さーて、これで再起動…ありゃ、やっぱりWin10が起動しちゃってgrub来ないじゃないのどうなってるの? ふたたび、Live USBで起動して/dev/sda2をマウントして見てみると…相変わらず/Ubuntuディレクトリがない。それだけでなく、/EFIディレクトリ自体が、nautilusで表示しようとするとIOエラー! そこでアンマウントしてfsckしてみると…またファイルエラーかいな。うーん、元のHDDがくたびれていたから、不整合なファイル管理情報もぜんぶまるっとコピーされちゃったんだろう、と想像はつくけれども、じゃあパーティションの切り直しから再インストールまでぜんぶやらないとダメか???
悪あがきしてみよう。Ubuntuでfat32フォーマットをする方法を確認。
かえでのWebログ
LinuxにおけるFAT32フォーマットの方法
2008/09/12
実際にmkfsコマンドを利用してフォーマットする。$ sudo mkfs.vfat -v -c -F 32 /dev/sde1
-v詳細な進捗を表示-c不良ブロックの精査を行う-F 32 FAT32形式でのフォーマットの指定。-FだとFAT(16)となる。
よーし。
$ sudo mkfs.vfat -v -c -F 32 /dev/sda2
そして、再度、元のHDDの第2パーティションをまるっとコピー。
めでたくSSDからUbuntu起動。ただし、grubのメニューが出ないので、SSDから起動したUbuntuで
$ sudo update-grub
で完了。
なお、grub-install時のchrootについて説明してくれている所。
Qiita
@NewGyu
DELL XPS13 (9350 2015/11モデル) Windows10のアップデートでGRUB2を消されてUbuntuが起動しなくなる
最終更新日 2016年07月12日投稿日 2016年07月12日
そしてchroot /mnt を使って /mnt を / として扱います。なぜにchrootを使うのかというと、参考資料にもあるとおり$ sudo grub-install /dev/nvme0n1 Installing for i386-pc platform. grub-install: error: failed to get canonical path of `/cow'.
これが出てしまうためです。
親切な方々に感謝。