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を基本からまとめてみた【ブートプロセス・systemd】

Last updated at Posted at 2025-10-06

Linuxが起動するまでの流れ(ブートプロセス)

A[電源が入る]

⬇︎

B[BIOS(UEFI)が起動]
・ハードウェアのチェックの初期化
・起動デバイスに書き込まれたブートローダを読み出す
・ブートローダが起動デバイスからカーネルをメモリに読み込む

⬇︎

C[Linuxが起動]
・メモリの初期化やシステムクロックの設定
・仮のルートファイルシステムをマウント
・初期RAMディスクに組み込まれたデバイスドライバを使ってデバイスにアクセス
・init(あるいはsystemd)プロセスを実行

⬇︎

D[様々な操作が可能になる]
・起動に必要なものを順次起動していく
・ログインプロンプトを表示して起動処理を完了させる

systemdとは?

  • Linuxの起動処理やシステム管理を行う仕組み

※ ユニット(Unit): systemdの処理単位(設定ファイル)

ターゲット

  • systemdの処理単位であるUnitをまとめたもの
ターゲット名 説明
multi-user.target CUIログインを行う
graphical.target グラフィカルなログインを行う
poweroff.target システムを終了する
rescue.target レスキュー(シングルユーザー)モード
reboot.target システムの再起動を行う

ターゲットを管理する

  • 現在のデフォルトの設定を調べる
$ systemctl get-default
  • システム起動時のデフォルトターゲットを変更する
$ systemctl get-default ターゲット名
  • ターゲットを実行する
$ systemctl isolate ターゲット名

systemctlの使い方

コマンド サブコマンド 引数
systemctl isolate 他のUnitを停止して
指定したUnitを起動する
Unit名
systemctl status サービスの状態を表示する Unit名
systemctl is-active サービスが稼働しているかを
表示する
Unit名
systemctl disable サービスの自動起動を無効する Unit名
systemctl enable サービスの自動起動を有効する Unit名
systemctl start サービスが起動する Unit名
systemctl stop サービスが停止する Unit名
systemctl set-default 次に起動した時の
ターゲットを設定する
systemctl get-default 次に起動した時の
ターゲットを表示する
systemctl reboot システムを再起動する
systemctl poweroff システムを終了して
電源を切る

参考サイト

【LinuC/LPIC合格講座】「ブートプロセス」を徹底理解!クーポンは概要欄から【ITエンジニア基礎入門】#11

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?