Swap space

From Edgar BV Wiki
Revision as of 20:13, 18 January 2017 by Red (talk | contribs)
Jump to navigation Jump to search

Working with swap space:

Creating swap space


In order to get a partition to be swapspace you have to fdisk it as swapspace (type 82), then make it into swap space using

mkswap -L label /dev/sdc1

Once you have done this you enter it into /etc/fstab as

/dev/sdc1 none swap sw 0 0

and then activate it by

swapon -L label

or

swapon -a


Removing swapspace


If it's on a logical volume, first

swapoff -a

or swapoff -L label

then with

swapon -s

you can check which devices are being used for swap.

uncomment it from the /etc/fstab. Should lvm / LVM lvremove give you shit about it being busy you can try dmtools. Unmount the device first, check lsof and fuser as well.

dmsetup uses the /dev/mapper names, not /dev/pvname/lvname.

dmsetup info -c

shows all the devices and if there are files open on it.

dmsetup info -c edgarghost-swap_1

shows the specific device (-c optional)

dmsetup remove --force edgarghost-swap_1

should reset the open file count to 0 (even if it gives a failure) then you can

dmsetup remove edgarghost-swap_1

again.

If none of this works, you can see what's in

/etc/initramfs-tools/conf.d/resume

change the device and then do

update-initramfs -u

and then reboot.