PDA

View Full Version : [xubuntu] Problems with Swap Partition



jworks
April 20th, 2013, 01:01 PM
Hi. Yesterday I did a fresh install of xubuntu on my notebook. I created a new partition table, and 4 primary partitions (boot, swap, root, home).

After restarting the swap partition was showing as Unkown in gparted, so I booted again from USB, formatted the partition to linux swap, and selected swapon. Now the partition was showing as linux-swap in gparted, but it's not being used. The command free -m shows available swap, but 0 used, and the hibernation option is greyed out. After another reboot it shows 0 available swap, hibernation option is gone, but I can still find the partition in gparted as linux-swap.

Then I followed instructions for fixing broken swap partition I found:


sudo swapoff -a
sudo cryptsetup remove /dev/mapper/cryptswap1
sudo gedit /etc/crypttab

Remove the SWAP line (e.g. /dev/sda2)
sudo /sbin/mkswap /dev/sda2
sudo swapon /dev/sda2
sudo gedit /etc/fstab

Replace /dev/mapper/cryptswap1 with /dev/sda2.
sudo ecryptfs-setup-swap


After this free -m shows available swap again, but 0 used. hibernation option is back but greyed out again.

cat /proc/swaps returns this

Filename Type Size Used Priority
/dev/dm-0 partition 4001788 0 -1

Im not sure why it shows /dev/dm-0 instead of /dev/sda2.

Im still a beginner but I really want to get this right.
Any help or tips are much appriciated.

oldfred
April 20th, 2013, 08:05 PM
Did you encrypt /home?

If so then swap is also encrypted and gparted then cannot see it. So it was correct.

When you recreated it, it had a new UUID, so you have to update fstab with the new UUID.
But then I do not know if with encryption it goes back and encrypts or not?