Contents
What does mkswap do in Linux?
mkswap sets up a Linux swap area on a device or in a file. The device argument will usually be a disk partition (something like /dev/sdb7) but can also be a file.
Can I add swap partition after install?
Swap is generally associated with a swap partition, perhaps because the user is prompted to create a swap partition at the time of installation. In fact, any file can be used as a swapping device, be it a partition or a conventional file.
Where does mkswap set up a swap area?
mkswap sets up a Linux swap area on a device or in a file. The device argument will usually be a disk partition (something like /dev/sdb7) but can also be a file. The Linux kernel does not look at partition IDs, but many installation scripts will assume that partitions of hex type 82 ( LINUX_SWAP) are meant to be swap partitions.
How does mkswap erase the first partition block?
mkswap, like many others mkfs -like utilities, erases the first partition block to make any previous filesystem invisible. However, mkswap refuses to erase the first block on a device with a disk label (SUN, BSD, etc.) and on a whole disk (e.g., /dev/sda).
Which is the best way to use mkswap in Linux?
The recommended setup is to use a separate partition for a Linux swap area. mkswap, like many others mkfs -like utilities, erases the first partition block to make any previous filesystem invisible. However, mkswap refuses to erase the first block on a device with a disk label ( SUN, BSD, etc.) and on a whole disk (e.g., /dev/sda ).
What’s the difference between swap partition and normal partition?
There is no difference to create a swap partition and a normal partition. You can convert a normal partition to swap space. Create a primary partition as per requirement like 2GB, 4GB or 8 GB. Don’t format it. Next task make swap it using mkswap command syntax as below. Now partition has been formated by this command.