You are not logged in.

#1 2021-03-19 14:58:42

Mrhawkbox
Member
Registered: 2020-11-23
Posts: 63

How do you open Luks to mount SDA?

I've tried

cryptsetup --typeluks /dev/sda3 and all UUID's in sda3 except control

.
I have 3 thereLv_home, lv_root and encrypted.  When ever I try to mount it via

 mount /dev/sda3 /mnt 

I gett unknown filesystem type 'crypto_LUKS'.
Creating a directory for a mount point makes no difference.

I should mention I'm trying to mount a lvm partition.

Last edited by Mrhawkbox (2021-03-19 14:59:22)

Offline

#2 2021-03-19 15:32:02

gebki
Member
Registered: 2021-01-22
Posts: 8

Re: How do you open Luks to mount SDA?

$ cryptsetup luksFormat --type luks1 --align-payload=8192 -s 256 -c aes-xts-plain64 /dev/sda3

$ cryptsetup open /dev/sda3 crypt_data

INFO>> you need to create a filesystem like vfat,btrfs, ext4 - without tou cant mount your partition
$ mkfs.ext4 /dev/mapper/crypt_data 

$ mount /dev/mapper/crypt_data /mnt

TIP>> do not use LVM just get into btrfs filesystem. the reason for --type luks1 format is grub -> grub is only able to read the luks1 format if you are trying to boot out of a encrypted partition.

over 99% of all encryption guides are out of date. specially if you are trying to setup a full encrypted system.

Last edited by gebki (2021-03-19 15:40:50)

Offline

#3 2021-03-19 15:43:11

Mrhawkbox
Member
Registered: 2020-11-23
Posts: 63

Re: How do you open Luks to mount SDA?

gebki wrote:
$ cryptsetup luksFormat --type luks1 --align-payload=8192 -s 256 -c aes-xts-plain64 /dev/sda3

$ cryptsetup open /dev/sda3 crypt_data

INFO>> you need to create a filesystem like vfat,btrfs, ext4 - without tou cant mount your partition
$ mkfs.ext4 /dev/mapper/crypt_data 

$ mount /dev/mapper/crypt_data /mnt

TIP>> do not use LVM just get into btrfs filesystem.

Thanks for the heads up but I'm using ext4.

Offline

#4 2021-03-19 15:46:09

Mrhawkbox
Member
Registered: 2020-11-23
Posts: 63

Re: How do you open Luks to mount SDA?

gebki wrote:
$ cryptsetup luksFormat --type luks1 --align-payload=8192 -s 256 -c aes-xts-plain64 /dev/sda3

$ cryptsetup open /dev/sda3 crypt_data

INFO>> you need to create a filesystem like vfat,btrfs, ext4 - without tou cant mount your partition
$ mkfs.ext4 /dev/mapper/crypt_data 

$ mount /dev/mapper/crypt_data /mnt

TIP>> do not use LVM just get into btrfs filesystem. the reason for --type luks1 format is grub -> grub is only able to read the luks1 format if you are trying to boot out of a encrypted partition.

over 99% of all encryption guides are out of date. specially if you are trying to setup a full encrypted system.

I was not aware of that. I installed refind as a bootloader. I messed up and should have read the docs first. I was unaware it didn't support lvm and Luks. I'm trying to get back into sda3 to  chroot and install grub.

Offline

#5 2021-03-19 15:53:10

frostschutz
Member
Registered: 2013-11-15
Posts: 1,651

Re: How do you open Luks to mount SDA?

if you are using lvm, you mount /dev/vg/lv, not /dev/sda3

if sda3 is encrypted, you have to cryptsetup luksOpen /dev/sda3 first, then vgchange -a y (that might happen automatically with udev rules), then mount /dev/vg/lv somewhere

Offline

#6 2021-03-19 15:54:09

gebki
Member
Registered: 2021-01-22
Posts: 8

Re: How do you open Luks to mount SDA?

just use grub it is way easier and it saves you ton of knowledge and time. if you are using grub dont forget to set the

encrypt

hook before filesystem in the /etc/mkinitcpio.conf

then run

$ mkinitcpio -p linux

and dont forget to set the encrypt device in /etc/default/grub

GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda3:crypt_data"

and enable

GRUB_ENABLE_CRYPTODISK=y

then run

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

Offline

#7 2021-03-19 16:53:24

Mrhawkbox
Member
Registered: 2020-11-23
Posts: 63

Re: How do you open Luks to mount SDA?

frostschutz wrote:

if you are using lvm, you mount /dev/vg/lv, not /dev/sda3

if sda3 is encrypted, you have to cryptsetup luksOpen /dev/sda3 first, then vgchange -a y (that might happen automatically with udev rules), then mount /dev/vg/lv somewhere

I've tried that it says no device or mapping point. Thanks for the tip though. I'm going to do a reinstall. The only reason I was trying to figure it out is to understand why it failed. You guys answered my questions perfectly. Thank you.

Last edited by Mrhawkbox (2021-03-19 16:56:00)

Offline

Board footer

Powered by FluxBB