Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 271839

Summary: false warning from mkswap in connection with device-mapper
Product: Gentoo Linux Reporter: niteblade
Component: [OLD] Core systemAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED OBSOLETE    
Severity: trivial CC: saintdev
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 461382    
Bug Blocks:    

Description niteblade 2009-05-30 07:35:24 UTC
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
Comment 1 Wormo (RETIRED) gentoo-dev 2009-06-01 05:17:46 UTC
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.
Comment 2 Nathan Caldwell 2009-08-10 04:12:33 UTC
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
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2013-03-11 12:09:44 UTC
I doubt this is a problem with device-mapper from current lvm2 package anymore.
If you still see this, please reopen this bug.