# Corrections for encryption wiki

**URL:** <https://forum.endeavouros.com/t/corrections-for-encryption-wiki/7079>\
**Category:** Forum & Website\
**Created:** [August 21, 2019, 11:46am UTC](https://forum.endeavouros.com/t/corrections-for-encryption-wiki/7079 "2019-08-21T11:46:29Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![2000](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/2/ee59a6/32.png) [@2000](https://forum.endeavouros.com/u/2000)\
**Post date:** [August 21, 2019, 11:46am UTC](https://forum.endeavouros.com/t/corrections-for-encryption-wiki/7079/1 "2019-08-21T11:46:29Z")

</div>

Hi Joe,  
nice to see encryption getting promoted.

The instructions setting up hibernation on the swapfile will not work though.  
Beginning where the wiki says …

```auto
sudo blkid -s UUID -o value /dev/mapper/vg0-lvroot

```

returns the UUID of the root volume.

This will not work because the standard encrypted install you describe will not produce any logical volumes; so there won’t be any volume group vg0 and no lvroot.

Instead of /dev/mapper/vg0-lvroot you should address the ext4 filesystem.

---

<div class="post-metadata">

**Author:** ![2000](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/2/ee59a6/32.png) [@2000](https://forum.endeavouros.com/u/2000)\
**Post date:** [August 21, 2019, 11:52am UTC](https://forum.endeavouros.com/t/corrections-for-encryption-wiki/7079/2 "2019-08-21T11:52:22Z")

</div>

I actually have all my machines encrypted, not just mobile devices so I would suggest renaming the Wiki to just “Encrypted installation”.

---

<div class="post-metadata">

**Author:** ![joekamprad](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/joekamprad/32/77608_2.png) [@joekamprad](https://forum.endeavouros.com/u/joekamprad)\
**Post date:** [August 21, 2019, 11:54am UTC](https://forum.endeavouros.com/t/corrections-for-encryption-wiki/7079/3 "2019-08-21T11:54:35Z")

</div>

thanks for the hint, i just change it !

---

<div class="post-metadata">

**Author:** ![2000](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/2/ee59a6/32.png) [@2000](https://forum.endeavouros.com/u/2000)\
**Post date:** [August 21, 2019, 1:36pm UTC](https://forum.endeavouros.com/t/corrections-for-encryption-wiki/7079/4 "2019-08-21T13:36:41Z")

</div>

I did a quick check in VirtualBox. Actually /etc/default/grub has everything set up correctly out of the box. The only thing that needs to be added is the swapfile offset.

I propose changing the wiki swapfile part to the following …

* * *

**Make a swapfile**

If you want to use hibernation, then you must add **swap** because the content of the **RAM** will be written to the swap partition/file. This also means that the swap size should be **at least** the size of **RAM**.

The following commands will produce a swapfile the size of **8GB**. copy and paste them one after the other inside terminal and give your **root password**.

If you want more or less swap change **8G** to what you want to use as swap.

```auto
sudo fallocate -l 8G /swapfile

```

```auto
sudo chmod 600 /swapfile

```

```auto
sudo mkswap /swapfile

```

```auto
sudo swapon /swapfile

```

To check …

```auto
swapon --show

```

Edit **/etc/fstab** to enable the swapfile after reboot

```auto
sudo leafpad /etc/fstab

```

Add the following line …

```auto
/swapfile none swap defaults,pri=-2 0 0

```

Save and exit.

**Activate hibernation**

```auto
sudo filefrag -v /swapfile | awk '{if($1=="0:"){print $4}}'

```

returns the swapfile offset. For example `997376..` , which means 997376.

```auto
sudo leafpad /etc/default/grub

```

**Change** to the following; remember to **use your offset**.

It will first look like this: (\*\*\* are the long snake of UUID numbers)

> GRUB\_CMDLINE\_LINUX\_DEFAULT=“quiet cryptdevice=UUID=_ **:luks-** _ root=/dev/mapper/luks-\*\*\* resume=/dev/mapper/luks-\*\*\* loglevel=3”

Add `resume_offset=`\*\*\*\*\* to the end of this line (after loglevel=3).

Insert offset number we got from the command before here.

Save and exit

Add `resume` to /etc/mkinitcpio.conf, do this now …

```auto
sudo leafpad /etc/mkinitcpio.conf

```

Change the HOOKS=… line by adding `resume` .

HOOKS=“base udev autodetect modconf block keyboard keymap encrypt lvm2 resume filesystems fsck”

Save and exit

rebuild kernel images and grub.cfg:

EFI and Bios systems:

`sudo mkinitcpio -p linux`

`sudo grub-mkconfig -o /boot/grub/grub.cfg`

---

<div class="post-metadata">

**Author:** ![2000](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/2/ee59a6/32.png) [@2000](https://forum.endeavouros.com/u/2000)\
**Post date:** [August 21, 2019, 2:30pm UTC](https://forum.endeavouros.com/t/corrections-for-encryption-wiki/7079/5 "2019-08-21T14:30:51Z")

</div>

From the wiki:

> [**choose only Letters and Numbers will be good as the prompt on bootup is only in US-English!**] _–\> needs improvement_  
> _If someone knows how to use system keyboard layout at this point we will be happy to put it in here!_

Seems it can be done (but I have never tried this myself, so …):

- [Change the keyboard layout of GRUB in stage 1](https://superuser.com/questions/974833/change-the-keyboard-layout-of-grub-in-stage-1)
- [Manual configuration of core image for early boot](https://wiki.archlinux.org/index.php/GRUB/Tips_and_tricks#Manual_configuration_of_core_image_for_early_boot)

---

<div class="post-metadata">

**Author:** ![joekamprad](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/joekamprad/32/77608_2.png) [@joekamprad](https://forum.endeavouros.com/u/joekamprad)\
**Post date:** [August 21, 2019, 10:24pm UTC](https://forum.endeavouros.com/t/corrections-for-encryption-wiki/7079/6 "2019-08-21T22:24:33Z")

</div>

i will add your changes to the wiki now, thanks again for the help!  
We are working on a solution to let users directly comment on wiki entries for an easy contribution to it.

---

<div class="post-metadata">

**Author:** ![joekamprad](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/joekamprad/32/77608_2.png) [@joekamprad](https://forum.endeavouros.com/u/joekamprad)\
**Post date:** [August 21, 2019, 10:50pm UTC](https://forum.endeavouros.com/t/corrections-for-encryption-wiki/7079/7 "2019-08-21T22:50:02Z")

</div>

> This can’t work because the kernel and initramfs is on the encrypted partition and not accessible until the drive is unlocked

([https://superuser.com/questions/974833/change-the-keyboard-layout-of-grub-in-stage-1](https://superuser.com/questions/974833/change-the-keyboard-layout-of-grub-in-stage-1))  
this sounds legit…

and creating a core image to get this working is so… arch-alike 😆  
thinking of doing this automaticly for the install process… is a nightmare

---

<div class="post-metadata">

**Author:** ![2000](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/2/ee59a6/32.png) [@2000](https://forum.endeavouros.com/u/2000)\
**Post date:** [August 21, 2019, 10:53pm UTC](https://forum.endeavouros.com/t/corrections-for-encryption-wiki/7079/8 "2019-08-21T22:53:32Z")

</div>

> [@joekamprad](#):
>
> thinking of doing this automaticly for the install process… is a nightmare

I agree!  
If someone really needs this a Wiki should suffice.

---

<div class="post-metadata">

**Author:** ![joekamprad](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/joekamprad/32/77608_2.png) [@joekamprad](https://forum.endeavouros.com/u/joekamprad)\
**Post date:** [August 21, 2019, 11:01pm UTC](https://forum.endeavouros.com/t/corrections-for-encryption-wiki/7079/9 "2019-08-21T23:01:33Z")

</div>

[https://wiki.archlinux.org/index.php/Talk:GRUB#Custom\_keyboard\_layout](https://wiki.archlinux.org/index.php/Talk:GRUB#Custom_keyboard_layout)

---

<div class="post-metadata">

**Author:** ![joekamprad](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/joekamprad/32/77608_2.png) [@joekamprad](https://forum.endeavouros.com/u/joekamprad)\
**Post date:** [August 21, 2019, 11:10pm UTC](https://forum.endeavouros.com/t/corrections-for-encryption-wiki/7079/10 "2019-08-21T23:10:21Z")

</div>

the other option would be to have a seperate boot partition, what is also secure enaugh in my opinion, there is no personal data stored…
