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/GRUB2, Sysvinitt, systemd, init, telinit, systemctl, ln

Last updated at Posted at 2025-01-20

起動プロセス

ブートローダ(GRUB/GRUB2)

  • ブート時に適用
  • OS起動後のランレベルを変更不可

変更方法

  1. システムの起動初期段階でGRUBのメニューが表示された際に、Eキーを押す
  2. 編集モードが表示される(キーボードでオプションを入力できる)
  3. ブートオプションを入力する
オプション
root=デバイス
nousb USBデバイスを使用しない
single シングルユーザーモードで起動する
1~5 指定したランレベルで起動する

初期化システム(SysVinit/systemd)

  • OS起動後のランレベルを変更可能

変更方法

SysVinit

bash
$ init 1|s|S

/// または

$ telinit 1|s|S

systemd

bash
$ systemctl rescue.target

systemd(デフォルト)

bash
$ rm -f /etc/systemd/system/default.target
$ ln -s /lib/systemd/system/graphical.target /etc/systemd/system/default.target

反映方法

SysVinit

bash
$ init q 
$ init Q

/// または

$ telinit q
$ telinit Q

systemd

bash
$ systemctl daemon-reload

ランレベルとターゲット

ランレベル ターゲット
/etc/systemd/system
ターゲット
/lib/systemd/system
対象初期化システム init(SysVinit) systemd runlevel0.target
停止 0 poweroff.target runlevel0.target
シングルユーザーモード 1/s/S rescue.target runlevel1.target
マルチユーザーモード
(テキストログイン)
2, 3, 4 multiuser.target runlevel[234].target
マルチユーザーモード
(グラフィカルログイン)
5 grafical.target runlevel5.target
再起動 6 reboot.target runlevel6.target

Ping-t

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?