Help us understand the problem. What is going on with this article?

Ubuntu USBにswap領域を確保する

More than 3 years have passed since last update.

Ubuntuでメモリが少ない場合に、USBにswap領域を確保する

1.swap状態の確認

sudo cat /proc/swaps

すでに設定されているようでしたら
sudo swapoff -a
で解除します。

2.USBのパスを確認

sudo fdisk -l

USBが
/dev/sda1 8192 30162943 15077376 c W95 FAT32 (LBA)
であると仮定

2.USBのアンマウント

sudo umount /dev/sda1

3.USBという名前で、FAT32でフォーマット

sudo mkdosfs -F32 -nUSB /dev/sda1

4.USBにswap領域を作成

sudo mkswap -c /dev/sda1

5.USBのswap領域を有効化

sudo swapon /dev/sda1

起動時にスワップファイルとして設定されるようにする

sudo vi /etc/fstab

以下を追加
/dev/sda1 swap swap defaults 0 0

補足

スワップ解除

sudo swapoff -a

以上

suisuina
Technical director,engineer
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした