— Raspberry Pi — 1 min read
Raspberry Piのswapを無効にする方法。
Raspberry Piの型とOSのバージョンを確認。
$ cat /proc/device-tree/modelRaspberry Pi 3 Model B Rev 1.2$ lsb_release -aNo LSB modules are available.Distributor ID: RaspbianDescription: Raspbian GNU/Linux 10 (buster)Release: 10Codename: buster
swap off
した後に、dphys-swapfile
のサービスを停止、無効にする。
$ sudo swapoff --all$ sudo systemctl stop dphys-swapfile$ sudo systemctl disable dphys-swapfileSynchronizing state of dphys-swapfile.service with SysV service script with /lib/systemd/systemd-sysv-install.Executing: /lib/systemd/systemd-sysv-install disable dphys-swapfileRemoved /etc/systemd/system/multi-user.target.wants/dphys-swapfile.service.
dphys-swapfile
の状態とメモリの状態をfree
コマンドで確認。
$ systemctl status dphys-swapfile● dphys-swapfile.service - dphys-swapfile - set up, mount/unmount, and delete a swap file Loaded: loaded (/lib/systemd/system/dphys-swapfile.service; disabled; vendor preset: enabled) Active: inactive (dead) Docs: man:dphys-swapfile(8)$ free total used free shared buff/cache availableMem: 999812 71784 727412 6692 200616 867108Swap: 0 0 0