PDA

View Full Version : luks Error unlocking Operation not permitted


akiro
07-08-2022, 15:47
Ciao a tutti,
che l'informatica non sia una scienza esatta si sapeva, ma così... :lol: :|

uso CentOS 7.9 e ieri ho usato il pc normalmente: login, inserito le 3 password per sbloccare la partizione criptata con LUKS (1 wallet, passphrase in automatico dal wallet e root)... poi spento il pc l'ho riacceso di notte ma non c'è stato verso di riappropriarmi della partizione criptata, l'errore è:

An error occurred while accessing '353,8 GiB Encrypted Drive', the system responded: The requested operation has failed: Error unlocking /dev/sda3: Failed to activate device: Operation not permitted

Le ho provate tutte, questi i file fstab, crypttab e luks-keys:

$ cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Tue Jun 2 19:17:12 2020
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=9e6d4245-d389-445d-a789-aa734ed60210 /boot xfs defaults 0 0
/dev/disk/by-uuid/c92cd347-5f64-4049-bd61-7d2319d4e210 /mnt/dati auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/mapper/centos-root / xfs defaults,x-gvfs-name=root 0 0
/dev/mapper/centos-swap none swap sw 0 0
/dev/mapper/centos-home /home xfs defaults,x-gvfs-name=home 0 0
#/dev/disk/by-uuid/fb59bfc6-1478-42cc-a173-ab41c04062f9 /mnt/documenti auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-uuid/c3441f0a-a9f9-4601-9c75-6c2ab42de11e /mnt/scaricati auto nosuid,nodev,nofail,x-gvfs-show 0 0

$ sudo cat /etc/crypttab
luks-de8bf964-e193-4531-b951-30d2e14606c5 UUID=de8bf964-e193-4531-b951-30d2e14606c5 /etc/luks-keys/luks-de8bf964-e193-4531-b951-30d2e14606c5 nofail

$ ls -la /etc/crypttab
-rw-------. 1 root root 148 7 ago 15.12 /etc/crypttab

$ sudo ls -la /etc/luks-keys
totale 20
drwx------. 2 root root 55 30 apr 23.08 .
drwxr-xr-x. 175 root root 12288 7 ago 15.48 ..
-rw-------. 1 root root 9 30 apr 23.08 luks-de8bf964-e193-4531-b951-30d2e14606c5

Tra l'altro la stranezza che non compare la partizione criptata in fstab, dovrei montarla su /mnt/documenti ma quella riportata lì dovrebbe essere il vecchio UUID della partizione prima del crittazione. Di solito il mount lo facevo tramite click nei device su Dolphin e da lì chiedeva tutte le pass.
E luks-de8bf964-e193-4531-b951-30d2e14606c5 non contiene la passphrase come in realtà pensavo... o_O La data di creazione del file però non coincide con quella del filesystem perché ho criptato la partizione nel 2021, probabilmente ad aprile avevo fatto dei tentativi per chiedere un unica password per sbloccare il disco al boot, tentativi che han fatto uscire la richiesta al boot ma che non è mai andata per cui lasciavo passare i secondi ed il sistema era ok, fino a ieri almeno.

Altra cosa brutta, non riesco ad aggiungere una nuova passphare, quindi sembrerebbe che l'unica che mi sono salvato in fase di creazione del filesystem non sia più utile:

# cryptsetup luksOpen --test-passphrase /dev/sda3 --debug
# cryptsetup 2.0.3 processing "cryptsetup luksOpen --test-passphrase /dev/sda3 --debug"
# Running command open.
# Locking memory.
# Installing SIGINT/SIGTERM handler.
# Unblocking interruption on signal.
# Allocating context for crypt device /dev/sda3.
# Trying to open and read device /dev/sda3 with direct-io.
# Initialising device-mapper backend library.
# Trying to load any crypt type from device /dev/sda3.
# Crypto backend (gcrypt 1.5.3) initialized in cryptsetup library version 2.0.3.
# Detected kernel Linux 3.10.0-1160.71.1.el7.x86_64 x86_64.
# PBKDF pbkdf2, hash sha256, time_ms 2000 (iterations 0), max_memory_kb 0, parallel_threads 0.
# Reading LUKS header of size 1024 from device /dev/sda3
# Key length 32, device size 742064128 sectors, header size 2050 sectors.
# Checking volume passphrase using token -1.
# Interactive passphrase entry requested.
Inserire la passphrase per /dev/sda3:
# Checking volume passphrase [keyslot -1] using passphrase.
# Trying to open key slot 0 [ACTIVE_LAST].
# Reading key slot 0 area.
# Using userspace crypto wrapper to access keyslot area.
# Trying to open key slot 1 [INACTIVE].
# Trying to open key slot 2 [INACTIVE].
# Trying to open key slot 3 [INACTIVE].
# Trying to open key slot 4 [INACTIVE].
# Trying to open key slot 5 [INACTIVE].
# Trying to open key slot 6 [INACTIVE].
# Trying to open key slot 7 [INACTIVE].
No key available with this passphrase.
# Interactive passphrase entry requested.
Inserire la passphrase per /dev/sda3:



So che è un po' incasinata come situazione ma non so che altro provare, se avete un'idea... grazie

sacarde
08-08-2022, 08:46
un bel casino!

- quanti dischi hai?
e relative partizioni

- se avvii da live riesci a vedere la partizione e a montarla?

akiro
08-08-2022, 22:51
- quanti dischi hai?
e relative partizioni

- se avvii da live riesci a vedere la partizione e a montarla?

il danno è relativo solo alla partizione sda3

ho 2 dischi ma la partizione cryptata è sul disco sda


# df -h
File system Dim. Usati Dispon. Uso% Montato su
devtmpfs 3,8G 0 3,8G 0% /dev
tmpfs 3,9G 0 3,9G 0% /dev/shm
tmpfs 3,9G 9,5M 3,9G 1% /run
tmpfs 3,9G 0 3,9G 0% /sys/fs/cgroup
/dev/mapper/centos-root 36G 12G 24G 34% /
/dev/sda1 24G 2,1G 21G 10% /mnt/scaricati
/dev/sda2 545G 364G 154G 71% /mnt/dati
/dev/sdb1 1014M 456M 559M 45% /boot
/dev/mapper/centos-home 18G 7,0G 11G 41% /home
tmpfs 783M 60K 783M 1% /run/user/1000

devo provare ancora da live... appena riesco

akiro
09-08-2022, 23:05
ok, colpo di fortuna! ho trovato la passphrase corretta!!!