Debian, Swap: Difference between revisions
mNo edit summary |
m (Andreas moved page Swap to Debian, Swap) |
Revision as of 06:47, 5 January 2025
In your /etc/fstab should be an entry like
/dev/vda2 none swap sw 0 0
it might not point to a partition (/dev/vda2) but instead to a file and the "none" might be something different because it is (I think) not relevant for a swap partition.
It will NOT be mounted, so don't try to use
mount
to see if it is working.
With
df -hT
you see which partitions are known to your system and you get some information about them. BUT you normally will not see your swap partition, so that is NOT an error.
There are multiple tools you can use to check on devices. One of them - not better or worse than the others - is fdisk.
apt-get install fdisk fdisk -l
It WILL show you swap partitions in a recognizeable way too. Something like
Device Boot Start End Sectors Size Id Type /dev/vda1 * 2048 50329215 50327168 24G 83 Linux /dev/vda2 50329216 52426367 2097152 1G 82 Linux swap / Solaris
Or you could use
apt-get install util-linux lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8:0 0 20G 0 disk ├─sda1 8:1 0 19G 0 part / ├─sda2 8:2 0 1K 0 part └─sda5 8:5 0 975M 0 part [SWAP] sr0 11:0 1 51M 0 rom
If you want to see if your swap is currently used:
swapon -s
If something is wrong, you can create and activate a swap partition/file:
mkswap /dev/hda2 swapon /dev/hda2