20
21

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.

Swap領域が足りないときに、ささっと追加する

Last updated at Posted at 2014-08-06

swapfileを作る

dd if=/dev/zero of=/swapfile bs=1024 count=1048576

countは、bs(1024) * 欲しい容量(1024MByte)です。

swap領域に追加する

mkswap /swapfile
swapon /swapfile

とすると、swap領域が増えます。

この方法だと通常のパーティションよりは遅いでのですが、とりあえず再起動なしでささっと追加するにはよいでしょう。

@suin によって、fallocateをつかったシェルスクリプトでやる方法が書かれてましたので、こちらも参考になるとおもいます。 VagrantでUbuntuにSwapを4GBほど追加したい

20
21
1

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
20
21

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?