# Disk encryption require all parition password

**URL:** <https://forums.rockylinux.org/t/disk-encryption-require-all-parition-password/3510>\
**Category:** Rocky Linux Help & Support\
**Created:** [July 14, 2021, 10:56am UTC](https://forums.rockylinux.org/t/disk-encryption-require-all-parition-password/3510 "2021-07-14T10:56:22Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![JustSomeone](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@JustSomeone](https://forums.rockylinux.org/u/JustSomeone)\
**Post date:** [July 14, 2021, 10:56am UTC](https://forums.rockylinux.org/t/disk-encryption-require-all-parition-password/3510/1 "2021-07-14T10:56:23Z")

</div>

Hello Everyone

thanks for the team for the their good work

yesterday i installed rocky 8.4 while encrypt the / and swap partition then for the first run after install it require the password for the (/) root partition then it ask for the swap password while both are the same i did not had that before when using Centos 8.3

then for any restart / start the machine it only ask for the encryption password for the / but not the swap but if i insert the (/) root partition in wrong way it ask for the password again which is expected and after that it ask for the swap partition

not sure if that expected or i miss something here

by the way i am using luks version 2 and my installation has only 3 partition / swap and /boot (boot can not be encrypted as you know)

thanks for the time and have a nice day 🙂

---

<div class="post-metadata">

**Author:** ![krono86](https://avatars.discourse-cdn.com/v4/letter/k/71c47a/32.png) [@krono86](https://forums.rockylinux.org/u/krono86)\
**Post date:** [July 14, 2021, 12:31pm UTC](https://forums.rockylinux.org/t/disk-encryption-require-all-parition-password/3510/2 "2021-07-14T12:31:08Z")

</div>

Hi @JustSomeone!  
If you want to use only one password, you have to encrypt an LVM volume group, inluding two logical volume / and swap.

Ivan

---

<div class="post-metadata">

**Author:** ![JustSomeone](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@JustSomeone](https://forums.rockylinux.org/u/JustSomeone)\
**Post date:** [July 14, 2021, 12:40pm UTC](https://forums.rockylinux.org/t/disk-encryption-require-all-parition-password/3510/3 "2021-07-14T12:40:23Z")

</div>

thanks @krono86 but the issue that when i install it only asked for password once for the encryption if that was the case it should ask for each partition password

the issue is that it ask for swap and / password if i inserted it wrong then it ask for both but if i insert it right it does not ask for the swap only for the root

hope that make it more clear now

thanks again and have a nice day 🙂

---

<div class="post-metadata">

**Author:** ![krono86](https://avatars.discourse-cdn.com/v4/letter/k/71c47a/32.png) [@krono86](https://forums.rockylinux.org/u/krono86)\
**Post date:** [July 14, 2021, 1:33pm UTC](https://forums.rockylinux.org/t/disk-encryption-require-all-parition-password/3510/4 "2021-07-14T13:33:53Z")

</div>

Have you used “Automatic” or “Custom” partiioning?

 ![VirtualBox_prova_encrypt_14_07_2021_15_31_45](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/2X/d/d614b7fd79563719f2f0c2dd5684f50af1b83086.png)

Ivan

---

<div class="post-metadata">

**Author:** ![JustSomeone](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@JustSomeone](https://forums.rockylinux.org/u/JustSomeone)\
**Post date:** [July 14, 2021, 2:31pm UTC](https://forums.rockylinux.org/t/disk-encryption-require-all-parition-password/3510/5 "2021-07-14T14:31:24Z")

</div>

custom  
and the layout are

1. /boot
2. /
3. swap

all are in the same Hard drive

thanks again 🙂

---

<div class="post-metadata">

**Author:** ![krono86](https://avatars.discourse-cdn.com/v4/letter/k/71c47a/32.png) [@krono86](https://forums.rockylinux.org/u/krono86)\
**Post date:** [July 14, 2021, 2:55pm UTC](https://forums.rockylinux.org/t/disk-encryption-require-all-parition-password/3510/6 "2021-07-14T14:55:06Z")

</div>

Ok!  
If you want only one password is needed, be sure to use LVM for both, / and swap.  
It’s also necessary that the two logical volumes are part of the same volume group (“rl” into the image):

 ![VirtualBox_prova_encrypt_14_07_2021_16_48_03](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/2X/9/90f019da75dce7ea8fdeb21a3b90decf297c4fb0.png)

Under “Volume Group” menu, click on modify and set “Encrypt” enabled:

 ![VirtualBox_prova_encrypt_14_07_2021_16_52_20](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/2X/0/04e66791819d93f13cddf83e7a6c32fdba04be94.png)

You will see the changes affect on the swap logical volume too:

 ![VirtualBox_prova_encrypt_14_07_2021_16_54_01](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/2X/a/a23cb0ee16a063afc6d6698cd258f72d0dc9edc1.png)

Now, I’m pretty sure system will ask for password only one time.

Ivan

---

<div class="post-metadata">

**Author:** ![JustSomeone](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@JustSomeone](https://forums.rockylinux.org/u/JustSomeone)\
**Post date:** [July 14, 2021, 3:02pm UTC](https://forums.rockylinux.org/t/disk-encryption-require-all-parition-password/3510/7 "2021-07-14T15:02:14Z")

</div>

that is the case  
the main point here

when the device boot

```auto
i have to enter the password of the root partition which is fine 

if the password is correct then the device boot as it should be

if the password is wrong then i have to retype it which expected but then i have to type the password for the swap partition 

which both are same as it only been asked once in the installation process

```

so it only ask for swap only and only if i type the / password wrong

thanks again for all the time and effort

---

<div class="post-metadata">

**Author:** ![krono86](https://avatars.discourse-cdn.com/v4/letter/k/71c47a/32.png) [@krono86](https://forums.rockylinux.org/u/krono86)\
**Post date:** [July 14, 2021, 3:11pm UTC](https://forums.rockylinux.org/t/disk-encryption-require-all-parition-password/3510/8 "2021-07-14T15:11:26Z")

</div>

Ok, now I understand!  
I’m on a fresh installed system, and I’m not able to replicate your issue.  
When I type a wrong password, I have to retype that only one time.

Ivan

---

<div class="post-metadata">

**Author:** ![JustSomeone](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@JustSomeone](https://forums.rockylinux.org/u/JustSomeone)\
**Post date:** [July 14, 2021, 3:14pm UTC](https://forums.rockylinux.org/t/disk-encryption-require-all-parition-password/3510/9 "2021-07-14T15:14:22Z")

</div>

thanks alot @krono86  
it will try to dive more into it maybe i miss something

thanks again and have a nice day 🙂

---

<div class="post-metadata">

**Author:** ![krono86](https://avatars.discourse-cdn.com/v4/letter/k/71c47a/32.png) [@krono86](https://forums.rockylinux.org/u/krono86)\
**Post date:** [July 14, 2021, 6:46pm UTC](https://forums.rockylinux.org/t/disk-encryption-require-all-parition-password/3510/10 "2021-07-14T18:46:46Z")

</div>

Please, report the output of lsblk.  
It’s a strange behaviour.

Ivan

---

<div class="post-metadata">

**Author:** ![JustSomeone](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@JustSomeone](https://forums.rockylinux.org/u/JustSomeone)\
**Post date:** [July 14, 2021, 7:53pm UTC](https://forums.rockylinux.org/t/disk-encryption-require-all-parition-password/3510/11 "2021-07-14T19:53:57Z")

</div>

sure and thanks a lot for your time

 ![Screenshot from 2021-07-14 21-49-40](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/2X/6/6d1dae7d8890a9883abf0fd01c616c7bbac25311.png)

> [@krono86](#):
>
> It’s a strange behaviour.

i agree but i am new in linux world that why i was not sure if it bug or new feature or i am missing something

thanks again 🙂

---

<div class="post-metadata">

**Author:** ![krono86](https://avatars.discourse-cdn.com/v4/letter/k/71c47a/32.png) [@krono86](https://forums.rockylinux.org/u/krono86)\
**Post date:** [July 14, 2021, 8:12pm UTC](https://forums.rockylinux.org/t/disk-encryption-require-all-parition-password/3510/12 "2021-07-14T20:12:53Z")

</div>

Here it is!  
You have configured your volumes as LUKS-on-LVM. You need LVM-on-LUKS.  
Reinstall the system using my suggestions, you will solve.

Ivan

---

<div class="post-metadata">

**Author:** ![JustSomeone](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@JustSomeone](https://forums.rockylinux.org/u/JustSomeone)\
**Post date:** [July 15, 2021, 3:17pm UTC](https://forums.rockylinux.org/t/disk-encryption-require-all-parition-password/3510/13 "2021-07-15T15:17:35Z")

</div>

thanks a lot i will try it but i have question

why it behave like that only when i enter wrong password for the root  
should not it always ask for both password (/ and swap)

thanks again and have a nice day 🙂

---

<div class="post-metadata">

**Author:** ![krono86](https://avatars.discourse-cdn.com/v4/letter/k/71c47a/32.png) [@krono86](https://forums.rockylinux.org/u/krono86)\
**Post date:** [July 15, 2021, 4:04pm UTC](https://forums.rockylinux.org/t/disk-encryption-require-all-parition-password/3510/14 "2021-07-15T16:04:47Z")

</div>

This is strange.  
Maybe your swap volume is decrypted using a key file stored on the root volume.  
When you correctly decrypt root, the key file is found and the swap volume is correctly decrypted; when you type a bad passphrased for root volume, you are prompted for inserting a valid passphrase for the swap volume, and then you have to retype your passphrase for root volume too.

Ivan

---

<div class="post-metadata">

**Author:** ![JustSomeone](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@JustSomeone](https://forums.rockylinux.org/u/JustSomeone)\
**Post date:** [July 15, 2021, 4:14pm UTC](https://forums.rockylinux.org/t/disk-encryption-require-all-parition-password/3510/15 "2021-07-15T16:14:18Z")

</div>

the problem when i type it wrong it ask for the root password again then the swap

and is there away to dive into that to trace it

sorry i am not expert in linux world

and thanks a lot for your time and help

---

<div class="post-metadata">

**Author:** ![iwalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/iwalker/32/2599_2.png) [@iwalker](https://forums.rockylinux.org/u/iwalker)\
**Post date:** [July 16, 2021, 7:14am UTC](https://forums.rockylinux.org/t/disk-encryption-require-all-parition-password/3510/16 "2021-07-16T07:14:48Z")

</div>

Hi @JustSomeone

This is normal behaviour because you create **two** encrypted partitions instead of encrypting the entire LVM volume group. Had you done it how @krono86 mentioned then you wouldn’t have this problem since you would be entering it solely for the LVM group. Since the group is encrypted, the passwords are not per partition level.

You are not going to fix it by leaving your system as it is. @krono86 provided you with screenshots on how you should be installing the system, and your screenshot shows that it doesn’t match and it’s clear to see that you encrypted root and swap separately.

I too also had it done like you once, and it’s not possible to resolve. Do it the way that has been suggested. In fact, on my system I had encrypted every partition separately like you, also used the same password for each partition, but then it asked me 5 times to enter the password for each partition as I had swap, /, /usr, /var and /tmp and it didn’t matter that the password was the same or not. You are lucky that it does actually attempt to use it for the second partition. Obviously when you entered a failed one, it then forces you to enter for all partitions separately. Only when I encrypted the LVM group did I resolve the problem, so this is the solution.

---

<div class="post-metadata">

**Author:** ![JustSomeone](https://avatars.discourse-cdn.com/v4/letter/j/7ea924/32.png) [@JustSomeone](https://forums.rockylinux.org/u/JustSomeone)\
**Post date:** [July 16, 2021, 8:52am UTC](https://forums.rockylinux.org/t/disk-encryption-require-all-parition-password/3510/17 "2021-07-16T08:52:50Z")

</div>

thanks a lot @iwalker for the details

and thanks for @krono86 also

and have a nice day both of you 🙂

---

<div class="post-metadata">

**Author:** ![brian](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/brian/32/5777_2.png) [@brian](https://forums.rockylinux.org/u/brian)\
**Post date:** [August 25, 2023, 4:08am UTC](https://forums.rockylinux.org/t/disk-encryption-require-all-parition-password/3510/18 "2023-08-25T04:08:01Z")

</div>


