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?

/etc/fstab を書き換えたあとはreboot前に必ずfindmntコマンドで検証しよう

Posted at

サーバに対して、swap領域を追加したり、拡張ディスクを追加したりするシーンはよくありますよね。

そんなとき、/etc/fstab の書き換えをして、気軽にサーバ再起動をすると、、、、

サーバが起動しなくなった!!

ってなっちゃいますよね。

なので、再起動前に以下のコマンドの実行で、/etc/fstab を検証し、エラーがないことを確認しましょう。

findmnt --verify --verbose

コマンドを実行するとこのような出力(環境によって異なる)があります。

/
   [ ] target exists
   [ ] FS options: discard,commit=30,errors=remount-ro
   [ ] LABEL=cloudimg-rootfs translated to /dev/nvme1n1p1
   [ ] source /dev/nvme1n1p1 exists
   [ ] FS type is ext4
/boot
   [ ] target exists
   [ ] LABEL=BOOT translated to /dev/nvme1n1p16
   [ ] source /dev/nvme1n1p16 exists
   [ ] FS type is ext4
/boot/efi
   [ ] target exists
   [ ] FS options: umask=0077
   [ ] LABEL=UEFI translated to /dev/nvme1n1p15
   [ ] source /dev/nvme1n1p15 exists
   [ ] FS type is vfat
none
   [W] non-bind mount source /swap is a directory or regular file
   [ ] FS type is swap
/data
   [ ] target exists
   [ ] userspace options: nofail
   [ ] UUID=xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx translated to /dev/nvme0n1
   [ ] source /dev/nvme0n1 exists
   [ ] FS type is xfs

0 parse errors, 0 errors, 1 warning
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?