#sudo dd if=/dev/zero of=/swapspacefile bs=1M count=2048k
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000417928 s, 0.0 kB/s
#chmod 600 /swapspacefile
mkswap: error: swap area needs to be at least 40 KiB
Usage:
mkswap [options] device [size]
Options:
-c, --check check bad blocks before creating the swap area
-f, --force allow swap size area be larger than device
-p, --pagesize SIZE specify page size in bytes
-L, --label LABEL specify label
-v, --swapversion NUM specify swap-space version …Run Code Online (Sandbox Code Playgroud) linux ×1