#author("2020-03-22T10:34:00+09:00","","")
#contents()
*** 課題 [#a08e81b0]
Ubuntu 18.04 のアップデート処理実行の最後で gurb の書き込みに失敗する
*** 現在のディスクレイアウト[#yb44521d]
munakata@mvc:~$ lsblk -e 7
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 7.3T 0 disk
└─sda1 8:1 0 7.3T 0 part
└─md0 9:0 0 7.3T 0 raid1 /mnt/raid_vol
sdb 8:16 0 7.3T 0 disk
└─sdb1 8:17 0 7.3T 0 part
└─md0 9:0 0 7.3T 0 raid1 /mnt/raid_vol
sdc 8:32 0 7.3T 0 disk
└─sdc1 8:33 0 7.3T 0 part /mnt/dtv_h264
sdd 8:48 0 2.7T 0 disk
└─sdd1 8:49 0 2.7T 0 part /mnt/dtv_recipe
sde 8:64 1 3.7T 0 disk
└─sde1 8:65 1 3.7T 0 part /mnt/dtv_slave
sdf 8:80 1 7.3T 0 disk
└─sdf1 8:81 1 7.3T 0 part /mnt/dtv_h264B
sdg 8:96 1 3.7T 0 disk
└─sdg1 8:97 1 3.7T 0 part /mnt/dtv_recover
nvme0n1 259:0 0 232.9G 0 disk
├─nvme0n1p1 259:1 0 218G 0 part /
├─nvme0n1p2 259:2 0 1K 0 part
└─nvme0n1p5 259:3 0 15G 0 part
- -e(--exclude) 7 は loop デバイスを表示しないオプション
*** 現在のパーティションの構成(全ディスク共通) [#wf391b7c]
munakata@mvc:~$ sudo gdisk /dev/sdd
GPT fdisk (gdisk) version 1.0.3
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/sdd: 5860533168 sectors, 2.7 TiB
Model: WDC WD30EFRX-68E
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): D8D7C399-0DC3-4619-8D01-855D2E93A2ED
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 5860533134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2925 sectors (1.4 MiB)
Number Start (sector) End (sector) Size Code Name
1 2048 5860532223 2.7 TiB 8300
Command (? for help):
- パーティションはセクター2048からスタートする1つしかない。
- BIOS boot partition が無いので grub の書き込みに失敗する
*** BIOS boot partition をディスクの先頭に追加する [#kd8b152a]
Command (? for help): n
Partition number (2-128, default 2):
First sector (34-5860533134, default = 34) or {+-}size{KMGTP}: 34
Last sector (34-2047, default = 2047) or {+-}size{KMGTP}: 2047
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): ef02
Changed type of partition to 'BIOS boot partition'
Command (? for help): p
Disk /dev/sdd: 5860533168 sectors, 2.7 TiB
Model: WDC WD30EFRX-68E
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): D8D7C399-0DC3-4619-8D01-855D2E93A2ED
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 5860533134
Partitions will be aligned on 2048-sector boundaries
Total free space is 911 sectors (455.5 KiB)
Number Start (sector) End (sector) Size Code Name
1 2048 5860532223 2.7 TiB 8300
2 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/sdd.
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.
- BIOS boot partition のタイプは &color(red){ef02};
- 既存のパーティションの前方の空き領域に新規に &color(red){BIOS boot partition}; を作成する
*** grub インストールに成功 [#m1474d57]
munakata@mvc:~$ sudo grub-install /dev/sdd
Installing for i386-pc platform.
Installation finished. No error reported.
munakata@mvc:~$
- 全ディスク (md0 を構成する /dev/sda, /dev/sdb を含む)に grub を書き込んだ
*** 参考 URL[#ubee10a3]
- [[GPT HDD に grub2 をインストールする際の tips:https://www.miraclelinux.com/tech-blog/qwi8ni]]