date int64 1,220B 1,719B | question_description stringlengths 28 29.9k | accepted_answer stringlengths 12 26.4k | question_title stringlengths 14 159 |
|---|---|---|---|
1,526,978,710,000 |
I am planning to replace two soft RAID1 disks (2TB) with two identical (4TB disks). The current disks are configured with soft RAID 1 running debian 11. The disks are not root.
My plan is to replace (hot swap is supported) one 2TB disk with a new 4TB disk and wait for the disks to sync with mdadm (I'm not even sure ho... |
All your /media/* mounts seem to use the disk->part->raid1->crypt layering.
Note that if your existing 2 TB disks are partitioned in MBR style, you can't really do that with the new larger disks, as you'll be hitting the MBR maximum capacity limit. Fortunately, Linux software RAID does not require you to have the same... | Replacing soft RAID1 LUKS disks with larger ones |
1,526,978,710,000 |
I have this line in /etc/crypttab for my swap partition:
luks-4205519b-f3fe-468f-b05e-44f25f6882a4 UUID=4205519b-f3fe-468f-b05e-44f25f6882a4 /crypto_keyfile.bin luks,keyscript=/bin/cat
I commented it out so it now looks like this:
# luks-4205519b-f3fe-468f-b05e-44f25f6882a4 UUID=4205519b-f3fe-468f-b05e-44f25f6882... |
You need to update your initramfs; there’s a copy of crypttab there.
On Debian derivatives, run
sudo update-initramfs -u
| Why does the swap mapper file get created even though I removed it from /etc/crypttab? |
1,526,978,710,000 |
Working on creating a systemD service to retrieve a key file from a remote SSH server and then use it to auto mount an encrypted Luks disk on a server(not the root drive).
[Unit]
Description=Open encrypted data volume
After=network-online.target
Wants=network-online.target
StopWhenUnneeded=true
[Service]
Type=oneshot... |
The behaviour is mostly likely due to the StopWhenUnneeded=true setting in the unit section. As per the manpage, the definition of unneeded is this:
StopWhenUnneeded=
Takes a boolean argument. If true, this unit will be stopped when it
is no longer used. Note that, in order to minimize the work to be
executed, system... | Systemd to ExecStart always executing? |
1,526,978,710,000 |
I recently installed a fresh Ubuntu 20.04 image on my laptop while doing so i chose a full disk encrpytion using a password. (I think it is LUKS but I do not know how to verify this).
For some reason I can not decrypt the disk in the standard "decrypt screen" (I believe it is because of the keyboard layout which I cho... |
You can open and map the device with:
cryptsetup --verbose luksOpen /dev/sda1 SECRET
Where /dev/sda1 is your device and SECRET is the mapping
If you succeed to unlock your device, you need to mount it:
sudo mount /dev/mapper/SECRET /mnt
Maybe it would be more comfortable to plug in a live USB and try opening the dev... | Decrypting a full disk LUKS encryption manually from initramfs |
1,526,978,710,000 |
I need to resize LVM on LUKS on Debian to take space from home and give it to var.
└─sda5 8:5 0 931G 0 part
└─sda5_crypt 253:0 0 931G 0 crypt
├─my-vg-root 253:1 0 23.3G 0 lvm /
├─my-vg-var 253:2 0 9.3G 0 lvm /var
├─my-vg-swap_1 253:3 0 976M 0 lvm... |
You don't need to resize the LVM physical volume or the LUKS device or the partition, if everything you want is to "move" some space from the /home logical volume to /var logical volume, you'll be working only on the logical volume level.
Your steps will be (from a LiveCD, you'll need to unlock the encrypted drive fir... | Moving Gigs on LVM-on-Luks from one partition to another |
1,526,978,710,000 |
I've setup a server with luks devices (not used for root partition), they are listed in /etc/crypttab this way
# <target name> <source device> <key file> <options>
luks_device_1 /dev/mapper/vg-lv_1 none luks
...
I've also setup a tang server and bound the devices to tang using the command
clevis luk... |
Actually, according the manpage clevis-luks-unlockers(7) having the option _netdev in /etc/crypttab is necessary to trigger the automatic unlocking.
After a reboot, Clevis will attempt to unlock all _netdev devices listed in /etc/crypttab when systemd prompts for their
passwords. This implies that systemd suppo... | tang / clevis: automatic unlocking for luks device not triggered unless defined as _netdev |
1,526,978,710,000 |
I've created a unit file to mount the /srv partition automatically. It will check first if /dev/mapper/srv exists and then start it. I'd like to take it one step further and only let it be able to start if /dev/mapper/srv is a LUKS encrypted block device, with the ConditionPathIsEncrypted option. But I get the warning... |
ConditionPathIsEncrypted= only exists in versions v264-rc1 and newer.
If you want to look what conditions the version you are using supports, i would suggest you take a look at the 'systemd.unit' manpage.
man systemd.unit
There is a section with 'Conditions and Asserts' - the systemd version shipping with Ubuntu 20.0... | ConditionPathIsEncrypted not supported? |
1,526,978,710,000 |
So I am trying to install Arch Linux with separate root and home partitions (also swap and boot ofc). Basically I've partitioned them, I've mounted them, and I've encrypted / and /home (using cryptsetup luksFormat). It looks like this under lsblk:
(sorry, cannot copy the text from the virtual machine at this stage)
N... |
Welcome to the Unix & Linux StackExchange!
The job of the initramfs file generated by mkinitcpio is only to unlock and mount the root filesystem; mounting other filesystems like /home will happen a bit later in the boot process, after the root filesystem is unlocked and mounted. GRUB does not need to know anything abo... | Encrypt separate root and home partitions |
1,526,978,710,000 |
I have an encrypted external disk on a linux server.
On the server, I can do this locally to decrypt
cryptsetup -d keyfile luksOpen /dev/sdx1 /mnt/decrypted
but I prefer to avoid doing that on the server side.
I want to access the server (via ssh/sshfs) and only decrypt the data remotely on my client machine.
To acces... |
I can mount and decrypt luks remotely (via sshfs) if I use a luks container (and not a luks partition) to hold the encrypted data.
I just had to create a luks container (a file that holds internally the encrypted filesystem), this file is a normal file on a mounted partition so it can be mounted remotely via sshfs an... | mount crypto_LUKS partition without decrypting (locally) |
1,526,978,710,000 |
I wanted to create bootable usb (dd bs=4M if=input.iso of=/dev/sdc) but sdc is my hard disk with two partitions: 1 simply ext4 and 2 encrypted LUKS. After this action I got Windows installed on my hard disk.
How to recover encrypted partition after run dd comand?
|
It depends whether you have overwritten the beginning of the encrypted partition. The beginning of the encrypted partition is where the key is stored¹. If you've lost that, the data is undecipherable, and the only solution is to restore from a backup.
If you only overwrote the first 4MB of the disk, and if the non-enc... | How to recover encrypted partition after dd command [closed] |
1,526,978,710,000 |
A FIDO2 security token should be used for decrypting all disks in a linux machine at boot. systemd allows this since version 248.
Can the FIDO2 Security Token be removed after boot when using LUKS for full disk encryption, or does it need to remain plugged in for the disk to be usable for read/write operations?
|
Accessing an external FIDO2 token on every disk operation would make an encrypted disk device very slow, to the point of being practically unusable.
With LUKS, any password, FIDO2 token or other means of unlocking the encryption is used to decrypt an encrypted master key from one of the keyslots in the LUKS header. Th... | Can a FIDO2 Security Token be removed after unlocking a LUKS volume at boot? |
1,526,978,710,000 |
I'm trying to automatize fdisk with my Bash scripts. In my script, I have the following code block:
echo "Creating root filesystem partition..."
(
echo n
echo 3
echo
echo
echo w
) | fdisk ${DEVICE}
Where the DEVICE is physical disks like /dev/sda /dev/nvme0n1 etc. but not partitions.
However, if the d... |
So far echoing options to fdisk from standard input/output seems very hardcoded approach, by suggestion of @phuclv using sgdisk is very versatile way automatize your partitioning.
For example, I changed the those lines in my main post to sgdisk based lines, it's very efficent way for that:
# Create a GPT on the disk:
... | Scripting fdisk with filesystem signature issues |
1,526,978,710,000 |
I've read that hibernation often causes trouble in Linux environments, e.g. system fails to wake-up or freezes and sometimes even refuses booting after reset. I really like the idea of hibernating the system into a zero-power state, especially for traveling. But I don't wanna hurt my system's stability. So I'm wonderi... |
Try it (when you have all files saved).
The problem is that not all hardware is (fully) supported, or Ubuntu doesn't know much about some devices (if it is save to switch them off). There are two main classes of problems: not all devices can be set to hibernation (e.g. often some external devices, and Ubuntu doesn't k... | Is it risky to use hibernation in Ubuntu? |
1,526,978,710,000 |
I'm using EndeavorOS (basically Arch), but with systemd-boot and dracut for initrd. I have a simple setup with an unencrypted boot partition and LUKS-encrypted root and swap partitions. Specifically, the setup is described in the output below:
$ cat /etc/fstab
# <file system> <mount point> <type> <option... |
Not an Arch expert, the Debian-centic script works well for me on Debian, but according to this Archwiki page should, or at least is expected to work.
Passwords entered during boot are cached in the kernel keyring by systemd-cryptsetup(8), so if multiple devices can be unlocked with the same password (this includes d... | How to open all LUKS volumes with use of a single password? |
1,526,978,710,000 |
I know that by configuring crypttab I can automatically unlock LUKS drives by using keyfile stored on another drive in the machine which has been manually unlocked in advance. I have been wondering if a keyfile stored in a different machine/device can also be used, accessed e.g. over ssh.
Here is what I would like to ... |
This is actually possible with LUKS 2 and cryptsetup-ssh. You can simply add the SSH token with
cryptsetup-ssh add --ssh-keypath=<path> --ssh-path=<path> --ssh-server=<ip/url> --ssh-user=<username> <device>
Where
ssh-keypath is a path to SSH key to use to connect to the server,
ssh-server is IP address or URL of the... | Unlock luks by other device |
1,526,978,710,000 |
I have a Debian 11 installation with the following partition layout:
path
format
mount point
/dev/nvme0n1p7
ext4 (no encryption)
/boot (Debian 11)
/dev/nvme0n1p8
dm-crypt LUKS2
LVM2 (named vg_main)
/dev/mapper/vg_main-lv_swap
swap
-
/dev/mapper/vg_main-lv_debian
ext4
/ (Debian 11)
/dev/mapper/vg_main-l... |
You might want to set up a ubuntu-kexec.target which would be essentially a stripped-down version of multi-user.target, with basically:
[Unit]
Description=Kexec an Ubuntu kernel from within an encrypted partition
Requires=basic.target #You might get by with just sysinit.target here
Conflicts=rescue.service rescue.t... | How to chainload another kernel with kexec inside a LUKS2 + LVM2 partition? |
1,526,978,710,000 |
I have an Ubuntu machine that has been through several kernel upgrades. At the start of the day, I had 3 kernels installed: 5.11.0-34, 5.11.0-46, and 5.11.0-49. I had to upgrade a bunch of packages, and afterward took the opportunity to remove the middle kernel to open up room in my boot partition.
Now, I cannot get e... |
Something got borked somewhere and I had to run update-initramfs. I found very similar instructions in three separate places:
https://ubuntuforums.org/showthread.php?t=2409754&s=e1f324bf5e566b3bb93374cd07bdcc17&p=13828993
https://askubuntu.com/a/868726/538768
https://feeding.cloud.geek.nz/posts/recovering-from-unboot... | How do I get Linux to find the root filesystem on an encrypted partition? |
1,526,978,710,000 |
The commands I invoke are the following
Create image file
dd if=/dev/zero of=benj.luks bs=1k count=666000
Set up LUKS container
cryptsetup luksFormat benj.luks
Set up loop device and open the LUKS container
cryptsetup luksOpen benj.luks benjImage
Check that the loop device has been set up and mapped
lsblk
... |
cat /sys/block/loop0/queue/physical_block_size
cat /sys/block/loop0/queue/logical_block_size
revealed, that the loop device was mounted as a 4096 bytes block device on which no 2048 byte file system can be created.
hence the solution is to set up the loop device manually and define the sector size at 2048 by utilisin... | Why can mkfs.ext4 not create a 2048 block size file system on 650 MB image file? |
1,526,978,710,000 |
I have data on a disk that I want to encrypt by cloning the full filesystem of that disk (source) to a virtual block device (devicemapper/cryptsetup) based on an additional disk (target) of identical capacity. I have already setup the LUKS device on the target disk.
The source disk has been initialized as partitionles... |
My question now is: can I safely assume that the free blocks from the resize2fs operation are located at the end of the physical device
Yes, that's the assumption you'd need to make even if it was a partition and you were going to shrink it.
and thus pass count=<newsize> bs=4096 as argument to dd?
Well, probably.
... | Shrink partitionless filesystem |
1,526,978,710,000 |
I have successfully removed the second slot(is 1, because luks slots start from 0)
from an encrypted device.
$> echo mypass | cryptsetup luksKillSlot /dev/loop0 1
Now I have this situation
$> cryptsetup luksDump /dev/loop0 |grep -iw luks2
0: luks2
2: luks2
The question is: is possible to rename 2: luks2 to 1: l... |
The 2 is key slot ID so it's not possible to "rename" it -- the second key is in slot 2 and the slot 1 is still there just empty (because you wiped it with kill slot). (You always have 8 slots (with LUKS 1, with LUKS 2 you can have up to 32 slots), some of them unused and some of them with keys, luksKillSlot just wipe... | Is possible to rename a luks slot? |
1,526,978,710,000 |
I am currently trying to solve a forensic file hunt training question.
There were hints given, that there is a LUKS container and that we need to find the LUKS header in order to go on with the next training question.
From the information given along with the question, the header can be identified with this magic numb... |
Is there a "smart" way to search for a specific file header?
Basically you are searching for a specific bytestring, so it would best to search the binary data directly instead of xxd output, which can produce false negatives (as well as potential false positives), i.e with:
grep -oba "$(printf '\x4c\x55\x4b\x53\xba\... | Search full device for magic number as hex |
1,526,978,710,000 |
The problem
I erroneously removed several files from my /home/username with rm. I realized the mistake as soon as I hit enter, but the damage was done.
I immediately created a full disk image with sudo dd if=/dev/sda of=/media/username/external_drive/image.iso and copied it to another PC and prepared to follow a very ... |
I managed to restore many, maybe all, of the files I lost with photorec. I read about it in a forum page I can't find anymore and thought "let's just give it a try to this other tool as well".
I ran
$ sudo kpartx -a -v image.iso # map the disk image partitions
add map loop0p1 (254:0): 0 997376 linear 7:0 2048
add map ... | Restore files removed with rm (even from a LUKS-encrypted disk) |
1,526,978,710,000 |
I have an Arch linux running windows 10 disk-based VMs. The disk is on a different volume group and is luks encrypted. I have a logical volume for each VM with ext4 file system. I manually edited the fstab with the correct UUIDs and I set the type to ext4. Before I installed windows on the VMs I rebooted to make sure ... |
If you use a logical volume as a backing storage for virtual machines, the LV will be used "directly" as disk for the VM -- the ext4 filesystem you created was overwritten by the Windows installation so you can no longer mount it, because instead of ext4 your /dev/mapper/volgroup0-lv_disk0 LV now contains a partition ... | KVM disk-based VM on a luks-encrypted disk |
1,526,978,710,000 |
I have an external NVMe disk that was in my old laptop which is encrypted with LUKS. I need to mount that disk and extract some data out of it so this is what I have tried
fdisk -l
/dev/sdc3 2549760 2000408575 1997858816 952.7G Linux filesystem
udisksctl unlock -b /dev/sdc3
Unlocked /dev/sdc3 as /dev/dm-1.
So fa... |
You have an LVM setup so after unlocking the LUKS device you need to mount the root logical volume and not the unlocked device itself. In your case the logical volumes were not auto-activated because lvmetad is not running, you can activate them (= tell the system to actually create the logical volume block devices) u... | Mount LUKS encrypted drive |
1,526,978,710,000 |
I have a LUKS encrypted disk. It has 3 keyslots, and I know the pass phases for two of them.
How do I determine which keyslots I know the pass phrases for?
|
Simple way would be to use --debug when unlocking the device, it prints which keyslot it tries to use, so with two passphrases you need just two runs of luksOpen to see which keyslot which passphrase "belongs" to.
Example where I provided password for third keyslot:
$ sudo cryptsetup open /dev/sde a --debug
...
# Tryi... | LUKS: Determine which keyslots match which pass phrase |
1,526,978,710,000 |
I made a full encryption setup of Ubuntu 20.04 LTS according to this article. Due to it is highly recommended to add further passphrases to avoid loosing all data due to unavailability of the initial passphrase, I did so, by adding several passphrases using cryptsetup luksAddKey /dev/sda1 command. To be fully sure, th... |
It seems that actually all passphrases work as they should. BUT the point was that response time from the first (initial) passphrase (about 5-7 sec) is significantly lower than the one from the rest of passphrases from the list. The most amusing thing here is that for all passphrases starting from the second one, the ... | Only first slot password is valid during decryption of boot device while all others are valid while testing to open a device |
1,526,978,710,000 |
I have a laptop that dual boots Arch and Windows 10. My boot select is set to a GRUB screen where I'm given a few seconds to change my selection (default is Arch) until it boots to a LUKS unlock screen. Often times I'll leave the laptop on my Windows partition and it'll decide to reboot, causing GRUB to select the Arc... |
Probably should have looked harder before asking :-)
This is what I did:
Backed up /boot/grub/grub.cfg
Edited the timeout to 15 seconds from 5 to give me enough time
Added a menu entry at the top (before Arch Linux) with the setting:
menuentry "Shutdown" {
halt
}
Saved grub.cfg
Now whenever the computer boots I ... | Option to automatically shutdown at GRUB without user input? |
1,526,978,710,000 |
I have a Raspberry Pi with attached, via USB, HDD drive inside Orico chassis with a separate power source. I encrypted this drive with the command:
cryptsetup luksFormat /dev/sda
Then, I created key file with command:
dd if=/dev/random bs=32 count=1 of=/home/ubuntu/luks/luks.key
added this file as second key with co... |
You need to specify the key file in /etc/crypttab, if you put none there, it will be interpreted as "ask for passphrase".
From man crypttab:
The third field specifies the encryption password. If the field is not present or the password is set to "none" or "-", the password has to be manually entered during system boo... | LUKS auto decryption with key file fails, please help me debug |
1,526,978,710,000 |
I want to use rsync for creating complete, bootable backups of a LUKS-encrypted Linux disk. Does it support hot-transferring of files, i.e. can I use rsync from a running (idling) system with opened files, processes etc.?
|
Yes.
There is rarely exclusive file locking as there is on Windows systems. The up side of this is that it's easy to copy files that are open by other processes - even files that are being written. The down side is that it's easy to copy files that are open by other processes and that are being written.
rsync does not... | Does rsync support hot transfer while the system is running? |
1,526,978,710,000 |
I have looked at how to be able to imbue in a crypttab stanza (referring to a LUKS device) to allow a specific user or any unprivileged user to map it. Roughly, I am looking for the equivalent of user in the mount options in /etc/fstab when mapping the LUKS device (i.e. before mounting it).
The only (half way sensible... |
As far as I know there is nothing like that in SystemD.
You could use
sudo
udisksctl unlock with a PolKit configuration for certain users or groups
| How can I achieve being able to run cryptdisks_start as normal user? |
1,526,978,710,000 |
I have read
`cryptsetup luksOpen <device> <name>` fails to set up the specified name mapping
https://www.saout.de/pipermail/dm-crypt/2014-August/004272.html
And tried
cryptsetup open --type luks <device> <dmname> --key-file /root/luks.key
still getting error 22
cryptsetup luksFormat <device> --key-file /root/luks.... |
It's a naming conflict, I already have /dev/mapper/data due to the previous testing, so have to test it with another name.
cryptsetup open --type luks /dev/data new_name # 1st time sucess
cryptsetup open --type luks /dev/data new_name # 2nd time fail
| cryptsetup failed with code 22 invalid argument |
1,526,978,710,000 |
On the Fedora wiki it is mentioned that LUKS offers this protection.
LUKS does provide passphrase strengthening but it is still a good idea to choose a good (meaning "difficult to guess") passphrase.
What is it exactly and how is it accomplished?
|
A similar phrase appears in other places (e.g., this Red Hat 5 page), where a bit more detail is given:
LUKS provides passphrase strengthening.
This protects against dictionary attacks.
Just from that I would expect it to mean that the password is being salted and probably has other improvements applied to the ... | In regards to dm-crypt with LUKS, what is meant by "passphrase strengthening"? |
1,592,658,112,000 |
I have an external backup hard drive that is encrypted using LUKS. As I was re-organising my backups, I copied the data to another encrypted drive and did a kind of "quick wipe" on the original drive by replacing the key in the key slot with random data.
Goal was to use the drive afterwards as a second backup, but at ... |
The problem is the content of the key slot. In order to access the data you need the master key. The people having one of the slot keys may not be supposed to know the master key (because then you could not lock somebody out without reencrypting all the data).
Thus a new key is given (password or file), turned into a ... | LUKS: find a deleted key(slot) |
1,592,658,112,000 |
I have two disks as RAID-1 encrypted via LUKS:
# blkid
...
/dev/md0: UUID="x-x-x-x-x" TYPE="crypto_LUKS"
Accidently I executed cryptsetup luksFormat /dev/md0 instead of cryptsetup luksOpen /dev/md0 secure. luksFormat returned WARNING: Device /dev/md0 already contains a 'crypto_LUKS' superblock signature.
Now I cant u... |
From man cryptsetup (section luksFormat):
WARNING: Doing a luksFormat on an existing LUKS container will make all data of the old container permanently irretrievable, unless you have a header backup.
I guess you don't have a header backup and therefore your data will be history.
Sorry for the bad news.
Neverthel... | Accidentally executed luksFormat instead of luksOpen |
1,592,658,112,000 |
I have tried different guides and tutorials to enlarge an encrypted LUKS LVM partition, but I am unable to move forward and finish the process as I don't have complete clarity over the structure of the volumes/partitions. This is a Debian 10 on a VirtualBox VM, I have properly enlarged the virtual disk by approx 10GB,... |
I actually figured out the issue.
The procedure I was following was correct, I was just missing one tiny step:
pvchange -x y /dev/mapper/encryptedvolume
I recommend to follow the instructions in the question #320957 on Unix & Linux Stack Exchange, where I found the above step in the second comment of the accepted ans... | Unable to enlarge/resize LUKS partition on virtual disk |
1,592,658,112,000 |
I have an old laptop with Windows 7 on which I installed CentOS 8 on dual boot.
Upon first reboot, GRUB showed only entries for Linux. Therefore I used Boot-Repair-Disk, but it somehow failed to install GRUB, as now the laptop boots into Windows directly.
Disk partitions are as follows (as seen by Boot-Repair-Disk):
P... |
I can not explain why Boot-Repair-Disk reports an error with the partition table, nor why Windows thinks that /dev/sda4 is a primary partition. The output of fdisk reports no errors with the MBR partition table, and is also able to read the extended partition table in /dev/sda5.
So, all we have to do is:
recover acce... | Unable to install GRUB on dual boot Windows / CentOS 8 (LVM+LUKS) |
1,592,658,112,000 |
I want to change one of my partitions from ext4 to something else (xfs or openzfs), the partition is sdc5_crypt and is mounted at startup. My intuition says that I can format it with something like zpool create sdc_pool sdc5_crypt without any impact into the LUKS encryption, so that it will still be mounted normally a... |
Any operations on sdc5_crypt will not harm your LUKS configuration. You can treat it like a normal drive. So yes, you should be able to use that command to reformat your partition.
| Change partition without affecting LUKS encryption |
1,592,658,112,000 |
I have an encrypted LUKS partition, with btrfs for backups on it.
Kernel panic happened while system was mounted and performing receive/send operations during backup.
After restart no problem with LUKS itself, but on btrfs was found some errors and warnings:
btrfs ch -p /dev/mapper/bckp
Opening filesystem to check...
... |
Thanks Emmanuel Rosa for your comment, you've pointed me to the right direction.
After i run scrub on a mounted volumebtrfs sc start -Bd /dev/mapper/bckp
I've got this result:
scrub device /dev/mapper/bckp (id 1) done
scrub started at Thu Sep 12 13:28:38 2019 and finished after 05:12:29
total bytes scr... | btrfs ref and backpointer mismatch, ERROR in extent allocation tree |
1,592,658,112,000 |
I have the following requirements:
I have an LVM volume A, encrypted with key K1 using LUKS.
I need to make a copy-on-write snapshot of A such that
Writes to A will continue to be encrypted under K1
Writes to the snapshot will be encrypted under K2, which is different from K1.
The use case is to allow the snapsho... |
No, it is not possible to change the LUKS encryption key when making an LVM snapshot.
LUKS is unaware of LVM, so this would be no different than cloning a partition and expecting to be able to change the encryption key.
Now, you MAY be able to achieve your goal if you flip LVM and LUKS. It's a complex setup that goes... | Encrypting data written to an LVM snapshot with a different key |
1,592,658,112,000 |
So I have LVM on LUKS in Arch Linux. My whole disk is encrypted and my boot partition is on an external disk. So do I need to encrypt the swap partition if the disk is encrypted when powered off?
|
If you’re swapping to a logical volume in your encrypted LVM on top of LUKS, then no, you don’t need additional encryption for your swap, it’s already encrypted.
| If I have full disk encryption do I need to encrypt the swap partition? |
1,592,658,112,000 |
I'm trying to setup a new Arch Linux installation with encrypted /boot partition, as described here: https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#Encrypted_boot_partition_.28GRUB.29
I'm creating three partitions with cgdisk:
/dev/sda1 - Type ESP (ef00) Size 100MiB
/dev/sda2 - Type Linux (8... |
The solution is to pay attention to the /etc/fstab upon its generation, since genfstab doesn't add entries for /boot and /boot/efi and it must be done by hand.
After chroot, we must re-mount not only the ESP, but also the /boot partition. Then grub-install will work.
Update: Mounting /boot and the ESP should really be... | Installing GRUB to encrypted partition doesn't work if (root) is F2FS |
1,592,658,112,000 |
I have a linux mint 18 installation with a luks encrypted / and swap partitions. / which is /dev/sda6 unlocks and mounts fine at boot up. The system then goes into emergency mode. journalctl says timeout trying to reach the swap partition.
I tried running cryptsetup open --type luks /dev/sda5 sda5_cryptand that r... |
DopeGhoti is correct.
To confirm a corrupted LUKS header, you can use the following command:
cryptsetup luksDump /dev/sda5
You should get the same error message.
To fix it, re-create the LUKS container, setup the swap again, and take a backup of the LUKS header. Something like this:
cryptsetup luksFormat /dev/sda5
cr... | LUKS encrypted swap partition is no longer recognized after power failure |
1,592,658,112,000 |
I wondering where are places luks key password. For example password for root is in etc/shadow. Where I can find file with luks key password?
I add this
cryptsetup luksAddKey --key-slot 1 /dev/sda5 what is directory of file with this password?
|
The key material is stored after the LUKS partition header (so no file).
The key slots can be viewed using:
cryptsetup luksDump /dev/<your_disk>
See:
https://gitlab.com/cryptsetup/cryptsetup/wikis/LUKS-standard/on-disk-format.pdf
| Directory to file with Luks key password |
1,592,658,112,000 |
Using a liveCD.
Benchmark says the fastest disk IO on my notebook will be: aes-xts 256b
root@ubuntu:~# cryptsetup benchmark
# Tests are approximate using memory only (no storage IO).
PBKDF2-sha1 1008246 iterations per second
PBKDF2-sha256 615361 iterations per second
PBKDF2-sha512 458293 iterations per s... |
Your live cd must be very old, regarding the warning message of cryptsetup-reencrypt. I used this tool many times, without any message or problems like this.
Also your command line is not correct, and must be changed from aes-xts to aes-xts-plain64.
| cryptsetup-reencrypt crashes my LUKS device |
1,592,658,112,000 |
I want to make my linux laptopwith LUKS Encryption. OS : Mint 17.
Is it better to make the disk LUKS-encrypted:
at the installation process ?
after it ?
|
During the installation, the installer will show you an option to encrypt the disk with LUKS.
| Mint, install and LUKS/LVM |
1,592,658,112,000 |
My root node is LUKS encrypted, and it uses a key file, instead of user input password to unlock it.
I know in Grub2, I can use
insmod cryptodisk
insmod luks
cryptomount -u <uuid>
But I have no idea how to use a key file to unlock the disk.
|
Try
insmod (hd0,1)/routeto/keyfile.file
change (hd0,1) (if necessary)and put the mounting point of the keyfile file system, sda or whatsoever...
| grub2 and cryptsetup |
1,690,742,708,000 |
I need an advice about a bad situation.
I was installing a new linux ditro by using my main PC. I booted with the ISO and then installed the distro on /dev/sdc, which was an external USB drive.
My bad, I didn't realized when installing, that I didn't change the boot loader installation on the same drive, but I left on... |
UEFI or BIOS installs. Looks more like BIOS as you have MBR and maybe grub's core.img which is in the sectors after the MBR. Most systems now are UEFI and prefer gpt partitioning.
If you plug in external drive, does it boot?
Update it to see encrypted install.
sudo apt-get update && sudo apt-get install lvm2 cryptsetu... | Restore lost bootloader on a luks partition |
1,690,742,708,000 |
System: Fedora 37, Gnome 43
I enabled LUKS encryption on setup and enabled auto-decrypt via TPM 2 with following an article from Fedora Magazine. Auto-decrypt works but while it decrypts, it shows the passphrase screen until system boots. How can I hide this screen?
|
This worked for me, after reading up and working out what was asking for the password I tried a sleep for the ask password. I tried a few values 8 seconds the boot screen showed then switched to the password before continuing, 15 didn't show up.
It means that if the TPM decrypt fails the password will eventually show ... | I Have LUKS Enabled And Integrated With TPM 2. How To Hide Passphrase Screen? |
1,690,742,708,000 |
I followed my own instructions here to shrink down a LUKS-encrypted Ubuntu 20.04 partition and its inner LVM volume so I could install Ubuntu 22.04 in a new LUKS-encrypted partition next to it, but after installing the LUKS-encrypted Ubuntu 22.04 OS, the LUKS-encrypted 20.04 installation (in a separate encrypted parti... |
I figured it out!
How to add other LUKS-encrypted Linux distributions back to your Grub bootloader startup menu: quick summary
# 1. Open your `/etc/default/grub` file.
sudo gedit /etc/default/grub
# Then manually add these lines to the bottom of that file:
# (required)
GRUB_DISABLE_OS_PROBER=false
# (optional)
GRUB_EN... | How to get a dual boot (2 Linux OSs) system working when both are LUKS-encrypted |
1,690,742,708,000 |
I'm relatively new to linux and I have just wiped my drive and I am installing arch linux from the start. When I run:
cryptsetup luksFormat /dev/sda3
I get the following warning:
WARNING: Locking directory /run/cryptsetup is missing!
It allows me to continue apparently but I decided to check if that would create me... |
You can ignore the warning, cryptsetup will create the directory if it doesn't exist. There were some discussions between systemd and cryptsetup who should be in charge of creating the directory. The warning was changed to a debug message with a different wording on cryptsetup 2.3.5 and newer.
The directory itself is ... | arch - /run/cryptsetup missing while formatting luks partition |
1,690,742,708,000 |
At reboot, with USB sticks inserted, the TPM will not allow passphraseless booting of the server. With a USB HDD inserted passphraseless booting of the server is possible.
Our servers are running Centos 8.3 with Linux kernel version 4.18.0-240.
TPM2 modules are used with LUKS version 1 encryption of an LVM group consi... |
We have figured out which PCR value changes after a USB stick gets inserted and the system reboots. By not binding to that PCR value we managed to boot off the TPM with a USB stick inserted.
In our case PCR 1 (BIOS config) kept changing when a USB stick was inserted and the system rebooted.
The command we used to quer... | Not booting off TPM with USB disk inserted |
1,690,742,708,000 |
I have added a second disk to my LVM system. I created a physical volume there, added it to the volume group of ubuntu, 'vgubuntu', extended logical volume to fill the whole disk. How do I extend the LUKS system partition to fill the whole logical volume? Here's more info provided by pvdisplay, vgdisplay and lvdisplay... |
You have LUKS configured on the PV level so "under" your LVM setup so unfortunately you need to start over -- your PV must be encrypted you can't "extend" the existing LUKS/dm-crypt device to the second disk. The structure should look like disk -> partition -> LUKS -> PV -> VG -> LV (it is possible to configure encryp... | How do I extend LUKS partition to fill the whole logical volume of 2 disks on LVM? |
1,690,742,708,000 |
I am trying to set up SELinux and an encrypted additional partition that I mount at startup using a systemd service.
If I run SELinux in permissive mode, everything runs ok (partition is correctly mounted, data can be accessed and service runs properly).
If I run SELinux in enforcing mode (enforcing=1), I am not able ... |
Solved assigning to cryptsetup the lvm_exec_t context.
In the lvm.fc file cryptsetup was defined as /bin/cryptsetup but I had to change it to /usr/sbin/cryptsetup where it actually was.
| SELinux and cryptsetup: chown failed and can't access temporary keystore |
1,690,742,708,000 |
I am trying to setup lvm on luks2 with boot inside lvm.
NAME FSTYPE FSVER FSAVAIL FSUSE% MOUNTPOINT
nvme0n1
├─nvme0n1p1 vfat FAT32 510.7M 0% /mnt/efi
└─nvme0n1p2 crypto_LUKS 2
└─cryptlvm LVM2_member LVM2 001
├─ArchNVMe-swap swap ... |
Thanks to telcoM for their comment -- it appears that I didn't have ext2.mod loaded.
| GRUB error: unknown filesystem |
1,690,742,708,000 |
My disks (ZFS on Linux on encrypted LUKS) are not staying in standby and I'm not able to identify which process is waking them up.
iotop is showing command txg_sync which is related to ZFS. So I tried fatrace. But even with fatrace -c I don't get any output. This is related to ZFS and a known issue.
Next try was using... |
With the following you are able to identify I/O per process:
cut -d" " -f 1,2,42 /proc/*/stat | sort -n -k +3
| How to identify which process is writing on encrypted disk with ZFS |
1,604,269,152,000 |
loop0p2 contains a luks2 that contains an ext4. The question is: how to calculate the minimum size the outer partition needs in order to hold the inner. Given is the size of the inner partition (in the example: 25614K)
Device Start End Sectors Size Type
/dev/loop0p1 2048 4095 2048 1M Microsoft basic d... |
The "extra" 16 KiB is secondary LUKS2 header. The "Metadata area: 16384 [bytes]" is size of the header, but you have two on the disk. See LUKS2 On-Disk Format Specification for more details.
| ext4 in luks: how to calculate the minimum 'outer partition's size |
1,604,269,152,000 |
Current setup is two 4TB hard drives in a RAID 1 setup using MDADM in Debian.
Would like to encrypt the MD0 mount with whatever encryption is good. I was going to use something like this:
sudo cryptsetup luksFormat /dev/md0
sudo cryptsetup luksOpen /dev/md0 secure
sudo mkfs.ext4 /dev/mapper/secure
1) From what I unde... |
Generally speaking it's not possible with standard linux tools to encrypt in place, that is to encrypt that device while it has data on it, and not lose the data. You'll need to copy it to another media, encrypt and then copy it back.
It will effect performance of all operations on that disk. Now the disk will have to... | MDADM with Encryption without losing files |
1,604,269,152,000 |
After updating to kernel 5.5.10-200.fc31, Fedora 31 can't decrypt the root file system on boot. After entering the decryption passphrase, the filesystem fails to decrypt. The same happens with kernel 5.5.11. However, if I boot with kernel 5.5.8 there's no problem. These are the error messages I get with 5.5.11 when ru... |
You should head over to https://bugzilla.redhat.com and report this as a bug. It is very unlikely that we here can help.
Only advise (for now) is to delete the oldest offending kernel(s), so you only keep the very last one and one (or two) working kernels, that way an update won't erase a working kernel.
| Fedora 31 kernels 5.5.10 and 5.5.11 fail when trying to decrypt luks root filesystem after kernel update, but kernel 5.5.8 works |
1,604,269,152,000 |
Everytime i decrypt my luks drive the partition is not showing up:
cryptsetup -v luksOpen /dev/md0 md0_crypt
lsblk
sdb 8:16 0 3,7T 0 disk
└─sdb1 8:17 0 3,7T 0 part
└─md0 9:0 0 7,3T 0 raid5
└─md0_crypt ... |
It's unusual to partition LUKS/LVM devices and as such, this is not covered by most standard tools. In fact, keeping partitions hidden on Device Mapper devices is a feature, as Virtual Machines using Logical Volumes as backing devices would usually partition those but NOT want their partitions to show up on the host.
... | Partition not showing up after Luks decryption |
1,604,269,152,000 |
BACKGROUND:
I have already created a passphrase list to use with bruteforce-luks. Unfortunately, that list was not enough to find the correct passphrase. I am assuming I missed out a word or 2.
I am fairly sure some or all of the words are in the actual passphrase, but I am unsure of the remaining possible 1 to 3 w... |
Solution:
Create program which allows you to type in all the words you usually use in passwords.
Run the program which will do a sort of permutation but not only change the order of the words, but also build up the number of words used per permutation.
Save the generated passphrase text file (ended up being over 5,00... | Using cores on multiple servers for bruteforce-luks [closed] |
1,604,269,152,000 |
I have LVM partitions which are encrypted using LUKS. My root partition is /dev/HDD/root:
LVM group "HDD" (at /dev/HDD):
Encrypted LUKS device "root" at /dev/HDD/root
I'm trying to decrypt it via grub parameters, GRUB_CMDLINE_LINUX:
dolvm crypt_root=/dev/HDD/root root=/dev/mapper/root root_keydev=UUID=<usb-uuid> r... |
The issue was that I used a key as a passphrase for LUKS instead of keyfile. To convert it to keyfile it's needed to add a keyfile via cryptsetup and remove passphrase for it:
cat /bood/hdd.key | cryptsetup luksAddKey -d /bood/hdd.key /dev/root
cat /bood/hdd.key | cryptsetup luksRemoveKey /dev/root
| Failed to open root LUKS device on LVM during boot |
1,604,269,152,000 |
What I have:
Solus OS install with an encrypted LVM2 on a 56G SSD w/o swap - works pretty
good. I have 32G RAM, so swap isn't an issue right now - it's my future main rig
and it is mainly intended to being used as desktop for office, web, daw and
rust programming (not everything at the same time).
What I want to do:
A... |
Solus OS uses systemd, therefore /etc/crypttab is used to configure LUKS devices that need to be unlocked so that filesystems can be mounted from them using /etc/fstab. Here's the procedure.
Mirroring (raid1) /home with LUKS and BTRFS
Using Software Center, install btrfs-progs.
Create a LUKS key file which will be st... | How to add a btrfs raid 1 to an encrypted lvm2 volume group under Solus OS (Linux)? |
1,604,269,152,000 |
I am facing booting problem after upgrading kernel to 4.13.3 on CentOS 6 having LUKS encryption (cryptsetup-luks-1.2.0-11.el6.x86_64). I tried compiling the same kernel on another CentOS6 which does not have LUKS volume, that works without any issue. But I am facing issue on the servers having LUKS volume. During boo... |
Somehow the mod_crypt and mod_dm modules were not included in initramfs while running make. The issue is resolved after creating initramfs with mod_crypt and mod_dm modules
# mkinitrd initramfs-4.13.3.img 4.13.3 --with=mod_crypt --with=mod_dm
| System Boot Problem - LUKS+kernel-4.13.3 [closed] |
1,604,269,152,000 |
I've got a second hard drive in my laptop. However, it only mounts itself when I load the GUI and click on the device in Nemo. What I'd like is for it to automount on boot.
sudo lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
sdb ... |
As @Thomas points out in comments, the following worked:
sudo mkdir /mnt/data
Then in fstab:
/dev/mapper/luks-3df2999e-9b64-46ec-b634-7986877c57f5 /mnt/data ext4 defaults 0 2
| Secondary LUKS physical volume won't automount |
1,604,269,152,000 |
So I'm trying to encrypt a partition sda2 while installing Arch Linux.
root@archiso ~ # cryptsetup luksFormat /dev/sda2 -c aes-xts-plain -y -v -s 512 -h sha512
But it fails:
Cannot format device /dev/sda2 which is still in use.
How do I fix this?
|
If it's in use, you should check whether it's mounted, loop-device'd, still cryptsetup-opened, active in LVM, part of a RAID set, etc. and then stop all these things. Also quit any running processes that might be using the device (partitioners, installers, ddrescue, badblocks, ...). The list of possibilities as to wha... | Arch Linux setup Luks encryption |
1,604,269,152,000 |
I've setup a Kali Linux installation on an SD card and created an encrypted LUKS partition with a LVM logical volume inside of it, then created a BTRFS filesystem inside. Almost everything works, but boot fails after decrypting the LUKS volume succeeds. Logs:
Begin: Loading essential drivers ... done.
Begin: Mounting ... |
The error was caused by this parameter in my kernel line:
rootflags=noload,subvol=@
This parameter's value is passed directly to mount as filesystem options for mounting the root filesystem. By inserting debugging statements into /scripts/local (generated from /usr/share/initramfs-tools/scripts/local), I was able to ... | Mounting failed - invalid argument |
1,604,269,152,000 |
I just tried to move /usr to a small ssd I recently purchased. The ssd is formatted with LUKS and btrfs. Apparently systemd fails to start the cryptography target before the partitions are first mounted:
Nov 28 16:12:33 laptop systemd[1]: Failed to start Remount Root and Kernel File Systems.
Nov 28 16:12:33 laptop sys... |
Systemd expects a separate /usr partition to be made available by the initramfs. I don't have a setup to reproduce this, but you probably need to follow the wiki on /usr as a separate partition together with enabling the encrypt or sd-encrypt hooks in the HOOKS variable of /etc/mkinitcpio.conf. Both of them allow you ... | LUKS partition is unlocked after first use |
1,604,269,152,000 |
I've been trying to string together the right flags in cryptsetup:
cryptsetup -y -h sha512 -c twofish-xts-plain64 -s 512 luksFormat /dev/sdx
But it hasn't been working. When I enter the command listed above, nothing happens; it doesn't even prompt me for a password. Trying this command with aes-xts-plain64 doesn't w... |
With a little help from reddit, I've figured it out.
tcplay did the trick. It encrypted my USB flash drive with the following command:
tcplay -c -d /dev/sdx -a SHA512 -b TWOFISH-256-XTS
tcplay is essentially a TrueCrypt clone. It's available in the Ubuntu repositories. -c tells tcplay to create a new volume. -d spec... | How do you encrypt a USB drive partition with the Twofish cipher and SHA-512 hash without using TrueCrypt? [closed] |
1,386,425,889,000 |
When I already have a LUKS block device opened using cryptsetup luksOpen, does invoking the command on the same machine with the same arguments including the device name for the second time just do nothing or is doing so unsafe?
|
If you try to open the device with the same name, cryptsetup will simply tell you that the mapped device already exists. If you try different name, the call will fail because the device is in use:
$ sudo cryptsetup luksOpen /dev/sdc1 a
Device a already exists.
$ sudo cryptsetup luksOpen /dev/sdc1 b
Enter passphrase f... | Is it safe to run cryptsetup luksOpen twice? |
1,452,633,174,000 |
What is the difference between Docker, LXD, and LXC. Do they offer the same services or different.
|
No, LXC, Docker, and LXD, are not quite the same. In short:
LXC
LinuX Containers (LXC) is an operating system-level virtualization method for running multiple isolated Linux systems (containers) on a single control host (LXC host)
https://wiki.archlinux.org/index.php/Linux_Containers
low level ...
https://linuxcon... | What is the difference between Docker, LXD, and LXC [closed] |
1,452,633,174,000 |
Are there any notable differences between LXC (Linux containers) and FreeBSD's jails in terms of security, stability & performance?
On first look, both approaches look very similar.
|
No matter the fancy name used here, both are solutions to a specific problem: A better segregation solution than classic Unix chroot. Operating system-level virtualization, containers, zones, or even "chroot with steroids" are names or commercial titles that define the same concept of userspace separation, but with di... | Linux LXC vs FreeBSD jail |
1,452,633,174,000 |
I'm trying to mount a folder on the host to an LXC container.
The host has a folder /mnt/ssd/solr_data created (this is currently on the root filesystem, but later I'll mount an SSD drive there, so I'm prepping for that).
I want that folder to mount as /data in the container.
So in the containers fstab file I have the... |
To create the directory automatically in the container, you can also add the create=dir option in the fstab :
/mnt/ssd/solr_data /var/lib/lxc/Solr4StandAlone/rootfs/data none bind,create=dir
Edit : this is specific to LXC. See this thread
Just like we already had "optional", this adds two new LXC-speci... | LXC: How do I mount a folder from the host to the container? |
1,452,633,174,000 |
I'm running some services inside of Docker LXC containers on my server and I'm beginning to actually do serious things with them.
One thing I'm not clear on is how user permissions work inside and outside of the container. If, for example, I'm running MySQL in a container and have its data directory set to /data, whic... |
Since the release of 0.9 Docker has dropped LXC and uses its own execution environment, libcontainer. Your question's a bit old but I guess my answer still applies the version you are using.
Quick Answer: To understand the permissions of volumes, you can take the analogy of mount --bind Host-Dir Container-Dir. So to f... | User permissions inside and outside of LXC containers? |
1,452,633,174,000 |
This is stated in the man page for systemd-nspawn
Note that even though these security precautions are taken
systemd-nspawn is not suitable for secure container setups. Many of
the security features may be circumvented and are hence primarily
useful to avoid accidental changes to the host system from the
cont... |
LXC is a little bit better because it can run containers as unpriveleged users. This is possible with systemd-nspawn, but only for scenarios where you only need one user (instead of multiple), which can be difficult or less secure for multi process in container scenarios. If you want to know why docker, lxc, and syste... | What makes systemd-nspawn still "unsuitable for secure container setups"? |
1,452,633,174,000 |
is it currently possible to setup LXC containers with X11 capabilities? I'm looking forward for the lightest available X11 container (memory-wise), hardware acceleration a plus but not essential.
If it is not currently possible, or readily available, is it known what functionality needs to be yet implemented in order ... |
yes it is possible to run a complete X11 desktop environment inside a LXC container.
Right now, I do this on Arch Linux. I won't say it's "light" as I haven't gone as far as trying to strip out stuff from the standard package manager install but I can confirm that it does work very well.
You have to install any kernel... | Linux - LXC; deploying images with tiniest possible X11 |
1,452,633,174,000 |
I'm exploring the LXC features in Ubuntu 12.04 and I really want to set up a network like this:
client1: 192.168.56.101/24
lxc-host: 192.168.56.102/24
guest1 192.168.56.201/24
guest2 192.168.56.202/24
guest3 192.166.56.203/24
I just want a "flat" network where the guests have full access to the LAN and... |
This is pretty much right—though you're missing a line like this:
lxc.network.ipv4.gateway = X.X.X.X
I have an LXC guest running on Debian. First, you set up the host bridge (the easy way), in /etc/network/interfaces:
auto wan
iface wan inet static
address 72.X.X.X
netmask 255.255.255.0
gatewa... | How to configure external IP addresses for LXC guests? |
1,452,633,174,000 |
The technical explanation of what is unprivileged container is quite good. However, it is not for ordinary PC user. Is there a simple answer when and why people should use unpriviliged containers, and what are their benefits and downsides?
|
Running unprivileged containers is the safest way to run containers in a production environment. Containers get bad publicity when it comes to security and one of the reasons is because some users have found that if a user gets root in a container then there is a possibility of gaining root on the host as well. Basica... | What are benefits and downsides of unprivileged containers? |
1,452,633,174,000 |
I am trying to hunt down information for why a network interface name would have an at sign, but there's too much noise in the results I am so far getting (I lack the correct terminology to search on)
I have a LXC container on a Ubuntu host. Inside the container I run and get:
# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu ... |
eth0@if10 means:
your network interface is named still simply eth0 and network tools and apps can only refer to this name, without the @ appendix. (As a sidenote, this is most probably a veth peer, but the name does not need to reflect this.)
@if10 means: eth0 is connected to some (other) network interface with index... | Network interface name has with at sign - what is it? |
1,452,633,174,000 |
I use unprivileged lxc containers in Arch Linux. Here are the basic system infos:
[chb@conventiont ~]$ uname -a
Linux conventiont 3.17.4-Chb #1 SMP PREEMPT Fri Nov 28 12:39:54 UTC 2014 x86_64 GNU/Linux
It's a custom/compiled kernel with user namespace enabled:
[chb@conventiont ~]$ lxc-checkconfig
--- Namespaces ---
... |
A better and safer solution is to install cgmanager and run it with systemctl start cgmanager (on a systemd-based distro). You can than have your root user, or if you have sudo rights on the host create cgroups for your unprivileged user in all controllers with:
sudo cgm create all $USER
sudo cgm chown all $USER $(id ... | How to create user cgroups with systemd |
1,452,633,174,000 |
Using instructions for Docker auto-start on Linode VPS running Ubuntu 12.04 and Docker 0.8.1, the specified container does not start on reboot.
Once booted, I am able to
~$ sudo start [service-name]
and everything goes as planned, but I would also like to container to restart after a reboot.
Is the script in the tuto... |
At some point over the past couple of months, the upstart script in the tutorial was changed to remove the loop to wait for docker to start. I removed the loop from my upstart scripts and my containers now restart correctly after a reboot.
My /etc/init/service-name.conf script now looks like this:
description "service... | Why doesn't docker container start at boot w/ upstart script on Ubuntu 12.04? |
1,452,633,174,000 |
I'm trying to set up my Linux machine to run multiple guest OSes, one of those being a Windows VM, and another a Linux container. The goal here is to prevent me from messing up the host system, while being free to operate the base operating system and play with the host hardware. Eventually, on top of running my deskt... |
This question had the answer that I needed. Of course, I used lxc-device instead of cgroup definitions in the config file. However, in my case, I have only gotten the keyboard to work in X if I start it on a different tty.
| docker - how to run x desktop in a container? |
1,452,633,174,000 |
In FreeBSD 4.9 it was very easy to accomplish with just a single command like
jail [-u username] path hostname ip-number command
if path was / you had running just the same program as usual but all its network communication was restricted to use only given IP-address as the source. Sometimes it's very handy.
Now in ... |
Starting the process inside a network namespace that can only see the desired IP address can accomplish something similar. For instance, supposed I only wanted localhost available to a particular program.
First, I create the network namespace:
ip netns add limitednet
Namespaces have a loopback interface by default, ... | Linux: Is there handy way to exec a program binding it to IP-address of choice? |
1,452,633,174,000 |
I have a Docker container (LXC) which runs MySQL. Since the idea behind Docker is generally "one running process per container," if I define AppArmor profiles targeting the MySQL binary, will they be enforced? Is there a way for me to test for this?
|
First, cgroups are not used to isolate an application from others on a system. They are used to manage resource usage and device access. It's the various namespaces (PID, UTS, mount, user...) that provide some (limited) isolation.
Moreover, a process launched inside a Docker container will probably not be able to mana... | AppArmor profiles in Docker/LXC |
1,452,633,174,000 |
I've set up a new Debian 9 (stretch) LXC container on a machine running Proxmox VE, and installed the cifs-utils package.
I quickly tested the connection to the SMB server by running
smbclient //192.168.0.2/share -U myusername
which worked fine. However, the command
mount.cifs //192.168.0.2/share /mnt -o user=myusern... |
You're probably running an unprivileged LXC container. The easiest solution is to use a privileged container instead. However, there might be other solutions; take a look e.g. at this thread/post in the proxmox forums.
| Why do I get ”mount error(1): Operation not permitted“ on ”mount.cifs“ in a LXC container on a Proxmox VE machine? |
1,452,633,174,000 |
I looked at the stackexchange site but couldn't find anything. I looked at the wikipedia entry on Linux container https://en.wikipedia.org/wiki/LXC and as well as hypervisor https://en.wikipedia.org/wiki/Hypervisor but the explanation to both is beyond a person who has not worked on either will understand. I also saw ... |
A Virtual Machine (VM) is quite a generic term for many virtualisation technologies.
There are a many variations on virtualisation technologies, but the main ones are:
Hardware Level Virtualisation
Operating System Level Virtualisation
qemu-kvm and VMWare are examples of the first. They employ a hypervisor to mana... | What is a Linux container and a Linux hypervisor? |
1,452,633,174,000 |
I am currently starting a project evaluating untrusted programs (student assignments) in a secure sandbox environment. Main idea is to create a web app for GlassFish and Java wrapper around lxc-utils to manage LXC containers. It'll have a queue of waiting programs and a Java wrapper will maintain a fixed number (pool)... |
You didn't write why you choose LXC as it's not the most secure virtualization solution. I'm heavy user of KVM/XEN and also LXC and I can say this one thing that when it comes to security I never go with Linux containers (no matter if LXC / OpenVZ / VServer). It's just easier (and more reliable) with KVM/XEN.
If it's ... | LXC containers as a sandbox environment |
1,452,633,174,000 |
Typically on a server, automatic updates of security-related patches are configured. Therefore, if I'm running MySQL 5.5 and a new security patch comes out, Ubuntu Server will apply the upgrade and restart MySQL to keep me protected in an automated way. Obviously, this can be disabled, but it's helpful for those of us... |
TL;DR: If you don't build it in yourself, it's not going to happen.
The effective way to do this is to simply write a custom start script for your container specified by CMD in your Dockerfile. In this file, run an apt-get update && apt-get upgrade -qqy before starting whatever you're running.
You then have a couple w... | Application updates inside of Docker containers? |
1,452,633,174,000 |
Environment:
I am using a CentOS-7 as a hypervisor for running several LXCs under libvirt. Each container runs a minimal installation of CentOS-7 with cut down FreePBX (Asterisk, Apache, MySQL + bits).
Symptoms:
There are 16 containers running without any problems. When I start one more it does start, but after the 17... |
I believe you are not hitting a global limit, but an inotify limit. This would be seen on containers running systemd because systemd uses the inotify facility for its bookkeeping, but the host would also be affected. Containers not using systemd (nor inotify) would probably be unaffected.
/proc/sys/fs/inotify/max_use... | "Error: Too many open files" while starting service in environment with several LXCs |
1,452,633,174,000 |
I will be using Ubuntu Linux for this project.
For training of a particular application at a conference I need:
To have each student be able to ssh into the same user account on a server
Upon each login automatically put the user in separate isolated environments
Each isolated environment includes the application, ex... |
With Docker you can do this very easily.
docker pull ubuntu
docker run -t -i ubuntu /bin/bash
# make your changes and then log out
docker commit $(docker ps -a -q | head -n 1) sandbox
cat > /usr/local/bin/sandbox <<EOF
#!/bin/sh
exec docker run -t -i --rm=true sandbox /bin/bash
EOF
chmod a+x /usr/local/bin/sandbox
... | replicate and isolating user environments on the fly |
1,452,633,174,000 |
I'm trying to decide between "jailing" certain applications and I know the trade-offs of KVM versus LXC and how I can use them both.
Lately I came across UML (User-Mode Linux) again and was wondering how it compares with respect to security and resource consumption (or overhead, if you will).
Where can I find a compar... |
Best Disk I/O: LXC > KVM > UML. No overhead to speak of with LXC, KVM adds a layer of indirection so it will be slower (but you could also use it with raw disks), UML will be much slower.
Least CPU overhead: LXC > KVM > UML. No overhead to speak of with LXC, small overhead with KVM, bigger overhead with UML.
Strict s... | Which one is lighter security- and CPU-wise: LXC versus UML |
1,452,633,174,000 |
I know that you can display interfaces by doing ip a show. That only displays the interfaces that the host can see, but virtual interfaces configured by containers don't appear in this list. I've tried using ip netns as well, and they don't show up either. Should I recompile another version of iproute2? In /proc/net/f... |
An interface, at a given time, belongs to one network namespace and only one. The init (initial) network namespace, except for inheriting physical interfaces of destroyed network namespaces has no special ability over other network namespaces: it can't see directly their interfaces. As long as you are still in init's ... | How do I find all interfaces that have been configured in Linux, including those of containers? |
1,452,633,174,000 |
When creating a userns (unprivileged) LXC container on Ubuntu 14.04 with the following command line:
lxc-create -n test1 -t download -- -d $(lsb_release -si|tr 'A-Z' 'a-z') -r $(lsb_release -sc) -a $(dpkg --print-architecture)
and (without touching the created configuration file) then attempting to start it with:
lxc... |
Turns out, surprise surprise, this is a Ubuntu-specific thing.
The cause
The problem: although the kernel has cgroups enabled (check with grep CGROUP /boot/config-$(uname -r)) and cgmanager is running, there is no cgroup specific to my user. You can check that with:
$ cat /proc/self/cgroup
11:hugetlb:/
10:perf_event... | userns container fails to start, how to track down the reason? |
1,452,633,174,000 |
I'm following an Ansible tutorial I got from Packt, I reached this part where I've created 3 Ubuntu containers (lxc) and got them up and running. I'm also able to login to each of them.
I've downloaded Ansible by doing: git clone ansible-git-url and then sourced it.
My working setup is as follows:
/home/myuser/code in... |
You'll probably want to tell ansible where the hosts file is in ansible.cfg, e.g.
[defaults]
inventory=inventory
assuming inventory is actually your inventory file.
| Ansible: How to parse an inventory source |
1,452,633,174,000 |
Is it possible to use LXC on a desktop system to confine browsers and other pieces of software that have in the past been shown to be prone to certain kinds of exploits. So what I want to achieve is to jail, say Firefox, be still able to view its windows etc and yet be sure it only has read and write access to anythin... |
Firejail is a Linux namespaces sandbox program that can jail Firefox or any other GUI software. It should work on any Linux computer.
| Can LXC be used to jail instances of an installed browser? |
1,452,633,174,000 |
We have a Linux server running Debian 4.0.5 (Kernel 4.0.0-2) with 32G RAM installed and 16G Swap configured. The system uses lxc containers for compartmentalisation, but that shouldn't matter here. The issue exists inside and out of different containers.
Here's a typical free -h:
total used ... |
Remember how I said:
The system uses lxc containers for compartmentalisation, but that shouldn't matter here.
Well, turns out it did matter. Or rather, the cgroups at the heart of lxc matter.
The host machine only sees reboots for kernel upgrades. So, what were the last kernels used? 3.19, replaced by 4.0.5 2 months... | Permanent swapping with lots of free memory |
1,452,633,174,000 |
Is it possible to have a vanilla installation of Ubuntu 14.04 (Trusty) and run inside it containerized older Ubuntu versions that originally came with older kernels?
For example for 12.04 I'd assume the answer is yes as it has linux-image packages for subsequent Ubuntu releases, such as linux-image-generic-lts-saucy a... |
You can run older Linux programs on newer kernels. Linux maintains backward compatibility (at least for all documented interfaces), for the benefit of people who are running old binaries for one reason or another (because they don't want to bother recompiling, because they've lost the source, because this is commercia... | Is it possible to run a 10.04 or 12.04 or earlier LTS containerized under LXC or Docker on Trusty? |
1,452,633,174,000 |
I'm attempting to setup a system that automatically creates a new sandbox on a ssh login to use as a temporary jump box into my server. So to do this I was wonder how to setup lxc to spin up a new shell in the container once there is a ssh connection then destroy that container after the session is closed.
What would ... |
Okay, your main problem doesn't appear to be the way you execute this. That's relatively easy with ForceCommand inside a Match block of sshd_config.
In order to do what you want to achieve, i.e. a throw-away container that "self-destructs" after use, you can use lxc-start-ephemeral. That's to say your use-case has alr... | How to automatically launch a lxc container on ssh connection? |
1,452,633,174,000 |
I've followed Waydroid arch-wiki page and have installed waydroid, binder_linux-dkms and waydroid-image-gapps.
When I run waydroid it works perfectly except for the network part.
I do have new interfaces on host machine:
30: waydroid0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qle... |
As a workaround one can disable NFT usage (otherwise network will be unusable). Which is by some reason is enabled by default (whereas there is a commit with disabling it).
In case of Arch-linux one should modify /usr/lib/waydroid/data/scripts/waydroid-net.sh and ensure there is a line:
LXC_USE_NFT=false
| No network in Waydroid: network is unreachable |
1,452,633,174,000 |
I have a bunch of LXC containers running on a machine. All of them have their rootfs in the default location /var/lib/lxc/*/rootfs. This directory lives on a rather small partition on the host. I have a much, much bigger partition mounted on /home.
Is there an option to move the backing storage to /home? Preferably p... |
rootfs is the configuration option. If the container is stopped, you can move the backing directory wherever you want and specify that in the config file:
lxc.rootfs = /home/utsname
This is probably better than using a symlink.
LXC also allows backing files. You can use block devices and raw images.
Source: https:/... | Moving LXC container's backing storage |
1,364,456,540,000 |
I have a bridge set up between eth0 and br0, the bridge works fine, but sometimes, for unknown reasons and circumstances, I keep getting these off vethXXXXXX interfaces added to the bridge. When this happens my LXC instances can't talk to the internet.
When I run brctl delif br0 vethNbUtXk && brctl delif br0 vethYqTf0... |
This might shed some light: Virtual Ethernet device. Might giving you something like this: Sure you do not have some configuration under /var/lib/lxc/ with lxc.network.type = veth ?
grep -r 'veth' /var/lib/lxc/
| Extra bridge interfaces get added automatically |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.