Skip to content

Instantly share code, notes, and snippets.

@labynocle
Last active June 24, 2022 13:15
Show Gist options
  • Save labynocle/772c186ee75c5fe3d1a0e5e0737f7ede to your computer and use it in GitHub Desktop.
Save labynocle/772c186ee75c5fe3d1a0e5e0737f7ede to your computer and use it in GitHub Desktop.
Ubuntu :: Check if disk is encrypted

To be able to give a proof to your IT when you ecrypted your disk during the installation process (cf: Ubuntu 22.04 Enable full disk encryption )

First list all your current disk:

$ lsblk --fs
NAME                  FSTYPE      FSVER    LABEL UUID                                   FSAVAIL FSUSE% MOUNTPOINTS
loop0                 squashfs    4.0                                                         0   100% /snap/bare/5
loop1                 squashfs    4.0                                                         0   100% /snap/chromium/2011
loop2                 squashfs    4.0                                                         0   100% /snap/chromium/2020
loop3                 squashfs    4.0                                                         0   100% /snap/core18/2409
loop4                 squashfs    4.0                                                         0   100% /snap/core20/1405
loop5                 squashfs    4.0                                                         0   100% /snap/core20/1518
loop6                 squashfs    4.0                                                         0   100% /snap/firefox/1232
loop7                 squashfs    4.0                                                         0   100% /snap/firefox/1443
loop8                 squashfs    4.0                                                         0   100% /snap/gnome-3-28-1804/161
loop9                 squashfs    4.0                                                         0   100% /snap/gnome-3-34-1804/77
loop10                squashfs    4.0                                                         0   100% /snap/gnome-3-38-2004/99
loop11                squashfs    4.0                                                         0   100% /snap/gnome-3-38-2004/106
loop12                squashfs    4.0                                                         0   100% /snap/gtk-common-themes/1534
loop13                squashfs    4.0                                                         0   100% /snap/slack/62
loop14                squashfs    4.0                                                         0   100% /snap/snap-store/575
loop15                squashfs    4.0                                                         0   100% /snap/snapd/15177
loop16                squashfs    4.0                                                         0   100% /snap/snapd/16010
loop17                squashfs    4.0                                                         0   100% /snap/snapd-desktop-integration/10
loop18                squashfs    4.0                                                         0   100% /snap/snapd-desktop-integration/14
loop19                squashfs    4.0                                                         0   100% /snap/tandem/23
loop20                squashfs    4.0                                                         0   100% /snap/snap-store/582
nvme0n1                                                                                                
├─nvme0n1p1           vfat        FAT32          A800-DBD2                               476,5M     7% /boot/efi
├─nvme0n1p2           ext4        1.0            1ac0f3f1-c58a-4c4f-837f-116391766753      1,3G    15% /boot
└─nvme0n1p3           crypto_LUKS 2              e246412e-d52e-4ad2-8ca7-b9f04bb7842f                  
  └─nvme0n1p3_crypt   LVM2_member LVM2 001       nboAwJ-dnUP-oeuV-Tg7e-OwVw-z0BH-IDzAN0                
    ├─vgubuntu-root   ext4        1.0            39a942f6-7e41-4c16-9b0c-bcff9f2c785b    414,9G     6% /
    └─vgubuntu-swap_1 swap        1              6b792227-3ad3-4f38-b9aa-435a201281a4                  [SWAP]

It's the nvme0n1p3 which - in my case - is the encrypted device.

Then you can just use cryptsetup to display the details:

$ sudo cryptsetup luksDump /dev/nvme0n1p3
LUKS header information
Version:       	2
Epoch:         	3
Metadata area: 	16384 [bytes]
Keyslots area: 	16744448 [bytes]
UUID:          	e246412e-d52e-4ad2-8ca7-b9f04bb7842f
Label:         	(no label)
Subsystem:     	(no subsystem)
Flags:       	(no flags)

Data segments:
  0: crypt
	offset: 16777216 [bytes]
	length: (whole device)
	cipher: aes-xts-plain64
	sector: 512 [bytes]

Keyslots:
  0: luks2
	Key:        512 bits
	Priority:   normal
	Cipher:     aes-xts-plain64
	Cipher key: 512 bits
	PBKDF:      argon2id
	Time cost:  9
	Memory:     1048576
	Threads:    4
	Salt:       46 cb 22 9a de 2b 07 5d c4 81 14 4f f2 e5 4c 87 
	            94 35 1e 92 88 d5 63 5c 26 7d dc 33 50 fe bd fd 
	AF stripes: 4000
	AF hash:    sha256
	Area offset:32768 [bytes]
	Area length:258048 [bytes]
	Digest ID:  0
Tokens:
Digests:
  0: pbkdf2
	Hash:       sha256
	Iterations: 299593
	Salt:       12 f1 4b 5b d1 ad ff ef 42 16 f7 a3 56 09 05 a8 
	            83 0e e7 c1 7c be 99 ff 55 5e 90 49 6c 99 64 4a 
	Digest:     cc 2c cd e1 75 dc c7 ed c9 c8 9f 25 d5 1d f8 2b 
	            48 9c fc 4f c5 ad 76 0c 6d 6d 3a 7c b2 71 4e 34 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment