Swap Space Not Activated On Boot

sktsee sktseer at gmail.com
Thu Sep 4 00:39:03 UTC 2014


On Wed, 03 Sep 2014 12:43:26 -0700, NoOp wrote:

> On 09/03/2014 09:04 AM, sktsee wrote:
>> On Wed, 03 Sep 2014 08:38:05 -0700, NoOp wrote:
> ..
>>> 
>>> Just having bootable usb drives connected can/will change the /dev/sdX
>>> and so I've not been able to find a method to reliably mount encrypted
>>> swap in this situation.
>> 
>> 
>> Yes, as I've mentioned twice now, you should use specify disk by-id as
>> the source device in /etc/crypttab if you have multiple hard drives
>> attached to your system to avoid the issue with device path changes on
>> boot. AFAICT, no one in the bug reports used disk by-id, they just used
>> a UUID or the device path (/dev/sdx).
>> 
>> 
> I had/have always thought that /dev/by-path was/is unreliable as well:
> <https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1193705>

I guess, I didn't recommend that though.

> <https://wiki.archlinux.org/index.php/
Talk:Persistent_block_device_naming>

The comments on this page actually challenge the assertion about the
unsuitability of using disk by-id and disk by-path as persistent block
device naming schemes. The parent wiki page notes this.

> <https://bugs.launchpad.net/ubuntu/+source/cryptsetup/+bug/522341>
> (crypttab by-id entries not processed automatically at startup despite
> upstart files)

That bug report was filed against the cryptsetup package in Lucid so I'm
not sure if what was wrong is still applicable to later versions. However,
what the developer says about cryptsetup functions not explicitly
supporting disk by-id, or (or disk by-path) is still correct,
though.

> <https://bugs.launchpad.net/ubuntu/+source/fai/+bug/1040254>

This bug report is filed against the "fai" package, which AFAICT after
examining the two links in the submitter's report, doesn't relate to
cryptsetup.


> I also cannot find the reference to 'by-id' in the crypsetup FAQ
> <http://code.google.com/p/cryptsetup/wiki/FrequentlyAskedQuestions>
>  - only this:
> "    2.3 How do I set up encrypted swap?
> 

[snip]

> 
> Are we looking at different FAQ's?

Nope, that was my bad. I got the info from some other article I was
reading on the subject awhile back and mis-attributed it to the FAQ.


> However... you've never steered me wrong in the past, so I'll give
> 'by-id' a try :-)

In a way, using disk by-id is using the /dev/sdx form in crypttab since
the disk by-id is nothing more than a symlink created by udev to the
actual block device. What makes it useful here is that the symlink name is
unique because it's usually formed by the manufacture name and serial
number of the drive. So its a way of uniquely specifying the swap device
in /etc/crypttab and so far it has persisted across multiple boots. Course
I could be just lucky, I guess :).

-- 
sktsee






More information about the ubuntu-users mailing list