Top/System/grub

目次

grub プロンプトから起動する

  1. どういう名前のディスクがあるかを確認する
    grub> ls
    (hd0), (hd0,gtp1), (hd0,gtp2), (hd0,gtp3), ...
    • どれが root ファイルシステムかわからない場合は、リストに出てきたものに / を付けて ls すると、中身が見えるので判断できる。
      grub> ls (hd0,gtp2)/
      boot home usr var    <- / にあるはずのものが見えているので、どうやらこれが root ファイルシステムらしい、と判断できる
  2. root ファイルシステムを指定する
    grub> set root=(hd0,gtp2)
  3. カーネルイメージと root ファイルシステムを指定する
    grub> linux /boot/vmlinuz-4.19.0-10-amd64 root=/dev/sda2
    • ファイル名は bash 同様、Tab で補完できる。
  4. initrd を指定する
    grub> initrd /boot/initrd.img-4.19.0-10-amd64
  5. boot する
    grub> boot <run-level>
    • <run-level> は、必要なときだけ指定すれば良い

起動時に runlevel を変更する

  1. grub の画面で "e" をタイプする
  2. コマンドラインの編集画面が表示されると、以下のような行があるので、その後ろに runlevel を数字で指定する。
    linux /boot/vmlinuz-** root=** ro quiet
  3. Ctrl-x または F12 キーで編集画面を終了し、起動処理が開始する。

grub2 の install に失敗する

root@benda:/home/kazu# /usr/sbin/grub-install /dev/sda
Installing for i386-pc platform.
/usr/sbin/grub-install: 警告: this GPT partition label contains no BIOS Boot Partition; embedding won't be possible.
/usr/sbin/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..
/usr/sbin/grub-install: エラー: will not proceed with blocklists.
root@benda:/home/kazu# /sbin/fdisk -l /dev/sda
Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000LM048-2E71
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: A7E01EA8-10EF-42FF-B030-18FD76481CDB

Device          Start        End    Sectors   Size Type
/dev/sda1        2048     585727     583680   285M EFI System
/dev/sda2      585728  390819839  390234112 186.1G Linux filesystem
/dev/sda3   390819840 1758007295 1367187456 651.9G Linux filesystem
/dev/sda4  1758007296 1953523711  195516416  93.2G Linux swap
root@benda:/home/kazu# /sbin/fdisk -l /dev/sda
Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000LM048-2E71
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: A7E01EA8-10EF-42FF-B030-18FD76481CDB

Device          Start        End    Sectors   Size Type
/dev/sda1        2048     585727     583680   285M EFI System
/dev/sda2      585728  390819839  390234112 186.1G Linux filesystem
/dev/sda3   390819840 1758007295 1367187456 651.9G Linux filesystem
/dev/sda4  1758007296 1953523711  195516416  93.2G Linux swap

grub に他の OS の起動エントリを認識させる


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2023-10-15 (日) 22:48:02