Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved] Encrypted swap not mount
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
glacies
n00b
n00b


Joined: 08 Jun 2018
Posts: 29
Location: Netherlands

PostPosted: Sun Jun 17, 2018 8:39 pm    Post subject: [solved] Encrypted swap not mount Reply with quote

The Encrypted swap is located on:
Code:
/dev/mapper/vg0-lvol2


Systemd : Timed out waiting for device dev-disk-by\
Dependency failed for/dev/disk/by-uuid2969..
Dependency failed for swap.

So swap does not mount.
I delete the swap partition. Then recreate the encrypted swap partition.
Sudo mkswap /dev/mapper/vg0-lvol2
Sudo swapon /dev/mapper/vg0-lvol2

Does the swap partition need certain kernel module?
The root device mount is ok. The root device is encrypted with the same kernel module as the encrypted swap device. So guess that is o.k.
The time out for swap on booting is causing 1.30sec delay.

Do I need that 2gb swap space that does not mount on booting?
Will i be alright with 16gb ram and no swap partition?

Does anyone know how to make the encrypted swap partition boot?

Edit maybe i need udev? I can't compile the initramfs with genkernel with the --udev flag on gentoo-sources -4.17.1
Code:
genkernel --install --lvm -luks --udev initramfs
Error : unknown option '--udev'!


Profile default/linux/amd64/17.1/desktop/plasma/systemd (exp)
Maybe i need /etc/conf.d/dmcrypt

Any help is welcome


Last edited by glacies on Sun Jun 24, 2018 11:37 am; edited 4 times in total
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 665

PostPosted: Sun Jun 17, 2018 9:06 pm    Post subject: Re: Encrypted swap not mount on systemd 17.1 Reply with quote

glacies wrote:
Do I need that 2gb swap space that does not mount on booting?
Will i be alright with 16gb ram and no swap partition?

It depends on what you are doing. Since you ask the question, you can probably get away without. I usually allocate some swap even though my machine with 32G rarely if ever needs it.
Once upon a time, 'emerge --empty @world' would run into something that would fail without swap.

You can see I went overboard because I have plenty of storage, but it's never been used after an uptime of 7 days, and I even ran a lengthy emerge yesterday:
Code:
$ free -t
              total        used        free      shared  buff/cache   available
Mem:       32973412     2983656    18912464      148432    11077292    29374616
Swap:     134217724           0   134217724
Total:    167191136     2983656   153130188

The archlinux wiki has a decent page about encrypted swap.

HTH
Back to top
View user's profile Send private message
glacies
n00b
n00b


Joined: 08 Jun 2018
Posts: 29
Location: Netherlands

PostPosted: Sun Jun 17, 2018 9:22 pm    Post subject: Reply with quote

on Boot up I have to wait 1.30sec at:
Code:

Ok started flush journal to persistent storage
*** A start job is running for dev-disk


Looks like "something" is failing/starting on decryption and mounting of the encrypted swap device, strange

The root partition is unlocked at boot successful, so why not the swap partition?

Journalctl shows the encrypted swap device is loaded inactive dead start /dev/disk/by-uuid/

Udev is running.
Maybe whatever the swap partition loads might be pointing to wrong source? I should check the uuid of the encrypted swap.
Back to top
View user's profile Send private message
glacies
n00b
n00b


Joined: 08 Jun 2018
Posts: 29
Location: Netherlands

PostPosted: Sun Jun 17, 2018 10:35 pm    Post subject: Reply with quote

Ok so

Start the lvm daemon:
Code:
root #systemctl enable lvm2-monitor.service

Then look at uuid of the encrypted swap partition, with command blkid

And edit fstab:
Code:
UUID=<uuid of swap> none ext2 defaults,noatime 0 2

So i think swap mount as ext2.. is that bad? The 1.30second boot is gone.
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 665

PostPosted: Mon Jun 18, 2018 1:37 am    Post subject: Reply with quote

glacies wrote:
And edit fstab:
Code:
UUID=<uuid of swap> none ext2 defaults,noatime 0 2

So i think swap mount as ext2.. is that bad? The 1.30second boot is gone.


Not ext2, it should say "swap" there. Also, noatime probably does not make an effect, just say "sw" for options, for example:
Code:
UUID=cb433d42-bade-4a1b-443b-c8331c564ad9a  none   swap        sw          0 0
Back to top
View user's profile Send private message
glacies
n00b
n00b


Joined: 08 Jun 2018
Posts: 29
Location: Netherlands

PostPosted: Mon Jun 18, 2018 3:15 am    Post subject: Reply with quote

You are right, i overlooked fstab too quick.
Back to top
View user's profile Send private message
glacies
n00b
n00b


Joined: 08 Jun 2018
Posts: 29
Location: Netherlands

PostPosted: Mon Jun 18, 2018 8:06 am    Post subject: Reply with quote

It seems that with:
Code:
UUID=cb433d42-bade-4a1b-443b-c8331c564ad9a  none   swap        sw          0 0

I get the swap partition start job described in above post.
When changing to ext4 in /etc/fstab I have no start job on boot.
Code:
UUID=cb433d42-bade-4a1b-443b-c8331c564ad9a  none  ext4      sw          0 0


So not solved yet :(
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Sat Jun 23, 2018 9:36 am    Post subject: Reply with quote

glacies wrote:
It seems that with:
Code:
UUID=cb433d42-bade-4a1b-443b-c8331c564ad9a  none   swap        sw          0 0

I get the swap partition start job described in above post.
When changing to ext4 in /etc/fstab I have no start job on boot.
Code:
UUID=cb433d42-bade-4a1b-443b-c8331c564ad9a  none  ext4      sw          0 0


So not solved yet :(
Eh? It was pointed out above that swap is not a file-system. So just set it back to "swap" and it's sorted, afaict.
Back to top
View user's profile Send private message
glacies
n00b
n00b


Joined: 08 Jun 2018
Posts: 29
Location: Netherlands

PostPosted: Sun Jun 24, 2018 11:35 am    Post subject: Reply with quote

Hello steveL,

When setting to "swap" in fstab, i get 1.30seconds start job delay at boot.
On the Arch Wiki i noticed that fstab swap line is not entirely needed *edit* for systemd, because systemd will mount the swap device automatically.

After removing the swap line in fstab, the start job with 1.30 seconds delay is gone, however the swap is never active.
I made a simple systemd service that does "swapon /dev/mapper/encryptedswap" and now the swap is active without swap line in fstab, so i will mark thread solved.
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 665

PostPosted: Sun Jun 24, 2018 6:47 pm    Post subject: Reply with quote

I would recommend just commenting the line out versus incorrectly listing the type as a filesystem.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum