date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,552,997,393,000 |
I am currently aware of two recent methods to bind a LUKS encrypted root partition to a TPM2: systemd-cryptenroll and clevis. Both of them seem to release the encryption key after successfully checking the PCRs the key was sealed against.
But I don't like the idea of the volume being decrypted without user interaction... |
2022-05-21 - systemd v251
Support for TPM2 + PIN has been merged in systemd-cryptenroll and is available as part of release v251.
Changes in disk encryption:
systemd-cryptenroll can now control whether to require the user to
enter a PIN when using TPM-based unlocking of a volume via the new
--tpm2-with-pin= option.
... | LUKS + TPM2 + PIN |
1,552,997,393,000 |
first of all I already read this topic :
How to change the hash-spec and iter-time of an existing dm-crypt LUKS device?
where the proposal is the following command :
cryptsetup-reencrypt --keep-key
However, the answer is 7 years ago and was considered as experimental. On my side, I have installed Debian from a live U... |
You don't need to reencrypt the device if you want to change only --iter-time. Reencryption is used when you want to change the way the data on the disk is encrypted (so different key, algorithm or, in case of the linked question, hash function). Iteration time is a "property" of the key slot -- it tells how long shou... | How to modify -iter-time on a existing luks partition |
1,552,997,393,000 |
I'm installing a system on SSD with LUKS and Btrfs, where should I enable discard option for TRIM support? Only /etc/crypttab, only /etc/fstab, everywhere, or nowhere since Btrfs detects SSDs and enables TRIM support?
I also use LVM, shoud I somehow change configs to activate TRIM support for LVM too?
P.S. I know abou... |
For TRIM to work, it has to be enabled on all layers. The first step therefore is to enable it in LUKS as LUKS normally disables TRIM due to the security implications. For some distributions you do this in the crypttab, for others you need to edit the cmdline.
Since LVM is the next layer on top of LUKS it needs to pas... | Where should I enable discard option? |
1,552,997,393,000 |
I have been using ecryptfs encryption for a long time. I prefer per user encryption. That means even a root user can not read a user files when the user is not logged in. When an user is not logged in, any users (including root) should not be able to read his files. But ecryptfs is not an encryption for the entire sys... |
This is exactly what I do with my desktop. I have my entire partition encrypted with LUKS. And then I have my home directory encrypted using ecryptfs. The reason I encrypt my home directory using ecryptfs is because the desktop is used by my partner as well.
If you are the sole user of your system, ecryptfs may not b... | Is it good to have both LUKS and ecryptfs encryptions at the same time? |
1,552,997,393,000 |
My Raspberry Pi (which is 10,000 km away from me right now) works as follows:
It is running Raspbian (July 2016's version)
The SD card contains /boot
An encrypted hard disk drive (using LUKS cryptsetup) contains /
When the Pi boots, I can unlock the HDD remotely using dropbear over SSH. It asks for the HDD's password... |
I do not know what gave you the impression that aptitude upgrade would leave your kernel untouched, it simply doesn't. I had the same trouble after a kernel update on my encrypted pi. The problem is that your initramfs needs to be rebuilt. Here is how you do that on an external machine.
First, plug in your SD card wit... | initramfs, LUKS and dm_mod can't boot after upgrade |
1,552,997,393,000 |
I am trying to do what I think is a pretty standard setup of encrypted / partition and unencrypted /boot using the Debian installer (for Stretch-rc1). I created /boot by selecting the option EFI System Partition, as this is a UEFI system. I then created an encrypted LUKS volume and put the root file system there. Alth... |
I ended up getting this fixed.
Basically, I needed three partitions rather than two:
ESP (FAT, unencrypted)
/boot (ext, unencrypted)
/ (any valid Linux file system, encrypted)
The unencrypted EFI system partition (ESP) only contains the bootloader (e.g. GRUB), not the kernel or its initrd/initramfs (initial ramdisk... | Installing Debian with encrypted root: installer does not see EFI /boot partition |
1,552,997,393,000 |
I have an encrypted hard drive on my Lan Server. It was encrypted using luks/dm-crypt. The server has a NFS v4 running to share files in the Lan. It works, except for the encrypted USB hard drive. If the client mounts the shares into his file system, he finds an empty folder where the decrypted files should be.
This i... |
With the Linux kernel NFS server, if you export a directory tree, this does not include any filesystems mounted on that tree. See the description of the nohide option in the exports(5) man page.
You need to export the mounted filesystem explicitly, i.e. you need a separate line in exports for /exports/user1/data1. Fur... | NFS v4 export encrypted partition. Client mounts empty dir |
1,552,997,393,000 |
I have some encrypted volumes that I use with my Xubuntu machine. One volume is a container file that is mapped to /dev/loop0 and encrypted using plain dm-crypt; another volume is a USB hard drive encrypted using dm-crypt/LUKS.
What I'd like to know is what would happen if I accidentally shut down the computer without... |
The short answer is that encrypted volumes are not really more at risk.
The encrypted volumes have a single point of failure in the information at the beginning of the volumes that maps the password (or possibly several passwords for systems like LUKS) to the encryption key for the data. (That is why it is a good ide... | Are encrypted volumes more vulnerable to power loss? |
1,552,997,393,000 |
I was battling with setting up a Mint install on an encrypted hard-drive, and I think I partially succeeded. But I cannot boot the system because some configuration is not correct. I have no idea how to fix it now.
The rough guidelines I followed was along the lines of http://blog.andreas-haerter.com/2011/06/18/ubuntu... |
There's a evident wrong configuration:
lvm_crypt /dev/sda5 none luks
You decrypted the volume and named it lvm_crypt while mounting /dev/mapper/mint-root
Were you asked to input the password during boot ?
Also, did you updated initramfs afterwards ? Because this crypttab need to be embedded since it's for root partiti... | How to salvage a lvm/luks install from custom install |
1,552,997,393,000 |
My root and home partitions are LUKS-encrypted. I wish to have discard/TRIM enabled on them (I'm aware of security implications). If my understanding is correct, this should result in discarded areas being zeros on a raw disk device and gibberish on cryptsetup-mapped device.
I've made some configuration changes, ran f... |
If you are able to access the raw disk (without encryption) you could do:
dd if=/dev/sda bs=1M count=100 2>/dev/null | tr -d '\0' | wc -c
That will read 100Mega byte from the disk, remove all the zeros and count the number of bytes remaining.
I do not know if that is the fastest method but it should be quite fast as... | Fastest way to count zero bytes on a partition |
1,552,997,393,000 |
I was trying to encrypt all the HDD during the installation process of Debian 8 Jessie using full disk encryption + LVM, and I did it, but, there are a little "problem".
Before the system asks me the password to unlock the disk, it display a message:
Loading, please wait...
[5.004102] sd 2:0:0:0: [sda] Assuming drive ... |
It's not an error, so you shouldn't try to make it go away.
The scripts in your initramfs are opportunistically checking to see if they can activate the LVM VG that contains your root device before they bother asking for a passphrase to decrypt any encrypted devices. In the case that your root device is not encrypted,... | Debian error message: "Unable to find LVM volume", but then boots successfully |
1,552,997,393,000 |
I've decided to move my Debian bootloader and /boot from the hard drive to a USB stick.
I'm using LUKS to en/decrypt my hard drive and the bootloader is the only unencrypted partition.
How can I easily do this? I want to remove it from
the hard drive, resize any of the partitions (/, /var, /tmp) to get the free sp... |
Screw grub. It's probably some complexity it introduces that leads you to believe this is a difficult problem to solve. If your computer is less than 5 years old or so, then you're probably booting from a UEFI firmware, in which case your Debian-built linux kernel is already a bootloader.
Partition the disk:
printf %... | How to move the bootloader from a hard drive to a usb stick |
1,552,997,393,000 |
Background: I'm investigating methods for encrypted storage on untrusted machines. My current setup uses sshfs to access a LUKS-encrypted image on the remote machine, which is decrypted locally and mounted as ext3. (If I were to use sshfs only, someone gaining access to the remote machine could see my data.) Here's my... |
I'd assume the weakest link here is the SSHFS code -- the rest of the stuff is in kernel and pretty heavily used, so it's probably fine. I've never actually looked at any FUSE code before, so there could be something else going on that I've missed, but according to the SSHFS source code, SSHFS's implementation of fsy... | Meaning of fsync() in sshfs+LUKS setup |
1,552,997,393,000 |
Let's suppose I create a file, map it to /dev/loop0, and create a LUKS partition inside
dd if=/dev/zero of=myfile bs=1M count=1000
losetup /dev/loop0 myfile
cryptsetup -c aes-cbc-essiv:sha256 -s 256 -v -y luksFormat /dev/loop0
I then open the encrypted partition
cryptsetup luksOpen /dev/loop0 myfile
Now, I have my ... |
From my experience running an encrypted reiserfs with private information you should not put that on an journalling filesystem like ext3. I switched back from ext3 to having the file on an ext2 partition after I had to restore from a backup.
Over the years ( I have had this file for 5 years ), I had to run recovery se... | File containing ext filesystem |
1,552,997,393,000 |
I recently bought a new laptop with a 16Gb mSATA SSD cache drive. I haven't used that one yet.
I have, however, opted for Ubuntu 13.04 with "Full Disk Encryption" for the main partition (is that what's called LUKS?).
With bcache making it's way into 3.10, I'd like to take advantage of the aforementioned cache drive.
A... |
To answer 1., the most sensible thing to do is to put bcache on top of two LUKS virtual devices. LUKS-encrypting a bcache device might work, but there's no guarantee LUKS will consistently put the same virtual sector in the same physical sector every time. You can encrypt both LUKS devices with the same keyfile and un... | BCache and disk encryption |
1,714,761,042,000 |
I am trying to install Kubuntu 24.04 with manual partitioning. I have created primary partitions for EFI and boot, and an encrypted partition with logical volumes for swap, root, and home.
Previously, after this step I just run the Kubuntu installer, manually assigned /dev/mapper/vg0-* partitions for root, home, and ... |
I actually found a solution and was able to perform an installation.
I created and mounted my luks volumes (with luksOpen), and after that formatted all of them with mkfs / mkswap.
The key to success was to name the luks device (when opening it) to live-WHATEVER, so that it appears under /dev/mapper/live-WHATEVER.
Als... | How do I use LUKS encrypted partitions with Kubuntu 24.04 installation? |
1,714,761,042,000 |
I have an Ubuntu 20.04 machine setup that I am trying to configure for disk encryption. I am trying to setup auto unlock, but my configuration has not worked so far, and I am always prompted for a password.
To do this I followed the following steps:
sudo apt-get update and sudo apt-get install cryptsetup
Check /dev/n... |
I was missing: clevis-initramfs that needed to be installed. Once added the auto unlocker worked.
| Ubuntu 20.04 clevis-luks setup auto unlocking not working |
1,714,761,042,000 |
I'd like to setup Arch Linux with encryption. I found the tutorial on the Arch wiki, and think that the second option (LVM on LUKS) is the best option for me. Here's the partitioning I'd like to use (Thinkpad X1 Carbon, ~ 500 GB SSD, 16 GB RAM):
[alignment gap] 1 MB
/boot 256 MB (FAT 32)
swap 16 GB (size of memory)
/... |
Since @frostschutz hasn't written his correct solution to the problem as an answer yet, I'll summarize the issue here quickly: I picked the UUID of the wrong partition. The root partition under /dev/VolumeGroup/root is not the one to be chosen, but the actual partition /dev/nvme0n1p2. Here's how to extract that UUID:
... | Arch Linux Setup with Encryption (LVM on LUKS) |
1,714,761,042,000 |
I am following the Debian dev's guide to full disk encryption. I am currently on Section 4, step 3- editing /etc/crypttab.
In the guide, in section 3 they set up keyslot 0 for something else and now in section 4 are setting up keyslot 1.
However, during my setup, section 3 defaulted to keyslot 1, and therefore for sec... |
The cryptsetup manual is divided into several pages. The crypttab man page should reference the cryptsetup-open man page.
--key-slot, -S <0-N>
This option selects a specific key-slot to compare the passphrase against. If the given passphrase would only match a different key-slot, the operation fails.
So you'll have ... | Does crypttab's "key-slot" option mean LUKS will try that keyslot "only", or "first"? |
1,714,761,042,000 |
Several years ago I installed Debian on my 500 GiB hard disk. During installation I chose to have encrypted filesystem. So installer created one small unencrypted boot partition (I guess that grub configuration is kept there) and one large LUKS encrypted partition. This large encrypted partition is a physical volume, ... |
This uuid "EFc551-(...)" probably is your 2TB disk (namely encrypted PV on it). You need to tell somehow your initramfs about this second PV. Probably update-initramfs will do it, something like (from knoppix):
(assuming you've mounted your disk in /mnt/disk)
cp -a /dev/* /mnt/disk/dev/
chroot /mnt/disk
mount /pr... | after adding one more physical volume and enlarging logical volume, grub fails |
1,714,761,042,000 |
Here's my setup
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 238.5G 0 disk
├─nvme0n1p1 259:1 0 100M 0 part /boot/efi
├─nvme0n1p2 259:2 0 250M 0 part /boot
└─nvme0n1p3 259:3 0 238.1G 0 part
└─Be-Water-My-Fri... |
You need one extra step between 4 and 5 -- shrink the Arch-root logical volume using lvresize -L-22G Arch/root (lvresize has option --resizefs to resize both the LV and the filesystem, but it currently doesn't support btrfs so you can't use it here). This answer nicely explains difference between resizing filesystem (... | Shrink root LVM on LUKS2 btrfs root partition to enlarge swap partition |
1,714,761,042,000 |
luks1 has limit of 8. But I just accidentally add 9 slots to luks2 (from 0 to 8). I wonder what is the limit for luks2?
Keyslots:
0: luks2
Key: 512 bits
Priority: normal
Cipher: aes-xts-plain64
Cipher key: 512 bits
PBKDF: argon2i
Time cost: 5
... |
For LUKS1, it's 8 key-slots, fixed.
For LUKS2, currently it's at most 32 key-slots:
#define LUKS2_KEYSLOTS_MAX 32
Trying to add more simply results in the error message "All key slots full.".
However, the answer might not be so simple after all. The limit of 32 exists in code but is not mentioned at all in the ... | how many key slots does the luks2 support? |
1,714,761,042,000 |
How do I format LUKS encrypted disk if I don't know the passphrase?
I recently switched my HDD for a new SSD disk in my laptop and now when I connect the old HDD externally I can't mount disk event with the right passphrase (I assume I am doing something wrong at this point). However I want to format that disk and use... |
If you want to overwrite the data of the encrypted disk with non-encrypted data anyway (i.e. you don't care about the current contents), you don't have to unlock the drive/partition first.
If the partition has a particular uncommon partition type, you might want to change that, but it is not necessary. You can just u... | Formatting LUKS encrypted disk |
1,714,761,042,000 |
From: https://code.google.com/p/cryptsetup/wiki/FrequentlyAskedQuestions
6.15 Can I clone a LUKS container?
You can, but it breaks security, because the cloned container has the
same header and hence the same master key. You cannot change the
master key on a LUKS container, even if you change the passphrase(s),
... |
Thanks for the answers, I created a sed command for it:
[root@notebook ~] test `whoami`=root && k=`cryptsetup luksDump -q --dump-master-key $(blkid | awk '/crypto_LUKS/ {print $1}' | cut -d: -f1 | head -1)` && echo "$k" | sed 's/^MK dump:/Fgkmtusjs\nMK dump:/g' | sed '1,/^Fgkmtusjs/d' | sed 's/.*\t//g' | sha512sum | ... | How can I get a HASH of the LUKS master key? |
1,714,761,042,000 |
I've followed this question https://unix.stackexchange.com/questions/5017/ssh-to-decrypt-encrypted-lvm-during-headless-server-boot and successfully remotely decrypted my root drive. However, I have a second drive that I also have encrpted, and unfortunately dropbear is killed by the boot process before second passphra... |
The easiest way to solve this is to add a derived key from the first partition to to the second disk by running:
/lib/cryptsetup/scripts/decrypt_derived sda1_crypt > new_key_file
cryptsetup luksAddKey /dev/sdb1 new_key_file # prompts for an existing key
shred -u new_key_file # remove the key fi... | Decrypt second encrypted LVM during headless server boot? |
1,714,761,042,000 |
I set up two LUKS encrypted drives to automount on system startup (using crypttab and a LUKS file key). It works fine, but unfortunately, if I disconnect one of the drives, the "auto decrypting" process doesn't run when I connect them to my PC again (running Fedora), and I have to do the mounting manually after unmoun... |
Each entry in /etc/crypttab is automatically converted by systemd's
systemd-cryptsetup-generator into a Unit at boot or when you run sudo systemctl daemon-reload. For example, assuming the LUKS filesystem has a
UUID of 1111... (I won't show it in full) the entry
mytest /dev/disk/by-uuid/1111... /etc/luks/mykeyfile lu... | How do I manually trigger systemd's "auto mounting" of encrypted partitions/drives? |
1,714,761,042,000 |
Currently, I do this to mount my encrypted thumbdrive:
# Works!
pass thumbdrive-password | # get device password entry from password manager
head -n 1 | # get the device password itself
sudo cryptsetup luksOpen /dev/sdb thumbdrive # unlock device
udisksctl mount -b /dev/mapper/thumbdrive # mount device
I'd li... |
For udisks version 2.6.4 and later
Note: I haven't tested this. I will once I get udisks 2.6.4 (whenever https://github.com/NixOS/nixpkgs/pull/41723 is backported to NixOS stable).
Update: I have udisks 2.8.0 now, so I can test my solution. The only thing I missed was removing the trailing newline from the output of p... | Provide password to udisks to unlock LUKS-encrypted device |
1,714,761,042,000 |
I have a LUKS (Linux Unified Key Setup) partition that contains the rootfs. I wish to replace it with an unencrypted ext4 partition containing the same rootfs. Having searched far and wide I've seen no tools to aid in this process. Did I miss something?
If not what is the solution? Use parted to delete the LUKS partit... |
This is a highly dangerous operation and should be executed with an abundance of caution.
At the most simplified level, there is a utility called cryptsetup-reencrypt which allows for this operation. It explicitly calls out in it's man page:
WARNING: The cryptsetup-reencrypt program is not resistant to
hardware... | Replace LUKS partition with ext4 partition with same contents |
1,714,761,042,000 |
This is a way I enter a new passphrase for my encrypted volume:
sudo cryptsetup luksAddKey --key-slot 4 /dev/sda5
Unfortunately, cryptsetup does not ask to confirm the new passphrase. How to make sure that the passphrase I have entered is the one that I actually meant?
I see two workarounds.
Reboot and try the new ... |
Just run cryptsetup with argument -y.
From the manpage of cryptsetup:
--verify-passphrase, -y
query for passwords twice. Useful when creating a (regular) mapping for the first time,
or when running luksFormat.
The system would ask twice for an existing passphrase and for a new one:
$ sudo cryptsetup luksAdd... | How to double-check a LUKS passphrase |
1,714,761,042,000 |
I'm trying to accomplish encrypting my OS w/ LVM on RHEL 7.2 and have it boot without entering a password by using a key on an unencrypted partition.
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
home rhel -wi-ao---- 22.35g
root rhe... |
I needed to add the path to my keyfile to dracut.confand rebuild initramfs.
echo 'install_items+="/media/key"' >> /etc/dracut.conf
dracut -fv
| RHEL: FDE w/o password - boot from key on partition |
1,714,761,042,000 |
I have a 1.5 TB partition of data, of which I accidentally overwrote some bytes at the beginning, due to a typo like:
ssh somewhere command | dd of=/dev/sda3 // should have used quotes here, dd was executed locally by mistake!
/dev/sda3 holds a LUKS container for the 1.5 TB ext4 partition with important data.
Whe... |
First: run dmsetup table --showkeys. Save the output of that somewhere safe—that big long hex string it shows is the actual encryption key (master key) used to secure your data. LUKS works by (simplification here) encrypting that key with your passphrase(s), so keep in mind that compromise of that key means game over—... | Recover LUKS partition after overwriting first few bytes of LUKS container? System still up! |
1,714,761,042,000 |
I'm actually trying to setup LUKS on a Red Hat 9.2 Server.
Here is the problem : I can't do yum install cryptsetup-luks or dnf install cryptsetup-luks.
When I try to use one of these command I have the following output :
no match for parameter: cryptsetup-luks
error: unable to find a match: cryptsetup-luks
I don't re... |
The package is called just cryptsetup. It used to be called cryptsetup-luks way back in RHEL 6 but since RHEL 7 it's just cryptsetup and it's in the BaseOS repository so you don't need any other extra repository.
| How to install cryptsetup-luks |
1,714,761,042,000 |
I already have a /boot partition on a USB stick and a LUKS partition on my computer, which correspond to a fulldisk encryption scheme with Ubuntu 21
I want to put the header of my LUKS partition onto the USB (either on the /boot partition or on another new partition on my USB)
I have put the header (with cryptsetup lu... |
As pointed out in the comments by @A.B the solution is a raw partition that contains the header instead of the header file inside a partition (which is a hassle due to the need to mount the filesystem first)
To copy the header (around 16MB for LUKS2) to a partition (/dev/sdb larger than the header size) two options.
... | Detached LUKS header (on USB) for an existing full-disk encryption device with Ubuntu |
1,714,761,042,000 |
we're trying to implement an initramfs with the intent of:
Open a LUKS partition (using a key saved on TPM)
Mounting the partition RO
Mounting an OverlayFS
switch_root to the new system
The first part of the script seems to work fine. Our problem is in the "switch_root" part which ends in a kernel panic.
Please note t... |
We found the solution. Basically, for testing purpose, we were executing our exec switch_root from a /bin/bash opened at the end of the init script. The problem is that switch_root requires to run with PID 1 but, in our setup, that PID was not available since it was occupied by init.
PID 1: /init
PID x: /bin/bash
=> e... | switch_root from initramfs is failing |
1,714,761,042,000 |
I recently installed Antergos (which is basically Arch) and set it to use full disk encryption. Now, I want to migrate from encrypt to sd-encrypt because I want to be able to hibernate and I couldn't put swap partition in the same LUKS volume..
Background
During the setup:
I used LUKS for / partition and swap partiti... |
I don't use Grub myself (but Arch and sd-encrypt) but from my kernel options I guess you would have to transform your configuration to look like (don't forget to backup your old configuration before switching).
HOOKS="base systemd autodetect modconf block keyboard sd-vconsole sd-encrypt resume filesystems fsck"
GRUB_... | Migrate Arch from encrypt to sd-encrypt |
1,714,761,042,000 |
I'm currently trying to teach myself some non-Windowsland operating systems, and I figured Ubuntu Server 16.04 would be the best place to start. Having "mastered" LVM, I'm trying to familiarize myself with cryptsetup and LUKS.
I'm beginning to get it, but the one thing I'm perplexed by is...
...to what end are the ... |
using /dev/random (…) can sometimes take a long time as the system generates more entropy
Correct.
in certain instances it's recommended to use --use-urandom (which correspondingly pulls from /dev/urandom
In virtually all circumstances, it's recommended not to use /dev/random. See Is a rand from /dev/urandom secur... | What are the --use-urandom or --use-random options in LUKS used for? |
1,714,761,042,000 |
If someone steals our master key to the FDE/LUKS, then we have to re-create the LUKS device, or is it enough to only change the LUKS password?
|
The master key is what encrypts the disk. All other keys and passwords provide access only to the master key.
The reasoning behind this is that if you want to change the LUKS password (or have several of them) only a tiny amount of data needs to be encrypted or re-encrypted. The disadvantage is that once your master k... | If the LUKS master key has been copied once, does it matter that we change the LUKS pw? |
1,714,761,042,000 |
I have 3 encrypted partitions, one for /, one for /home, and one for swap.
It seemed silly to me to type in my password 3 times, so I replaced the swap partition with a swap file on the encrypted drive. However, even though I removed the entry from fstab, I am still being prompted for my password for the old swap p... |
Encrypted volumes are listed in /etc/crypttab. You need to update that file, to remove the volume that you no longer want mounted.
After doing this, you need to rebuild the initramfs, by running
sudo update-initramfs -u
If you want to have three encrypted partitions on the same disk, then you should have a single enc... | Luks Partition Mounting After Removing From fstab |
1,714,761,042,000 |
For the tl;dr, skip to the bottom.
I have a dual-boot setup with Mac OS X at the beginning of my drive and three GNU/Linux partitions at the end of the drive. I don't have the relevant machine on hand to give an fdisk dump, but here's a rough overview of the original disk layout:
/dev/sda1: EFI System Partition
/dev/s... |
LUKS has a distinct header, you could find possible offsets with grep:
# grep -a -b --only-matching 'LUKS' /dev/sda5
1832480940:LUKS
1959072314:LUKS
2019974297:LUKS
For each possible offset you find, you could create a loop device and see if it's a valid LUKS device or not:
# losetup --find --show --offset 1832480940... | How can move a LUKS container from the middle of a partition to the beginning? |
1,714,761,042,000 |
I've gotten myself in a bit of a bind, here.
A while ago I set up an encrypted Unbuntu 13.04 under Xen. It's virtual disk is an LVM LV.
This LV was presented to the DomU as a (whole) physical disk during installation, and I let Ubuntu's installer set up encrypted root and swap (using LVM).
However, I forgot to writ... |
I'm not familiar with Xen. With KVM, I'd just make the VM boot up in a rescue or live CD, and chroot from there. As you would do if you had this problem on your real desktop.
If all you need is an offset, in general you can use losetup for that. Or more specifically offsets for partition tables, you can use partx or k... | Open luks-encrypted partition from virtual DomU LVM disk containing another LVM |
1,714,761,042,000 |
I just read this discussion between Linus Torvalds and (among others) Milan Broz, one of dm-crypt's maintainers.
I am intrigued by the the following part of the discussion :
Linus Torvalds:
I thought the people who used hidden ("deniable") things didn't actually ever use the outer filesystem at all, exactly so that t... |
There are probably a few ways to do this with reasonable safety, with potentially different approaches if starting with a new outer volume or an existing one.
Probably the best way to do this would be with the debugfs setb command on the unmounted outer filesystem device to mark range(s) of blocks that belong to the i... | How to refresh decoy data on a plausible deniability dm-crypt scheme? |
1,714,761,042,000 |
I have built a kali live usb 32GB with encrypted persistence.
Now I have copied the 32GB content to a 64GB usb device using the dd command, and everything is working fine on the new 64 GB device.
Since the 64 GB stick has free available space, I want to expand the encrypted (LUKS) partition. Unfortunately, so far I ha... |
I finally managed to resize the new 64GB device, taking in consideration the information found here.
For the sake of completeness, I have included the output of the single commands.
Start kali-live system using the original usb device (32GB).
Inserted the usb stick (64GB) containing the LUKS partition to be modified... | Extend LUKS partition |
1,624,309,449,000 |
I am trying to unlock my root encrypted Debian Buster on an acepc T11. I installed dropbear, added
DEVICE=enp1s0
IP=:::::enp1s0:dhcp
to /etc/initramfs-tools/initramfs.conf and executed update-initramfs -k all -u. When the initramfs is loaded, I get multple times the error
ipconfig: enp1s0: SIOCGIFINDEX: No such devic... |
Turned out, that indeed the network driver was missing in the initramfs. The module argument MODULES=most in /etc/initramfs-tools/initramfs.conf was not sufficient. Thanks to this answer, I found my network driver using lspci -v and added the appropriate module to /etc/initramfs-tools/modules. After rebuilding the ini... | Unlock LUKS device remotely - ipconfig: no devices to configure |
1,624,309,449,000 |
I have installed system on ext4 filesystem on lvm (vg name encrypted, root is called encrypted-root) on luks. When I'm trying to run fstrim /, I get fstrim: /: the discard operation is not supported.
My /etc/crypttab contains
cryptroot UUID=5ddb7e3a-dcbe-442d-85e8-359e944d0717 none luks,discard,lvm=encrypted
/etc/... |
I figured out problem was on encryption level. (You can run dmsetup table as root to see if your device shows allow_discards.)
This fixed the problem for me:
Edit /etc/initramfs-tools/conf.d/cryptroot, add discard option for particular device. In my case line looked like this: CRYPTROOT=target=encrypted-root,source=/... | How to enable discards on encrypted root |
1,624,309,449,000 |
I have a dual boot setup on a Windows machine with multiple partitions, the two Linux ones being encrypted using LUKS. For some reason, I can no longer restore a backup to my second Linux LUKS partition and properly boot into the LUKS splash screen so I can enter my decryption password. Instead, it tries to boot the... |
The problem was a failing hard drive, with bad (repairable) sectors where this partition was.
| Dual boot setup with LUKS and rEFInd: Can't Restore Backup to Second Partition |
1,624,309,449,000 |
After each hibernation process I get a corrupted root filesystem. My setup is a LUKS encrypted root and swap partition on LVM. I use a GPG encrypted key for the root filesystem and a unencrypted key file on the root partition for swap decryption. The initramfs is generated by genkernel with
genkernel --lvm --luks --gp... |
I use a GPG encrypted key for the root filesystem and a unencrypted
key file on the root partition for swap decryption.
Does that mean you have to mount the root filesystem in order to be able to decrypt swap? If so, this could likely be the cause of your problems. You're not allowed to access (write) filesystems ... | Corrupt Filesystem after Hibernation |
1,624,309,449,000 |
I have two external hard discs on an OpenSUSE 13.1 system.
On one I have created a partition structure:
An encrypted LVM partition (LUKS)
Several volumes (10) on this LVM partition, some formatted with xfs, some with ext4.
sdf 8:80 0 5,5T 0 disk
└─sdf1 ... |
ReaR (Relax-and-Recover) is a collection of shell scripts that can recreate the lvm structures. It does using either vgcfgbackup/vgcfgrestore backup restore native tools or lvm create.
It does not yet support recreating lvm configurations on thin pools.
For luks, it prompts for the passphrase and recreates the contain... | Replicate a complex partition structure with LUKS and LVM volumes |
1,624,309,449,000 |
I've installed gentoo on my new laptop. I've got an LUKS-encrypted root partition (/dev/sda3). Cryptsetup (USE="gcrypt") is installed. Essential cryptographic API is compiled in kernel. Kernel and initrd image are built using genkernel-next (--luks --gpg).
I use GRUB2 and these kernel options: root=/dev/ram0 crypt_ro... |
The problem was solved by rebuilding initrd image using genkernel-next with --lvm option.
| LUKS: Enter passphrase and nothing happens |
1,624,309,449,000 |
I have get informed on how prepare a LUKS system & partitions, giving a key/passphrase, etc. But for a new fresh install of linux.
How to encrypt an already installed/configured linux system ?
EDIT I have made my linux system as a server. I need it crypted, and I would like to test encryption without to reinstall anyt... |
Make another partition (or image file) with an encrypted fs for your data. Moving root on the fly to an encrypted fs on the same disk does not work.
| Encrypt existing disk with LUKS? |
1,624,309,449,000 |
I have a dd image of disk, which is a LUKS container containing a filesystme, and which I can loop mount and unlock to access the files. The filesystem in the container is only about 1/4 full. What is the proper way to take advantage of compression, while allowing me to be able to mounted and unlock the disk?
|
You can't compress LUKS encrypted data.
However, if all involved filesystems support it, you can discard free space using fstrim, resulting in a sparse file where free space is zero and does not occupy space.
# du -h foobar.img
1.0G foobar.img
# cryptsetup open --allow-discards foobar.img foobar
Enter passphrase f... | Compression, and a disk image of a LUKS container |
1,624,309,449,000 |
I've followed this guideline to the point where I encrypt the target partition:
cryptsetup -h sha256 -c aes-xts-plain64 -s 512 luksFormat /dev/nvme0n1p3
Then, the error appears, even though I'd unmounted the home partition previously like so:
umount -l /home
The reason for the -l-flag was that it didn't work without ... |
umount -l is so called lazy unmount -- for busy filesystems this waits until the filesystem is no longer in use before really unmounting it.
From mount manpage:
-l, --lazy
Lazy unmount. Detach the filesystem from the file hierarchy now, and clean up all references to this filesystem as soon
as it is not busy anymore... | cryptsetup luksFormat error "Device /dev/nvme0n1p3 is in use. Can not proceed with format operation." |
1,624,309,449,000 |
This is more of a educational and curiosity question, rather than tying to fix a problem. I have an Ubuntu system using LUKS. lsblk shows this:
Noteably, / is encrypted but /boot and /boot/efi are not. This is important because LUKS needs /boot to be unencrypted in order to boot GRUB.
But... / contains /boot. So it s... |
The devices (partitions) that / and /boot reside on are different,
and one can be encrypted while the other is not.
GRUB knows how to find /boot by using something like set root=(hd0,1) or search --hint=... as defined in grub.cfg.
Since GRUB can handle booting into multiple OS's installed simultaneously, the / file s... | LUKS - How can / be encrypted but /boot and /boot/efi are not? |
1,624,309,449,000 |
Let's assume I lost a LUKS encrypted USB pen drive. I think the file system type (ext4/fat32/...) doesn't play a role. A foreign person finds it. Of course he cannot access my data because he doesn't have the password. But he can change a single byte in the middle of the "raw" data so the data is damaged.
After the pe... |
It is possible but not with "plain" LUKS, you need to set up authenticated encryption. This is possible with LUKS v2, you need to create the LUKS device using the --integrity option with luksFormat. This will basically add checksums for the encrypted data to ensure integrity, without it LUKS/dm-crypt simply doesn't ca... | Is it possible to check if a LUKS device has been damaged by a foreign person? |
1,624,309,449,000 |
I installed Linux Mint 18.2, as LVM with LUKS encryption, onto a 128GB SSDD. I would like to remove the swap drive b/c I have 16GB of RAM on my machine and I want to try to preserve the drive as long as I can. When I started the disk and started Gparted to remove the swap partition I noticed that Gparted lists the dri... |
There shouldn't be any problem disabling a swap partition of any sort. Once booted, you can disable the swap partition with:
sudo swapoff -a
And then place a swap partition on some other disk and enable that with:
sudo swapon -U uuid-of-new-swap-partition.
Once you verify that the new swap is working, you can remov... | Removing the swap partition from a LUKS encrypted SSDD |
1,624,309,449,000 |
Why is it considered good practice to zero free space before formatting a luks drive? Do I need to do this even with a brand new usb flash drive that has never been used before?
|
You don't need or want to zero the partition. You want to fill it with random data, so that a hypothetical attacker cannot tell which sectors are used and which are not used. Usually this is done by opening it as a plain cryptsetup volume with a random key and dd-ing /dev/zero onto the volume. (This is very much faste... | Why do you need to clean free space before creating a LUKS partition? |
1,624,309,449,000 |
Is it possible to set up a bootloader that automatically begins shredding the header.img file and then the encrypted partition itself upon X failed attempts at decrypting the partition?
If this does not already exist - is it possible to create any such software without extensive work?
Cheers,
|
Yes (for your own bootloader / initramfs) and No (for a thief who tries to decrypt it from a Live CD and thus circumvents your trap). So the question is, which situation are you trying to cover here...
From a security standpoint it's not a good idea since it doesn't work and the password should be impossible to brutef... | Automatically shred LUKS partition upon X failed decryption attempts? |
1,624,309,449,000 |
I have my hard disk encrypted with LUKS, but I make regular backups to an unencrypted external harddrive. Is there any reason I shouldn't setup LUKS on my backup drive as well?
Obviously, the big thing will be keeping track of the key/passphrase, but I believe I have that in hand. I'm more concerned about obsolescence... |
I'm more concerned about obsolescence of LUKS
What about USB mass storage support? The underlying PATA or SATA disk access? (It's already pretty hard to find motherboards with PATA ports.) How about Linux itself, or USB for that matter?
As frostschutz said, it depends very much on why you are encrypting the main dri... | Any reason not to use LUKS on a backup drive? |
1,624,309,449,000 |
I have an external eSATA-hdd on an OpenSUSE 12.2 system. The external hdd has an LVM on a dm-crypt partition.
I mount it by powering it up and then doing
rescan-scsi-bus.sh
cryptsetup -v luksOpen
vgchange -ay
mount
Now when I want to power the hdd down, I do
umount
vgchange -an extern-1
cryptsetup -v remove /dev/... |
Yes, you can find the information in /sys/block/$DEVICE/slaves. If you only have the canonical name you can use readlink to get the details, e.g:
devdm="$(readlink -f /dev/mapper/extern-1-crypt)"
dm="${devdm#/dev/}"
ls /sys/block/$dm/slaves/
If you want to remove all you can just utilize directly the sys filesystem:
... | Detecting the device of a crypto mount |
1,624,309,449,000 |
In GRUB's project status update, at FOSDEM 2022, they talked about adding detached headers support in GRUB 2.12 (for decryption) :
Add cryptodisk detached headers and key files support, Denis 'GNUtoo' Carikli, Glenn Washburn,Patrick Steinhardt
GRUB 2.12 was released in December 2023, but I couldn't find any mention ... |
Technically, yes. See GRUB Manual on cryptomount.
cryptomount [-H file]
The -H options can be used to supply cryptomount backends with an alternative header file (aka detached header). Not all backends have headers nor support alternative header files (currently only LUKS1 and LUKS2 support them).
In the Grub cons... | Does GRUB 2.12 now support detached headers? |
1,624,309,449,000 |
I had an old, small SSD, so I bought a new, bigger one. Ubuntu 20.04 LTS, LUKS.
With CloneZilla, I cloned it to an IMG file from the old SSD, then restored the IMG file to the new SSD.
Question: Everything is ok, only strange that the "lvextend -l 100%FREE" isn't working, while the "lvextend -L +4.59G" works for the s... |
strange that the "lvextend -l 100%FREE" isn't working
Without the + the 100%FREE is interpreted as absolute size. Which works if you have more free space than the current size of the volume, but it's probably not what you intended to do.
In your case, it seems you have 1176 extents free while the current size of the... | lvextend -l 100%FREE isn't working |
1,624,309,449,000 |
I recently installed Debian 10 on my laptop and for the first time I decided to give file encryption a go.
But I've found something interesting in the /etc/fstab file, and it's that it doesn't use UUID and instead it uses absolute paths.
This is my /etc/fstab:
# <file system> <mount point> <type> <options> <dump> ... |
These absolute device paths are perfectly fine, since their names are stable and prescribed by the first fields in the lines of /etc/crypttab. Actually, they are symlinks to the numbered (thus unstable) device mapper device node names. If /etc/crypttab refers to their source devices (in the second fields) by stable na... | Mount points in /etc/fstab on Debian system for an encrypted partition |
1,624,309,449,000 |
I installed debian stretch using encrypted lvm from the installer on a usb drive.
during installation, with all disks connected, sdo5 is assigned to my boot disk. when running the full system, my boot disk is now assigned sdn5
this is problematic, because I have an encrypted data disk that shows up as sdo1, as per bl... |
Got it.
dmsetup rename sdo5_crypt sdn5_crypt
sed -i -e 's/sdo5_crypt/sdn5_crypt/g' /etc/crypttab
update-initramfs -u -k all
| change designated name of encrypted lvm root? from sdo to sdn in crypttab? |
1,624,309,449,000 |
Say I have a LUKS encrypted USB (full disk). I am looking for a way to hide the fact that it is a LUKS device.
Which strategy would you use to hide the fact that my USB is a LUKS device?
My approach would be to alter the LUKS header to make the LUKS header unrecognizable (and be able to go back easily).
What about exc... |
So, without opening the whole topic of deniable encryption (and the cryptsetup FAQ has a section dedicated to that topic too) and since you're asking to simply hide the LUKS device (if that's sufficient), I'd use the luksHeaderBackup and luksHeaderRestore options from cryptsetup(8).
Example for an already created LUKS... | Can I hide the fact that my USB is LUKS encryted? |
1,624,309,449,000 |
When I try to LUKS encrypt a partition on a CentOS 7 server using the command cryptsetup -y luksFormat /dev/sda4, the attempt fails with the error Cannot format device /dev/sda4 which is still in use. How can I resolve this error and successfully LUKS encrypt the partition?
Here is the terminal record:
[root@localh... |
Is the goal to completely destroy everything on your current /data disk and create a new, entirely empty encrypted volume? Because that's what you're doing with this command. That's what the whole "WARNING: This will overwrite data on /dev/sda4 irrevocably" thing is about. You will lose all the current data, and start... | Cannot format device /dev/sda4 which is still in use |
1,624,309,449,000 |
I want to re-encrypt a system and swap partitions on EndeavourOS. The issue is that in many files (crypttab, mikinicpio, fstab, etc) the exact UUID of the LUKS partition is built in, meaning I would have to change manually the UUID after re-encryption if it this the case for the system and bootloader to recognize the ... |
Looks like it does not:
# lsblk -f /dev/sde2
NAME FSTYPE FSVER LABEL UUID FSAVAIL FSUSE% MOUNTPOINTS
sde2 crypto_LUKS 2 d37a4c03-8ca2-4410-97d8-77bb39d4b499
# cryptsetup reencrypt /dev/sde2
Enter passphrase for key slot 0:
Finished, time 00m01s, 84 MiB... | Does the UUID of a LUKS partition change after re-encryption? |
1,624,309,449,000 |
There are many tips on how to resize (increase) a LUKS2 encrypted device / partition / LVM volume. But how to increase the size of the LUKS container created in the file?
I once created:
dd if=/dev/random of=/some file bs=1M count=100
cryptsetup luksFormat /some-file
cryptsetup luksOpen /some-file some-mount
mkfs.ext4... |
You can just set a new file size with truncate, then cryptsetup resize and resize2fs.
For example, setting it to 200M:
truncate -s 200M cryptfile.img
Alternatively, if you prefer dd or other tools, you can just append another 100M of random data:
head -c 100M /dev/urandom >> cryptfile.img
Warning: if you truncate to... | How to increase the size of a LUKS file-container |
1,615,361,613,000 |
Can cryptsetup be used to open a veracrypt file like crypsetup can open luks? What is the correct process ?
Want to make sure other software can open veracrypt file , command line or gui is fine, as long as it can open a veracrypt file.
Tried:
$ sudo cryptsetup tcryptOpen '/media/path/to/veracrypt/file' stuff
$ s... |
You are probably mistaking LUKS and cryptsetup. LUKS is a disk encryption format/metadata specification and cryptsetup is a tool (and library) for working with encrypted devices. It was first started for LUKS/dm-crypt but it also supports other formats including TrueCrypt/VeraCrypt, BitLocker and loopaes.
To unlock a ... | open veracrypt file with cryptsetup/luks |
1,615,361,613,000 |
I'm benchmarking various cryptsetup volumes and I'm getting unexpected results on Debian.
I'm using numbers from this talk as a rough reference. One of the slides shows benchmark results for various configurations:
My setup is not identical and I'm running all tests in VMs, so I don't expect results to be exactly ide... |
Summary of answer:
cryptsetup format ignores the --integrity-no-journal flag.
Instead, your options are:
At each open, always provide --integrity-no-journal.
At your first open (i.e. when formatting the inner device with a filesystem, or to add the inner device to an MD RAID), provide --persistent --integrity-no-jour... | Cryptsetup with dm-integrity - weird benchmark results |
1,615,361,613,000 |
I have three copies of the same folder but the sizes of these are different. Why?
I have a folder "Documents" that I have copied from an encrypted lvm on the hard drive of my desktop to an encrypted luks partition on an external drive.
I have then copied this folder from the external drive to an encrypted lvm on the h... |
You might have noticed that the difference between the different folders are as follows:
Desktop: 1735750760
- 8192
External drive: 1735742568
+ 4096
Laptop: 1735746664
To my experience, such differences of 4K blocks usually result fro... | Same folder content but different sizes on different drives, why? |
1,615,361,613,000 |
A related question would be: luksOpen doesn't decrypt with keyfile unless --key-file argument is provided
On Ubuntu bionic with cryptsetup 2.0.2 however, I do encounter the following problem:
when opening a luks encrypted device by using a password contained in a file it works well on the direct call:
cat mypass.txt |... |
There is a difference between the two commands, as described in man cryptsetup:
--key-file, -d name
Read the passphrase from file.
If the name given is "-", then the passphrase will be read from stdin. In this case, reading will not stop at newline characters.
That means if you generated your file using echo,... | cryptsetup open for luks : improper handling of --key-file argument |
1,615,361,613,000 |
My / was originally on an encrypted volume and was transferred to an unencrypted volume by recursively copying every directory, and then grub was reinstalled:
sudo -s
cp -ax /mnt/encrypted /mnt/decrypted
for f in sys dev proc ; do mount --bind /$f /mnt/decrypted/$f ; done
chroot /mnt/decrypted
grub-install /mnt/decryp... |
Removing cryptsetup and regenerating initramfs fixed the problem:
apt-get remove --purge cryptsetup
update-initramfs -u -k all
| How to remove LUKS encryption after transferring files to an unencrypted disk |
1,615,361,613,000 |
I was looking at this thread to remove the encryption from the usb stick, but it says that the key cannot be removed if its the last.
How to remove LUKS encryption?
I would simply want the usb stick to be a normal usb stick and not an encrypted one anymore.
Can a simple dd with null work?
I can create luksFormatted us... |
The only easy way to remove LUKS encryption is to back up the data on the storage device and reformat it to an unencrypted state.
dd if=/dev/null of=/dev/sdX bs=8M where X is the location of the USB device should work in your case.
If you prefer a GUI, then gnome-disk-uility (cmdline name = gnome-disks) has the tools ... | how to remove luks encryption from a usb stick |
1,615,361,613,000 |
After reading "man cryptsetup" and many StackExchange questions, I'm confused: Does LUKS use the same master key in each slot?
If I execute the commands below, the displayed master key does not change--i.e., additional master keys are not listed.
cryptsetup luksDump /dev/xvdd1
cryptsetup luksAddKey /dev/xvdd1 --key-... |
Yes, it's the same master key. After all, you only have one copy of your data on disk, which is encrypted one way only, so as far as the data itself is concerned there is only ever one key. If you used different master keys you'd see different "random" data for each key slot, which is not very useful. It's possible to... | LUKS: 1 master key but multiple passwords and key files? |
1,615,361,613,000 |
Q: Is it normal if a RHEL 6.5 machine kernel panics if I type the LUKS password a few times wrong?
|
Yes. The init process, which always had process ID 1, exited. UNIX operating systems panic by design when this happens, because essentally, without init, the system cannot continue to do much of anything useful. (That's not technically quite true, some things can continue, but it's not supposed to happen and it consid... | Kernel panic if LUKS password is bad x times |
1,615,361,613,000 |
First, I'm aware that a similar question has already been answered. The answer was YES, but I'd like a second opinion, because :
The question didn't specify if it was LUKS1 or LUKS2
Something I've read on Wikipedia casts a doubt in my mind.
So, the question is : technically, can a LUKS2 detached header be used for m... |
It can be done but it's a bad idea, security wise, to actually use it for independent devices. The answer you linked covers it very well. So I would only recommend it if the data is related, like backup images or snapshots of one and the same LUKS device. Or perhaps in a deployment scenario where a cryptsetup reencryp... | Can a LUKS2 detached header technically be used for multiple drives? |
1,615,361,613,000 |
A few years ago I used this excellent guide https://www.youtube.com/watch?v=co5V2YmFVEE to encrypt my Thinkpad disk with LUKS and use BTRFS as my file system.
My SSD at that time only had 256GB, now I have updated to 1TB and have used Clonezilla to clone my drive to the new SSD. The only question remains - how can I s... |
So to answer my own question, this is the easiest way to do this (confirmed working - of course always have a backup ready, I had mine on my NAS via Clonezilla):
The name of my device is - cryptroot
Boot up a Live CD/USB (I use Arch so I picked that)
Open the encrypted partition - cryptsetup open /dev/nvme0n1p2 crypt... | Extend BTRFS LUKS partition |
1,615,361,613,000 |
TPMs are supposed to solve a chicken and egg problem of where to store unencrypted disk encryption keys such that someone can't simply pop another hard drive in the machine, boot a different OS and read the keys right off the disk / flash / BIOS / ...
AFAIK TPMs basically do this by checking what software booted and, ... |
Where I'm stuck is figuring out how to ensure there's a solid chain of trust from BIOS firmware to login ensuring that if the OS is tampered with it will either not boot, or the TPM will refuse to hand over the encryption key.
That's built into the process; it's the --tpm-pcrs= option that you give to systemd-crypte... | How must I configure Debian or Ubuntu to ensure there's a chain of trust from TPM to Login? |
1,615,361,613,000 |
If I LUKS encrypted a hard drive using linux machine A, can I read the data on it using machine B? Of course assuming I know the passphrase of the disk. Thanks.
|
Yes, assuming the passphrase you know is a LUKS passphrase in the first place.
LUKS is designed so that the actual master keys that encrypt the blocks are part of the LUKS header and any user key like a passphrase used to unlock the disk simply decrypts a copy of the master keys.
However, if the passphrase is used to ... | read encrypted LUKS hard drive from another machine |
1,615,361,613,000 |
A friend of mine has Debian without systemd running on a disk with full disk encryption (including /boot on the same partition as / using LVM). She is prompted twice for the encryption password when booting: Once by grub, and once by the kernel. Our goal is that she is prompted exactly once.
I have found a this guide ... |
On Debian 11 at least, if you have the cryptsetup-initramfs package installed, its /usr/share/initramfs-tools/hooks/cryptroot script will parse your /etc/crypttab and, if I read the script correctly, will automatically detect if your root filesystem is on an encrypted container that is supposed to be unlocked by a key... | Preventing boot prompting twice for encryption passphrase on Debian based OS |
1,615,361,613,000 |
I had the following setup:
3 HDDs 10Tb of size, in LVM Raid5 configuration
On top a LUKS2 encryption and inside a BTRFS filesystem.
Since my storage got low i added another 16TB HDD (was cheaper than 10TB) added it as physcial volume in LVM, added it to the volume group, ran a resync, so that LVM can adjust the size o... |
I could not find the root cause of this problem, so I decided to ditch LVM in it's entirety and replace it with mdadm - which worked like charm on the first try.
Creating mdadm RAID5 (initially with 3 disks)
Creating with three disks (henceworth raid-devices = 3):
mdadm --create mediaraid --level=raid5 --raid-device... | LVM, LUKS2 & BTRFS Problem |
1,615,361,613,000 |
I tried everything I was able to find online. Hours of research since yesterday ;(
I found no one struggling with the errors I'm facing, except from GitLab (error code -1 instead of -4 I'm getting), Reddit or this mailing list from 2006.
I might give unnecessary details, sorry!
I have this 5 TB WD drive where I alread... |
This is a problem with the device size of your partition.
Your partition is an odd number of 512-byte sectors large (9767473119 sectors as shown by fdisk). Your LUKS header is set to use 4096-byte sectors (sector: 4096 [bytes] shown by cryptsetup luksDump). So that leaves 7 sectors on the partition that can not be use... | (Probably) Corrupted LUKS Header, Restoring Header does not work |
1,615,361,613,000 |
On linux mint and fedora, when you first boot a LUKS encrypted system, instead of a command line passphrase entering section, it has kind of a GUI that looks better than the default command line on Debian. I noticed that on Debian you can press escape and it will change to a similar type of menu. Is there any way to s... |
The proper terminology is "flicker-free boot", it was implemented in Fedora about 2-3 years ago (here announcement on the hacker news - https://news.ycombinator.com/item?id=18123984), so it's still relatively new, and many distributions are lacking proper support.
When it comes to Debian, I couldn't find much informat... | How to set LUKS loading screen Debian |
1,615,361,613,000 |
I had a LUKS partition for which cryptsetup luksDump /dev/mydisk gave (excerpt)
Digests:
0: pbkdf2
Hash: sha256
Iterations: 176646
Salt: xx xx ...
...
Running cryptsetup reencrypt /dev/mydisk while the container was offline removed the previous digest after it was done (understandably), ... |
This appears to be a bug in cryptsetup. I've filed a report here: https://gitlab.com/cryptsetup/cryptsetup/-/issues/606.
| `cryptsetup reencrypt` seems to cripple digest iteration count |
1,615,361,613,000 |
I have backed up a drive with all its partitions using the command
dd if=/dev/sda of=/media/oshirowanen/external-drive/backups-2019/full_drive_backup.img
/dev/sda is an ssd which has a Linux OS with full encryption.
Before I wipe this drive and re-purpose it, I want to make sure the backup has worked.
I have tried t... |
Judging from the image, the partition seems to be a physical volume. This is verified by pvscan.
lvs lists two logical volumes, one of them a swap partition (LV swap_1) it seems, and the other the actual file system (LV root). This is the relevant one, to be mounted by
mount -o ro /dev/mapper/ubuntu--vg-root /mnt/img5... | Mounting a Luks partition |
1,615,361,613,000 |
How do we unlock multiple disks with one password prompt at CentOS-7 bootup? In Debian, I can do it using decrypt_keyctl & initramfs in /etc/crypttab (which I see is described here).
Right now, I'm using Nethserver, and crypttab looks like:
luks_root UUID=<uuid1> none
luks_swap UUID=<uuid2> none
How do I add... |
It turns out the answer is actually Method1 in this answer. It applies to both Ubuntu and CentOS. Quoting:
Systemd ... will unlock all additional LUKS partitions if
all of the partitions you want to unlock use the same password
you enter the password for the root partition correctly the first time. If you get it w... | Multiple LUKS Disks @Boot with One Password Prompt (CentOS) |
1,615,361,613,000 |
I have several servers each with at least six dm-crypt partitions. I would like to have an automated way to make sure I always have a luks header backup stored in a safe place. I've been making header backups manually until now. My problem with that is that I tend to forget to make a new luks header backup when I have... |
cd /path/to/backup/
lsblk --fs --output FSTYPE,UUID | grep crypto_LUKS | tr -s ' ' | cut -d ' ' -f2 | \
while read uuid; do
mntpoint=$(lsblk /dev/disk/by-uuid/$uuid --output MOUNTPOINT | sed 1,1d | head -n 1)
name="${mntpoint}_luksHeader_$uuid.img"
if [[ ! -e "$name" ]]; then
cryptsetup luks... | script to automate luksHeaderBackup for multiple partitions |
1,615,361,613,000 |
I already did some research on my question (see below), and it's as good as a 'done deal' but I would still like to put forward my problem to this knowledgeable community.
Short version of the issue: in partman (the disk partitioner of the Debian installer) the passphrase of a previously dm-crypt/LUKS encrypted volume... |
There is no way to recover whatsoever. (*)
With LUKS, the passphrase you use to open the encryption, and the master key actually used for the encryption, are completely unrelated to one another.
Basically your passphrase decrypts a completely random key, and this random key is stored in the LUKS header. Losing the LUK... | The password of previously encrypted volume got changed by the Debian installer |
1,615,361,613,000 |
I'd like to use dm-crypt with btrfs, because of the bitrot protection of this filesystem. What I am worrying about that the RADI1 is on the filesystem level above the dm-crypt, so if I write a file, it will be encrypted twice.
HDD.x ⇄ dm-crypt.x ↰
btrfs-raid1 ⇒ btrfs
HDD.y ⇄ dm-crypt.y ↲
Is there ... |
With BTRFS there is currently not such an option directly integrated. There has been talk in the past on the BTRFS mailing list about adding support for the VFS Encryption API (the same thing used by ext4 and F2FS for their transparent file encryption), but that appears to never have gone anywhere.
At the moment the ... | How to dm-crypt the data only once by filesystem level RAID? |
1,615,361,613,000 |
I am running an Ubuntu 16.04 system with the following hard disk configuration:
1 hard drive which I will call /dev/sda. /dev/sda has 3 partitions used for the following purposes:
/dev/sda1 is used for the EFI system partition.
/dev/sda2 is used for the /boot partition.
/dev/sda3 is used to store an encrypted volum... |
Okay, I figured it out and I got it working. I spent some time studying the initramfs cryptsetup scripts under /usr/share/initramfs-tools/hooks. This directory contains scripts that are run whenever update-initramfs is executed. In particular, if cryptsetup is installed, there will be a cryptroot script in this direct... | I want multiple prompts to decrypt multiple hard disks which contain root filesystem |
1,615,361,613,000 |
I'm not able to boot a freshly installed Arch Linux system with its root file system residing on a LVM thinly provisioned logical volume on a LUKS encrypted partition on a GUID partitioned device.
When Systemd's boot loader systemd-boot loads my boot entry Arch Linux it asks me for the passphrase of the LUKS encrypted... |
It looks like that the hook lvm2 run after the hook encrypt during Arch Linux's Initial RAM filesystem phase is not able to activate thinly provisioned logical volumes.
With the same storage configuration as depicted in my question except for normal logical volumes instead of thinly provisioned ones the volume group c... | How to install Arch Linux root file system on LVM thin LVs on LUKS on GUID partitioned device? |
1,615,361,613,000 |
I would like to convert my raid6 mdadm into encrypted LUKS. Right now raid6 consists of "/dev/sdX1" which are raid partitions. /dev/md0 doesn't have a partition - it is pure ext4 FS.
Is it safe to reencrypt (cryptsetup-reencrypt /dev/md0)? Will LUKS add some specific header which could cause data loss/FS corrupt? Or i... |
A volume is called a "LUKS volume" because it has a LUKS header. Thus if you convert a non-LUKS volume into a LUKS volume then you do get an additional header and do lose data space.
The LUKS header can be on a differenct device (--header) but I do not know whether cryptsetup-reencrypt supports that. But most probably... | Is it safe to reencrypt unencrypted mdadm array with LUKS? |
1,615,361,613,000 |
What I am trying to do
Create an encrypted arch linux setup using LUKS. Bootloader must be on USB.
QUESTION
Does the speed of USB-device matter? Does the system contiously use the bootloader to decrypt or is this done only at boot? If not - I take it it can be a slow process depending on the size of the harddrive. Wil... |
Does the speed of USB-device matter?
It matters for the boot process itself. It has to load the bootloader, kernel and initramfs from USB, which can be several MB altogether, so it can make a difference of a few seconds.
Does the system contiously use the bootloader to decrypt
No. Usually you can pull the USB devi... | Does the speed of a USB bootloader matter? |
1,615,361,613,000 |
I created a new partition that I would like to encrypt with LUKS. The device is a 1GB partition with ID 83 (Linux). I've changed the owner to root, and chmod to 777. The command I'm using is :
cryptsetup luksFormat /dev/sda2p2
When prompted, I reply the capital YES, then receive this error:
cannot open device /d... |
Whatever you did to create /dev/sda2p2, it didn't do what you intended. You created a regular file in memory. In Linux's disk and partition naming convention, /dev/sda is a disk, /dev/sda2 is a partition on that disk.
From the parted output, you currently have three partitions on that disk: a ~300MB partitionwhich is ... | cryptsetup luksFormat - cannot open device for read-only access |
1,615,361,613,000 |
I've been recently dealing with an LVM + LUKS partition trying to install a new linux (ubuntu in this case).
I tried a few different options to make it work, but the pc resisted, the only system I could make work was the 32bit version of ubuntu 12.04.
After succeeding with this (discarding all the twists to make the ... |
LVM/LUKS should not be architecture-dependant whatsoever, same goes for most filesystems. So a multiboot scenario where you have both 32bit and 64bit Linux installed and they share the same VG or access each others partitions, should be entirely possible.
You'll find the most dependencies in terms of software versions... | LVM + LUKS partition - Is this architecture dependent or independent? |
1,615,361,613,000 |
Let's say I have a LUKS-formatted partition, and it's secured using the passphrase "test123". Can I migrate this partition to a key-based mechanism, without loss of data?
|
Yes, you can. LUKS allows you to have multiple keys, so you can add/modify/remove keys as you need. The actual key which is used to access the data is internal and hidden. There is no difference between a plain passphrase, a key in a file or derived keys.
You can add a new passphrase for example with
cryptsetup luksAd... | Can I migrate a LUKS partition from a passphrase to a keyfile? |
1,615,361,613,000 |
At installation I forgot to create a logical volume group in LUKS container. I won't reinstall the system. So how do I create LVG in LUKS container without data loss?
My plan is:
Install lvm2 package
Backup / using rsync to another drive
Create logical volumes I need, for example VolumeGroup/root, VolumeGroup/home ... |
It should work.
The archlinux mkinitcpio hook is lvm2, not lvm. Add this hook first. No harm done if no LVM is present yet. One less thing to worry about later.
Backups from a running system can be inconsistent. With --exclude or -x, it can be incomplete. Consider using bind mounts, or do it from a Live/Rescue environ... | Moving from plain LUKS to LVM on LUKS |
1,615,361,613,000 |
The problem
I cannot cryptsetup close any LUKS volume while any flatpak app is running in the background. Yes, the flatpak app just has to be running in the background, I'm not trying to use cryptsetup from within the sandbox or anything like that. Yes, this is one of those issues.
Steps to reproduce
mkdir ~/mnt
dd if... |
Thank you to @A.B for helping me figure this out! I want this answer to be useful to others in the future, so I'll try to give a really thorough explanation. Here goes!
Introduction
Namespaces are a Linux feature that allows isolation between processes. There are different types of namespaces for isolating different t... | Cannot close LUKS volume while any flatpak app is running |
1,615,361,613,000 |
If I create an encrypted partition using cryptsetup
cryptsetup -q luksFormat /dev/vdb3 /tmp/pwfile
cryptsetup -d /tmp/pwfile luksOpen /dev/vdb3 pv00
and setup a nested gpt partition table on /dev/mapper/pv00
parted=/sbin/parted
disk=/dev/mapper/pv00
${parted} -s -- "${disk}" mklabel gpt
${parted} -s -- "${disk}" mkpa... |
You can use kpartx. Create the partition mappings with kpartx -a /dev/mapper/pv00 and remove them with kpartx -d /dev/mapper/pv00. Otherwise you could only manually remove them with dmsetup remove pv00p{1,2,3,4}.
Why is this a problem anyway?
The kernel (device mapper, crypsetup/LUKS, LVM, ...) does not support nested... | how to close encrypted partition with nested partition table? |
1,615,361,613,000 |
I've been a Linux user for about 15 years. Since the feature existed, I used LUKS to encrypt the partitions on which I was installing Ubuntu.
I have the following issue: when someone else uses my computer, I have to be there to boot it, because only I should know the decryption secret phrase.
To solve this problem, I ... |
Prepare a partition for /boot/efi and a partition for /boot in gparted
|------+-------------+-----------+------+-------+-----------|
| Name | Mount point | Flag | Size | FS | Comment |
|------+-------------+-----------+------+-------+-----------|
| sda1 | /boot/efi | esp, boot | 300M | FAT32 ... | How to install two GNU/Linux in dual boot with one under LUKS and the other not? |
1,651,838,414,000 |
Once the /boot partition is half-full with a single kernel you can't upgrade,
Resizing is painful when the other partition is encrypted,
Solution: Move /boot to the encrypted partition.
Backstory:
Linux Mint 17 upgraded to 20 won't allow the latest kernel to be installed; that was my dilemma. There's much written on r... |
Credit largely belongs to Guilhem Moulin, I merely simplify. Superuser will be required repeatedly and you may prefer to run command su for a root shell (alternatively, proceed commands with sudo where necessary).
Encrypted partition: /dev/sda5
Running fdisk -l lists partitions, e.g.,
Device Boot Start End ... | Boot partition full: Move to encrypted partition |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.