No I get:
Code: Select all
$ swapon -s
Filename Type Size Used Priority
/dev/sda4 partition 4006908 0 -1
/var/swap file 2097148 0 -2
Code: Select all
$ swapon -s
Filename Type Size Used Priority
/dev/sda4 partition 4006908 0 -1
/var/swap file 2097148 0 -2
Code: Select all
cat /etc/fstab | grep swap
Code: Select all
# a swapfile is not a swap partition, no line here
# use dphys-swapfile swap[on|off] for that
Code: Select all
cryptswap1 /dev/sdXN /dev/urandom swap,offset=8,cipher=aes-cbc-essiv:sha256
I see. Just remove package dphys-swapfile from your systemSo I have to dig into dphys-swapfile.
Code: Select all
sudo apt purge dphys-swapfile
This line should sufficecryptswap1 /dev/sdXN /dev/urandom swap,offset=8,cipher=aes-cbc-essiv:sha256
Code: Select all
cryptswap1 /dev/sdXN /dev/urandom swap,cipher=aes-cbc-essiv:sha256,noearly
I see, in fact the offset option is necessary when using uuid. If using /dev/sdXN device id you don't need offset option. Offset is used to avoid cryptsetup program overwriting uuid signature when setting up encrypted swap device.The reasons for that are explained in https://bugs.launchpad.net/ubuntu/+sour ... ug/1310058
Best regards from MunichAfter changing the the script
* /usr/bin/ecryptfs-setup-swap
* from old version with:
**********Code: Select all
# Add crypttab entry echo "cryptswap$i $swap /dev/urandom swap,cipher=aes-cbc-essiv:sha256" >> /etc/crypttab
* into latest version with:
**********Code: Select all
# Add crypttab entry echo "cryptswap$i UUID=$uuid /dev/urandom swap,cipher=aes-cbc-essiv:sha256" >> /etc/crypttab
the function is no more usable!
[Because without the offset below the UUID of the spap partition will be destroyed and not be found in crypttab]
See also https://bugs.launchpad.net/ubuntu/+sour ... bug/953875
https://bugs.launchpad.net/ubuntu/+sour ... ug/1310058
After some reboots [the 2nd reboot, because after the 1st one the UUID in the swap partition is gone] in a fresh installed Ubuntu as well other derivates, the command "swapon -s" shows no swap-device available either connected. Only a new, manually setup solves the problem by typing in a terminal (device may be i.e. /dev/sdb3. ):
[Don't do this:][This is better:Code: Select all
sudo -s umount /dev/sdb3 mkswap /dev/sdb3 # copy UUID shown into next cmdline echo "RESUME=UUID=66ed5336-3ae1-4166-aad7-7c69086299a1" > /etc/initramfs-tools/conf.d/resume sudo echo "cryptswap1 /dev/sdb3 /dev/urandom swap,cipher=aes-cbc-essiv:sha256" > /etc/crypttab update-initramfs -u exit
On portable disks with a Linux installation on them you want to use UUID.Code: Select all
sudo -s umount /dev/sdLX # mkswap /dev/sdLX # [UUID will be displayed. Replace UUID in next cmdline by UUID shown after mkswap.] echo "RESUME=UUID=66ed5336-3ae1-4166-aad7-7c69086299a1" > /etc/initramfs-tools/conf.d/resume sudo echo "cryptswap1 UUID=66ed5336-3ae1-4166-aad7-7c69086299a1 /dev/urandom swap,offset=8,noearly,cipher=aes-cbc-essiv:sha256" > /etc/crypttab update-initramfs -u exit
Update 2015-08-09: I added "noearly"]
[If mkswap doesn't work because sdLX still is used by some process, I format it from another Linux.]
[Initial swap installation also seems to fail if swap partition is on extended partition. Workaround: "noearly" (see above) and/or "sudo swapoff -a" and then "sudo swapon -a" can help.]
[also check /etc/fstab]
ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: ecryptfs-utils 104-0ubuntu1
ProcVersionSignature: Ubuntu 3.13.0-24.46-generic 3.13.9
Uname: Linux 3.13.0-24-generic x86_64
ApportVersion: 2.14.1-0ubuntu3
Architecture: amd64
Date: Sat Apr 19 20:37:12 2014
ProcEnviron:
LANGUAGE=de:en
TERM=xterm
PATH=(custom, no user)
LANG=de_DE.UTF-8
SHELL=/bin/bash
SourcePackage: ecryptfs-utils
UpgradeStatus: Upgraded to trusty on 2014-04-08 (11 days ago)
Hmm, did you missed the end of my post ?goetzkluge wrote:I think that the offset is needed.
The following crypttab setup works, no offset option needed since uuid is not used. Using uuid in crypttab is not mandatory, you can use /dev/sdXN device id as wellLaurent85 wrote:I see, in fact the offset option is necessary when using uuid. If using /dev/sdXN device id you don't need offset option. Offset is used to avoid cryptsetup program overwriting uuid signature when setting up encrypted swap device.
Laurent85 wrote:cryptswap1 /dev/sdXN /dev/urandom swap,cipher=aes-cbc-essiv:sha256,noearly
Not reallyLaurent85 wrote:Hmm, did you missed the end of my post ?goetzkluge wrote:I think that the offset is needed.
[...]
Code: Select all
# Add crypttab entry
echo “cryptswap$i UUID=$uuid /dev/urandom swap,cipher=aes-cbc-essiv:sha256″ >> /etc/crypttab
Code: Select all
# Add crypttab entry
echo “cryptswap$i UUID=$uuid /dev/urandom swap,offset=8,noearly,cipher=aes-cbc-essiv:sha256″ >> /etc/crypttab