0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[Linux][system][command] ブートローダ_GRUB Legacy, GRUB 2, grub-install, grub>, grub-mkconfig

Last updated at Posted at 2025-01-29

起動プロセス

grub-installコマンド

# grub-install /dev/sda

grub>コマンド, ブートアプション

ブートローダの設定ファイルに記載されていないオプションを、起動オプションとして起動プロンプトで指定する

# grub> linux カーネルイメージ [ブートオプション]
オプション 説明
root=デバイス名 ルートファイルシステムを特定のデバイス(例: root=/dev/sda1)に設定する
init=パス 指定したシェル(例: init=/bin/sh)をinitの代わりに起動する
quiet 起動時の詳細なメッセージ(ログ出力)を非表示にする
s
single
シングルユーザーモード(メンテナンスモード)で起動する
数字(0-6) 指定したランレベルで起動(GRUB 2の場合)

GRUB Legacy

概要

  • ストレージ(HDDなど)から、OSのカーネルイメージをメモリにロードし、カーネルを実行する
  • バージョン0.9x

設定ファイル

  • 設定ファイルは/boot/grub/menu.lst
  • 変更内容を反映させるコマンドはな
/boot/grub/menu.lst
パラメータ
説明
timeout メニューを表示している時間(秒)
default
title メニューに表示するエントリ名を指定する
root ルートパーティションを指定する
kernel
makeactive
chainloader
hiddenmenu 起動時に選択メニューを表示しない

GRUB 2

概要

  • ストレージ(HDDなど)から、OSのカーネルイメージをメモリにロードし、カーネルを実行する
  • バージョン1.9x

設定ファイル

  • 設定ファイルは/boot/grub/grub.cfg←直接編集できない
  • /etc/default/grubまたは/etc/grub.dで設定、grub-mkconfigコマンドで実行

/etc/default/grub

  • メニューの表示時間やデフォルトで起動するOSなどの指定
/etc/default/grub
パラメータ
説明
GRUB_TIMEOUT メニューを表示している時間(秒)
GRUB_DEFAULT
GRUB_CMDLINE_LINUX

/etc/grub.d

  • カーネルイメージ、ルートパーティション、モジュールの指定
/etc/grub.d
パラメータ
説明
menuentry メニューに表示するエントリ名を指定する
insmod ロードするモジュールを指定する
set 設定項目を指定する

Ping-t

ブートアプション

GRUB Legacy, GRUB 2

GRUB Legacy

GRUB 2

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?