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?

More than 5 years have passed since last update.

Ubuntu 18.04 壊れてしまったswapfileの復元

Last updated at Posted at 2019-01-06

システムモニタなどで、スワップが「利用できません」と表示されたり、swapfileシステムが壊れてしまった時の復元方法

・以下のコマンドを実行する。(スーパーユーザーで作業します)

rm -f /swapfile
dd if=/dev/zero of=/swapfile bs=2M count=2048
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
vi /etc/fstab

fstabはスワップファイルが壊れてしまって再起動したら、スワップの行が消されてしまっているので、以下のように追加する。

/swapfile swap swap defaults 0 0
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?