Difference between revisions of "Mkswap"

From wikieduonline
Jump to navigation Jump to search
Line 19: Line 19:
 
  Setting up swapspace version 1, size = 1024 MiB (1073737728 bytes)
 
  Setting up swapspace version 1, size = 1024 MiB (1073737728 bytes)
 
  no label, UUID=8afa8a12-bcea-4ce1-8848-dc19086d49a3
 
  no label, UUID=8afa8a12-bcea-4ce1-8848-dc19086d49a3
 +
 +
mkswap /[[swap.img]]
 +
Setting up swapspace version 1, size = 512 MiB (536866816 bytes)
 +
no label, UUID=a887d313-71b9-473e-8d89-591127ee5999
  
 
== Errors ==
 
== Errors ==
Line 32: Line 36:
  
 
== See also ==
 
== See also ==
 +
* {{swapon}}
 
* {{swap}}
 
* {{swap}}
  
 
[[Category:Linux commands]]
 
[[Category:Linux commands]]

Revision as of 10:45, 6 January 2025

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
mkswap /swap.img
Setting up swapspace version 1, size = 512 MiB (536866816 bytes)
no label, UUID=a887d313-71b9-473e-8d89-591127ee5999

Errors

mkswap: error: swap area needs to be at least 40 KiB
Solution: fallocate -l


Related

See also

Advertising: