You are not logged in.

#1 2013-08-03 17:27:37

spotshot6544
Member
Registered: 2013-07-18
Posts: 9

[solved] how to run /etc/crypttab

I've created an /etc/crypttab file, now how do I run it? What is the equivalent of typing `mount -a` to activate /etc/fstab but to activate /etc/crypttab?

Thanks

Last edited by spotshot6544 (2013-08-03 18:58:04)

Offline

#2 2013-08-03 17:38:19

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [solved] how to run /etc/crypttab

Such a thing doesn't exist. systemd reads /etc/crypttab at bootup and generates unit files for systemd-cryptsetup. They're unlocked automatically as the devices show up and then likely mounted according to fstab. I suppose if you wanted to reproduce this behavior manually, you could do something like:

# /usr/lib/systemd/system-generators/systemd-cryptsetup-generator /run/systemd/generator
# systemctl daemon-reload
# systemctl restart cryptsetup.target

But this really just begs the question: what are you really trying to do?

Last edited by falconindy (2013-08-03 17:56:03)

Offline

#3 2013-08-03 17:40:37

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: [solved] how to run /etc/crypttab

I don't use disk encryption, but aren't there several varieties - each of which would have their own equivalent to mount if you were not going to have it handled by systemd at boot time?

Truecrypt uses the command `truecrypt` to mount, dm-crypt/LUKS uses `cryptsetup` (based only on a quick read of the wiki).  So I second the question above: what are you really trying to do, and/or what setup guide have you followed so far?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2013-08-03 17:52:00

spotshot6544
Member
Registered: 2013-07-18
Posts: 9

Re: [solved] how to run /etc/crypttab

Currently I'm giving the posted commands a look. systemd-cryptsetup-generator doesn't seem to exist, but I haven't investigated.

I'm just trying to setup an encrypted non-system drive for auto-mounting during boot, but I can't reboot at the moment.

Offline

#5 2013-08-03 17:54:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: [solved] how to run /etc/crypttab

Encrypted how?  What method of encryption?  Are you following one of the wiki pages, which one?


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2013-08-03 17:56:04

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: [solved] how to run /etc/crypttab

spotshot6544 wrote:

systemd-cryptsetup-generator doesn't seem to exist

It would - if you had systemd installed.

Last edited by Trilby (2013-08-03 17:57:17)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2013-08-03 18:14:57

spotshot6544
Member
Registered: 2013-07-18
Posts: 9

Re: [solved] how to run /etc/crypttab

I can open the drive with

cryptsetup open /dev/sdb1 driveName --key-file myKeyfile

and `crypttab status driveName` reports:

/dev/mapper/driveName is active and is in use.
  type:    LUKS1
  cipher:  aes-xts-plain64
  keysize: 512 bits
  device:  /dev/sdb1
  offset:  4096 sectors
  size:    5860526080 sectors
  mode:    read/write

And then I could certainly mount it with `mount /dev/mapper/driveName /mnt` but I'd prefer to have this setup to happen at boot (before login). I suppose I could add these commands to a custom systemd script, but that doesn't seem the proper way to go.
I tried `pacman -S systemd` and was told that it would be reinstalling.

The problem I might be having is that I am not familiar with systemd, and I have only recently moved to Arch.

(Note, "myKeyfile" exists on my system drive which is encrypted too (with a passphrase), so, for my goals, there is no passphrase and that is fine)

Offline

#8 2013-08-03 18:32:53

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [solved] how to run /etc/crypttab

spotshot6544 wrote:

I'd prefer to have this setup to happen at boot (before login).

If /etc/crypttab and /etc/fstab are setup to define this, then it just happens automatically...

Offline

#9 2013-08-03 18:57:50

spotshot6544
Member
Registered: 2013-07-18
Posts: 9

Re: [solved] how to run /etc/crypttab

falconindy wrote:

# /usr/lib/systemd/system-generators/systemd-cryptsetup-generator /run/systemd/generator
# systemctl daemon-reload
# systemctl restart cryptsetup.target

I just got it to work with this. Though, I only ran `/usr/lib/systemd/system-generators/systemd-cryptsetup-generator` leaving off the argument on the first command. I don't know why it at one point told me that it didn't exist. That's actually pretty weird. I'm looking at my bash history and I typed it in fine. I'm quite confused, perhaps I'm messing up some how. Though I did modify /etc/crypttab in between attempts. But! The important part is, that it worked in the end. Thanks!!

Offline

#10 2015-11-02 08:28:48

rsalinas
Member
Registered: 2015-11-02
Posts: 1

Re: [solved] how to run /etc/crypttab

spotshot6544 wrote:

I've created an /etc/crypttab file, now how do I run it? What is the equivalent of typing `mount -a` to activate /etc/fstab but to activate /etc/crypttab?

I think

cryptdisks_start

is what you are looking for. (you have to specify the volume to setup).

Offline

#11 2015-11-02 10:06:56

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,846
Website

Re: [solved] how to run /etc/crypttab

rsalinas, please don't necrobump old topics, especially when they're marked as solved.

Closing.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Online

Board footer

Powered by FluxBB