How to mount encrypted multi-device BTRFS-volumes using systemd?

I recently switched to systemd and have some issues with a multi-device (raid1) btrfs volume.
My fstab contains this line for the volume:
/dev/mapper/archive1 /mnt/archive btrfs device=/dev/mapper/archive1,device=/dev/mapper/archive2,device=/dev/mapper/archive3,device=/dev/mapper/archive4,defaults,noatime,nodiratime 0 0
As you can see, the volume consits of four LUKS mapper devices, which must all be present for the volume to be mounted.
The problem now is that systemd doesn't recognize the dependency for my volume to all four crypto mappers. It tries to mount the volume as soon as /dev/mapper/archive1 is in place, which fails very often.
So how do I manually set the dependency? I tried adding cryptsetup.target to /etc/systemd/system/local-fs.target.wants without success.
Thanks
lynix

I found the time to write the custom .mount file and it seems to fix the issue, indeed
[Unit]
Description=/mnt/archive
Wants=cryptsetup.target
After=cryptsetup.target
[Mount]
What=/dev/mapper/archive1
Where=/mnt/archive
Type=btrfs
Options=defaults,noatime,nodiratime
The mount point in question is still listed in my /etc/fstab, the .mount file takes precedence like stated in `man systemd.mount`.

Similar Messages

  • [Solved] How to mount multi-device btrfs filesystem under systemd?

    I am running full, native systemd. It always has an error during boot trying to mount my new, multi-device btrfs filesystem. There was no problem with mounting the filesystem when it resided on a single disk drive.
    When it fails, it allows me to enter my root password and have a console. In this console, I can successfully mount the btrfs filesystem. Then boot continues normally, and then I can use the filesystem with no further problems, until the next reboot.
    btrfs filesystem show /dev/sda4
    failed to read /dev/sr0
    Label: 'TimBTRFS' uuid: 317460bc-5b6a-4dac-acb8-7139dcbcff8b
    Total devices 2 FS bytes used 31.67GB
    devid 2 size 100.00GB used 2.00GB path /dev/sdb1
    devid 1 size 100.00GB used 42.02GB path /dev/sda4
    Btrfs Btrfs v0.19
    I looked up btrfs in the wiki, and it says I have to run "btrfs device scan" before I can mount the filesystem. "This is the purpose of the btrfs mkinitcpio hook or the USEBTRFS variable in /etc/rc.conf" I do not have an rc.conf.  I do not know how to do this with systemd. What do I need to do to resolve this?
    Tim
    Last edited by ratcheer (2012-09-06 12:12:24)

    I added the btrfs hook as per the previous post. I ran "mkinitcpio -p linux". I ran grub-mkconfig. I rebooted and got the exact same problem. I did see the message early in the boot output that the btrfs hook was executed.
    Here are the error messages:
    [ 203.780864] device label TimBTRFS devid 1 transid 140 /dev/sda4
    [ 203.781779] btrfs: disk space caching is enabled
    [ 203.790133] btrfs: failed to read chunk tree on sda4
    [ 203.790973] btrfs: open_ctree failed
    Again, in the root console, I simply mounted the filesystem ("mount -t btrfs /dev/sda4 /btrfs"), typed Ctrl-d, and the bootup continued normally and successfully.
    I need help, please.
    Tim

  • How do i detect DAQ device number programatticaly using Visual Basic (not using MAX)?

    how do i detect DAQ device number programatticaly using Visual Basic (not using MAX)?

    Several of the CWDAQ objects have Device (the device number), DeviceName, and DeviceType properties that I think will give you the information that you're looking for. For more information, look in the index of the Measurement Studio reference for Device, DeviceName, and DeviceType.
    - Elton

  • HT203071 How does the clients (iOS devices) to configure/use the caching server to download apps from local caching server instead of App store?

    Hi ... How does the clients (iOS devices) to configure/use the caching server to download apps from local caching server instead of App store?

    Hi,
    If you want to restore a reomoved app,you need to use
    Add-AppxPackage to add a signed app package (.appx) to a user account.
    But we cannot extract them from the ISO.
    The behavior is by design.And this is a software protection regime.
    Thanks for your understanding.
    Regards,
    Kelvin Xu
    TechNet Community Support

  • How can i encrypt an ddecrypt a string using java

    hai,
    can anybody know how to encrypt and decrypt a string using java..
    please if anybody help me with a small example and with code
    thanks
    ravi chandra

    hi,
    of course there are better ways to crypt your code, but the following 2 functions do their job....
    as far as i know java has an own api for crypting stuff.
    private String GetEncryptedString(String aCryptedString)
    String result = "";
    String str = aCryptedString;
    int[] asciiArray = new int[str.length()];
    for(int i = 0; i < asciiArray.length; i++)
    asciiArray[i] = (int)str.charAt(i);
    char tempChar = (char)(asciiArray[i]+3);
    result = result+tempChar;
    return result;
    private String GetDecryptedString(String aString)
    String result = "";
    String str = aString;
    int[] asciiArray = new int[str.length()];
    for(int i = 0; i < asciiArray.length; i++)
    asciiArray[i] = (int)str.charAt(i);
    char tempChar = (char)(asciiArray[i]-3);
    result = result+tempChar;
    return result;
    andi

  • How can I control the PP (monitor) volume using my computer volume controls.

    I'm no longer able to control the PP (monitor) volume using my computer volume controls. I've always controlled the monitor volume using my computer volume levels, but starting today, that has changed.
    The volume is just playing at the level recorded with no way for me to turn down or up.
    I performed a disc repair and that didn't solve the problem.

    Does the OS volume control affect anything?  System beeps and sych?

  • How to mount encrypted lvm + chroot + reinstall grub?

    hey everyone
    i can't boot into my system after i tried to reinstall grub (caused by an error in the bios) so i had to reboot and change some settings. unfortenately grub couldn't boot anymore
    the problem is that the system is an encrypted lvm and i don't know how to map the volume, decrypt, mount and chroot into it.
    could you pls give me a short and handy guide?
    best regards :>

    I'm afraid it hadn't been answered!
    I've got the following as /etc/rc.d/arch32, listed in /etc/rc.conf:
    #!/bin/bash
    . /etc/rc.conf
    . /etc/rc.d/functions
    case $1 in
    start)
    stat_busy "Starting Arch32 chroot"
    mount --bind /proc /opt/arch32/proc
    mount --bind /proc/bus/usb /opt/arch32/proc/bus/usb
    mount --bind /dev /opt/arch32/dev
    mount --bind /dev/pts /opt/arch32/dev/pts
    mount --bind /dev/shm /opt/arch32/dev/shm
    mount --bind /sys /opt/arch32/sys
    mount --bind /tmp /opt/arch32/tmp
    mount --bind /home /opt/arch32/home
    mount --bind /var/run /opt/arch32/var/run
    mount --bind /var/lib/dbus /opt/arch32/var/lib/dbus
    add_daemon arch32
    stat_done
    stop)
    stat_busy "Stopping Arch32 chroot"
    umount /opt/arch32/proc/bus/usb
    umount /opt/arch32/proc
    umount /opt/arch32/dev/pts
    umount /opt/arch32/dev/shm
    umount /opt/arch32/dev
    umount /opt/arch32/sys
    umount /opt/arch32/tmp
    umount /opt/arch32/home
    umount /opt/arch32/var/run
    umount /opt/arch32/var/lib/dbus
    rm_daemon arch32
    stat_done
    restart)
    $0 stop
    sleep 1
    $0 start
    echo "usage: $0 {start|stop|restart}"
    esac
    exit 0
    Changing 'mount --bind /home...' to '..--rbind' didn't make any difference, but is this maybe because I access the encrypted folders after this has happened?

  • How to mount encrypted partition

    I have Archlinux installed in dual boot with Ubuntu. My home partition on Ubuntu is encrypted with ecrypt. I would like to have this partition mounted on boot at Archlinux too. Does anyone can help me how to do that?
    Thanks a lot.

    https://wiki.archlinux.org/index.php/Sy … h_eCryptfs
    Please search the wiki before asking for help here.

  • Mount encrypted os x timemaschine volume

    Hi guys,
    having a little problem here.
    I switched from OS X 10.7 to arch a few weeks ago. Migrated all the data(at least i thought so) and was happy. Now I recognized I forgot to backup a important TrueCrypt keyfile. Well....fu**
    So here is the problem. I saved my backups over the OS X timemaschine at an external raid, and the timemaschine backup was encrypted with the OS X on board tools.
    I found the libfvde project, but it requires the wipekey file. Since Arch is the only OS running on my macbook right now, I don't have any files of OS X left(beside the files in the encrypted external hdd).
    Does anybody know if there is a way to gain access to the files in the encrypted hdd without installing OS X again?
    I know that's a little bit specific and maybe better in a mac forum, but I thought I give it a try here.
    Thanks

    Ok, worked it out with a Macbook with 10.7 from a friend. Just in time, i copied the important files to an USB stick, saved them on a second ssd, powered off the raid, powered it on again, now OS X tells me that it can't read the volume any more.
    Wtf?
    Anyway, got my files, now formating the raid, encrypt it and use it as backup volume again. This time with opensource encryption

  • How do I encrypt a second hard drive using BitLocker for Windows 8.1?

    Hi there,
    I've encrypted my 1st HDD with BitLocker, however, I can't seem to find a way to encrypt my 2nd HDD too.
    More specifically, on my laptop I've got a SSD (successfully encrypted) and a HDD (yet to be encrypted).
    Any ideas on how this would be achievable? 
    Also, what if I want to encrypt an external backup HDD? 
    Thanks!
    Robert

    Hi,
    Could you check the file system of the system partition in the disk management, to see if it is NTFS or Fat32? If it is not NTFS, try to change it to NTFS.
    Two partitions are required to run BitLocker because pre-startup authentication and system integrity verification must occur on a separate partition from the encrypted operating system drive. This configuration helps protect the operating system and the
    information in the encrypted drive. In Windows Vista, the system drive must be 1.5 gigabytes (GB), but in Windows 7 this requirement has been reduced to 100 MB for a default installation. The system drive may also be used to store the Windows Recovery
    Environment (Windows RE) and other files that may be specific to setup or upgrade programs. Computer manufacturers and enterprise customers can also store system tools or other recovery tools on this drive, which will increase the required size of the system
    drive. For example, using the system drive to store Windows RE along with the BitLocker startup file will increase the size of the system drive to 300 MB. The system drive is hidden by default and is not assigned a drive letter. The system drive is created
    automatically when Windows 7 is installed.
    Best Regards,
    Jason Zeng

  • How do you separate 3 devices that are using one account on itunes?

    I do not wish to have my families downloads on my device or vice versa!

    How do I get the itunes library that has all of there songs/apps transferred to their itunes library then?

  • How do you flush a device's buffer using LabVIEW GPIB functions?

    I know the VISA Flush function is an alternative, but I started my program with the low level GPIB functions and it would be a huge task switching now, so if anyone knows how I would do the buffer clear I would greatly appreciate it if you can show me how it's done. Thanks.
    Otman

    Your comment about an indicator getting "clogged up with data" doesn't make any sense. The contents of a string or array indicator can get large and slow things down but a numeric indicator cannot get clogged up. If the data stops making sense, then you are incorrectly reading the instrument and converting that data to a numeric. With your comments about the device transmit buffer, I suspect you have occasionaly set the byte count too low and unread bytes are there that you then read the next time. As long as the instrument is fairly new, it will send out a termination character (typically EOI) that will terminate the read. You can then set the read count to some arbitrarily high number to ensure you've got the entire tr
    ansmit buffer contents. It's also possible that you periodicaly have an error condition where the instrument is sending unexpected information. For example, if it normally sends a floating point number as a result and then it sends an error message string, you might not be intrepreting it correctly.

  • How can I encrypt/decrypt data in Forms using a specified Package?

    Hi All,
    I have searched in the Internet for ecnrypting/decrypting data in Forms.
    That is when I want to query the data outside the Form Application it will be encypted, otherwise if I want to query it in the form application it will be dycrypted
    I found this package:
    CREATE OR REPLACE PACKAGE Encrypt_pkg AS
    FUNCTION encrypt (p_text IN VARCHAR2) RETURN RAW;
    FUNCTION decrypt (p_raw IN RAW) RETURN VARCHAR2;
    END Encrypt_pkg;
    CREATE OR REPLACE PACKAGE BODY Encrypt_pkg AS
    -- All VARCHAR2 inputs are padded to multiples of 8 charaters,
    -- with the encryption key also being a multiple of 8 charaters.
    -- The encryption key and padding characters can be altered to suit.
    g_key RAW(32767) := UTL_RAW.cast_to_raw('12345678');
    g_pad_chr VARCHAR2(1) := '';
    PROCEDURE padstring (p_text IN OUT VARCHAR2);
    FUNCTION encrypt (p_text IN VARCHAR2) RETURN RAW IS
    l_text VARCHAR2(32767) := p_text;
    l_encrypted RAW(32767);
    BEGIN
    padstring(l_text);
    DBMS_OBFUSCATION_TOOLKIT.desencrypt(input => UTL_RAW.cast_to_raw(l_text),
    key => g_key,
    encrypted_data => l_encrypted);
    RETURN l_encrypted;
    END;
    FUNCTION decrypt (p_raw IN RAW) RETURN VARCHAR2 IS
    l_decrypted VARCHAR2(32767);
    BEGIN
    DBMS_OBFUSCATION_TOOLKIT.desdecrypt(input => p_raw,
    key => g_key,
    decrypted_data => l_decrypted);
    RETURN RTrim(UTL_RAW.cast_to_varchar2(l_decrypted), g_pad_chr);
    END;
    PROCEDURE padstring (p_text IN OUT VARCHAR2) IS
    l_units NUMBER;
    BEGIN
    IF LENGTH(p_text) MOD 8 > 0 THEN
    l_units := TRUNC(LENGTH(p_text)/8) + 1;
    p_text := RPAD(p_text, l_units * 8, g_pad_chr);
    END IF;
    END;
    END Encrypt_pkg;
    ** Now How can I use this package to encrypt/decrypt data in the form as I said Plz???

    <p>Read this article and go to chapter 2.3.2.</p>Inserts, Update and Delete orders are managed by a stored procedure. In the sample dialog, the Select is handled by the emp_pkg.emp_query() stored function:
      PROCEDURE emp_query(emp_data IN OUT emptab) IS
        ii NUMBER;
        CURSOR empselect IS
          SELECT empno, ename, job, sal, comm FROM emp
           ORDER BY ename ;
      BEGIN
        OPEN empselect;
        ii := 1;
        LOOP
          FETCH empselect INTO
            emp_data( ii ).empno,
            emp_data( ii ).ename,
            emp_data( ii ).job,
            emp_data( ii ).sal,
            emp_data( ii ).comm;
          EXIT WHEN empselect%NOTFOUND;
          ii := ii + 1;
        END LOOP;
      END emp_query;In your case, all you have to do is th use your decrypt() function in the cursor definition:
        CURSOR empselect IS
          SELECT decrypt(empno), decrypt(ename), decrypt(job), decrypt(sal), comm FROM emp
           ORDER BY ename ;
    ...For Insert and Update events, use the crypt() function in the related stored procedures.
      PROCEDURE emp_insert2(t IN emptab) IS
      BEGIN
        FOR i IN t.first..t.last LOOP
         INSERT INTO emp (empno, ename, job, sal, comm)
         VALUES(crypt(t(i).empno), crypt(t(i).ename), crypt(t(i).job), crypt(t(i).sal, t(i).comm));
         END LOOP ;
      END emp_insert2;Idem for the Update procedure.
    Francois

  • How to run virtualbox init.d script, if using systemd

    I just installed virtualbox and the host modules with pacman. I then created my virtual machine and switched to bridged network setting and get the following error.  I don't get this error when I use NAT.
    Failed to open a session for the virtual machine Learning Puppet VM (pe-3.0.1).
    Failed to open/create the internal network 'HostInterfaceNetworking-wlp2s0' (VERR_SUPDRV_COMPONENT_NOT_FOUND).
    One of the kernel modules was not successfully loaded. Make sure that no kernel modules from an older version of VirtualBox exist.
    Then try to recompile and reload the kernel modules by executing '/etc/init.d/vboxdrv setup' as root (VERR_SUPDRV_COMPONENT_NOT_FOUND).
    That init.d script doesn't exist, and as far as I can tell it wouldn't work with systemd anyway.
    Not sure what to do.
    Last edited by n_t (2013-10-07 15:47:56)

    https://wiki.archlinux.org/index.php/Vi … el_Modules
    https://wiki.archlinux.org/index.php/Vi … _interface
    Last edited by Scimmia (2013-10-07 19:42:39)

  • [SOLVED] linux-ck with LVM on encrypted block device

    Hi,
    Following all the good things I've read about the linux-ck kernel, I have tried to install the atom version from repo-ck on my netbook.
    I have an encrypted block device which is used as a PV for LVM. My root partition is a LV on the associated volume group.
    With the linux-ck kernel, my root partition is not detected (it says waiting for /dev/sda2, which is the encrypted PV).
    After diffing the stock arch .config and the -ck .config, I saw that some things like crypto are compiled as modules in -ck.
    I tried rebuilding the linux-ck init image with all theses modules in the MODIULES section of mkinitcpio.conf (MODULES="udlfb dm_crypt cryptd sd_mod dm_mod ablk_helper aes_i586 aes_generic"), but it hasn't helped.
    What am I missing ?
    Last edited by arnooo (2012-10-31 09:34:00)

    My /boot/grub/menu.lst CK entry was loading the wrong init image... I had the epiphany after typing my post, so maybe it wasn't completely useless. I need to get a rubber duck

Maybe you are looking for

  • How can I play a dvd on my Mac and display it through Apple TV

    I want to use my DVD drive on my mac to play back movies through my apple tv2. I notice that on my iPad, iPhone, iTunes on my computer all have the AirPlay option to display the video on my TV through Apple TV. I do not want to burn my DVD onto my Ma

  • Server 2008 R2 (64) SP-1 Event Error 5774 Netlogon

    Hi there, I built another small network, single Dell 2950 as a Server 2008 R2 (64) SP-1 Domain Controller In the event Viewer is Event ID 5774 Netlogon error and desktops unable to connect, this is a new small developer's network not in production, s

  • Pass values to other forms

    Hi Guys! My Problem is to pass values through call forms to another form. There are two ways I had done it before. First:global variables. Second library spec with variables in in, then call forms share library data and the calles form uses the same

  • Set up Start Time

    Hi, I am trying to set up the start time at 0:00. I have changed the value in every possible place, restart the program and create new document. Does anyone know the way to do it? Thanks. W.

  • My Surface 2 will not open or view most PDF files

    For some reason every time I try to open most files (of course it's the files that I need access to ASAP) it keeps giving me this message " Please wait...   If this message is not eventually replaced by the proper contents of the document, your PDF v