Difference between revisions of "Mkswap"
Jump to navigation
Jump to search
(11 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | <code>mkswap</code> set up a Linux [[swap]] area and it is included on <code>[[util-linux]]</code> package. https://linux | + | {{lc}} |
+ | <code>mkswap</code> set up a Linux [[swap]] area and it is included on <code>[[util-linux]]</code> package. | ||
+ | * https://man7.org/linux/man-pages/man8/mkswap.8.html | ||
+ | mkswap [[/dev/nvme]]5n1 | ||
+ | [[mkswap -f]] [[/dev/nvme]]5n1 | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | Setting up swapspace version 1, size = 30 GiB (32212250624 bytes) | ||
+ | no label, [[UUID]]=2c828d0e-4820-49a6-a9a9-af0facc12345 | ||
+ | |||
+ | |||
+ | mkswap /path/to/yourfile | ||
+ | mkswap: /path/to/yourfile: insecure permissions [[0644]], fix with: [[chmod]] [[0600]] path/to/yourfile | ||
+ | Setting up swapspace version 1, size = 1024 MiB (1073737728 bytes) | ||
+ | no label, UUID=8afa8a12-bcea-4ce1-8848-dc19086d49a3 | ||
+ | |||
+ | == Errors == | ||
+ | mkswap: error: swap area needs to be at least 40 KiB | ||
+ | Solution: [[fallocate -l]] | ||
+ | |||
+ | |||
+ | == Related == | ||
* <code>[[/etc/fstab]]</code> | * <code>[[/etc/fstab]]</code> | ||
− | + | * <code>[[swapon]]</code> | |
+ | * <code>[[mkfs]]</code> | ||
+ | * [[Add a swap disk]] | ||
== See also == | == See also == |
Latest revision as of 16:25, 24 August 2023
mkswap
set up a Linux swap area and it is included on util-linux
package.
mkswap /dev/nvme5n1 mkswap -f /dev/nvme5n1
Setting up swapspace version 1, size = 30 GiB (32212250624 bytes) no label, UUID=2c828d0e-4820-49a6-a9a9-af0facc12345
mkswap /path/to/yourfile mkswap: /path/to/yourfile: insecure permissions 0644, fix with: chmod 0600 path/to/yourfile Setting up swapspace version 1, size = 1024 MiB (1073737728 bytes) no label, UUID=8afa8a12-bcea-4ce1-8848-dc19086d49a3
Errors[edit]
mkswap: error: swap area needs to be at least 40 KiB Solution: fallocate -l
Related[edit]
See also[edit]
- Swap,
swapon
,swapoff
,mkswap
,swaplabel
,free
,sar -r
,sar -S
,sar -W
,vmstat
,vm.swappiness
,/proc/swaps
,/etc/fstab
, Add a swap disk,systemd.swap
Advertising: