From the mkswap manpage ("WARNING"): mkswap refuses to erase the first block on a device with a disk label (SUN, BSD, ...) or on whole disk (e.g. /dev/sda). This leads to a warning during boot with encrypted swap partitions using dmcrypt, since the encrypted partition looks like a whole disk (e.g. /dev/mapper/swap). I was a bit unsure about the Severity, since the swapspace actually works and this bug might as well be interpreted as "cosmetic". Maybe it is even enough to notify upstream about this. Reproducible: Always
Thanks for the report. Even if no-one gets around to fixing it for a while, it is still useful to have it documented in the bug database so future users noticing the warning can know not to be concerned.
I get the same thing, however the swap space is no longer mounted after the warning. $ sudo /etc/init.d/dmcrypt restart * WARNING: you are stopping a boot service * Caching service dependencies... [ ok ] * Removing dm-crypt mappings * Removing dm-crypt mapping for: crypt-swap... [ ok ] * Setting up dm-crypt mappings... * Checking swap is not LUKS * dm-crypt map crypt-swap... * cryptsetup will be called with : -c aes -h sha256 -d /dev/urandom create crypt-swap /dev/system/swap [ ok ] * Running pre_mount commands for crypt-swap... mkswap: /dev/mapper/crypt-swap: warning: don't erase bootbits sectors on whole disk. Use -f to force. $ free total used free shared buffers cached Mem: 4059344 2682836 1376508 0 150480 989128 -/+ buffers/cache: 1543228 2516116 Swap: 0 0 0
I doubt this is a problem with device-mapper from current lvm2 package anymore. If you still see this, please reopen this bug.