You are not logged in.

#1 2014-02-12 21:50:09

tealeaf
Member
Registered: 2014-02-12
Posts: 6

[solved] systemd times out waiting for dev-null.device on encrypted fs

I have a relatively new install of Arch on my laptop. The relevant sections of the drive setup are a luks encrypted root device (with associated unencrypted /boot), and a large ntfs device encrypted with truecrypt. That contains my home directory, which is shared with the Windows 8 dual-boot on the machine.

I have all this mounted on boot, so my typical usage is to enter my password for the encrypted root, followed by the password for the truecrypt-encrypted data drive, then normal login.

This has been working fine for a couple of weeks. This afternoon I rebooted my machine from Windows to Linux, at which point the secondary encrypted drive failed to mount. The root device mounts fine.

On further examination, in the form of journalctl -xb, I'm getting the following errors after mounting the encrypted root device:

Feb 12 21:29:54 kafka systemd[1]: Job dev-null.device/start timed out.
Feb 12 21:29:54 kafka systemd[1]: Timed out waiting for device dev-null.device.
-- Subject: Unit dev-null.device has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li … temd-devel
-- Documentation: http://www.freedesktop.org/wiki/Softwar … e9d022f03d
--
-- Unit dev-null.device has failed.
--
-- The result is timeout.
Feb 12 21:29:54 kafka systemd[1]: Dependency failed for Cryptography Setup for cryptdata.
-- Subject: Unit systemd-cryptsetup@cryptdata.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/li … temd-devel
-- Documentation: http://www.freedesktop.org/wiki/Softwar … e9d022f03d
--
-- Unit systemd-cryptsetup@cryptdata.service has failed.
--

As my root home directory is on the root filesystem, I can still log in as root. If I try to mount or unmount the truecrypt device (located at /data) the command hangs. After removing "auto,x-systemd.automount" from that device from /etc/fstab and rebooting, I have a significant delay at boot, but I can then mount the /data device as normal.

I can't find anything related to this either here or on Google. Any ideas?

Last edited by tealeaf (2014-02-13 12:01:55)

Offline

#2 2014-02-12 23:57:39

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: [solved] systemd times out waiting for dev-null.device on encrypted fs

There is no dev-null.device in systemd. I fear something is wrong in your crypttab.

Offline

#3 2014-02-13 03:34:56

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [solved] systemd times out waiting for dev-null.device on encrypted fs

A bit OT, but I just want to mention that having your $HOME on ntfs is probably not the best idea either.  It may work, but because it is not a POSIX compliant filesystem, there is a good chance you might run into some issues.

Offline

#4 2014-02-13 10:09:25

tealeaf
Member
Registered: 2014-02-12
Posts: 6

Re: [solved] systemd times out waiting for dev-null.device on encrypted fs

brain0 wrote:

There is no dev-null.device in systemd. I fear something is wrong in your crypttab.

Ah. That was exactly the tip I needed. Thank you.

I had the passphrase file for my /data drive set to /dev/null in /etc/crypttab, because I wanted to enter the passphrase on bootup. It looks like systemd was looking for that device when it started and not finding it.

This worked before. I assume that an update of systemd must have changed the behaviour. Does anyone know how to list a (truecrypt) device in the crypttab without specifying its keyfile or passphrase file? (I tried removing the line, but that didn't work either.)

For the moment, I've created a passphrase file. I'm not quite comfortable with it, but I can live with it if my system boots. smile

Thank you, and I'll try to track down what changed in systemd to make this happen.

EDIT: It seems that I hadn't read the manual for crypttab very well. At the top it says that setting the path to the passphrase file to "none" or "-"  causes it to be manually entered at system boot. I haven't tried it yet, but I'm going to assume that that will fix my problem. Thanks again!

EDIT2: It did work. Order is restored. I have no idea why having /dev/null there used to work, but 'none' definitely does.

Last edited by tealeaf (2014-02-13 10:27:52)

Offline

#5 2014-02-13 10:20:48

tealeaf
Member
Registered: 2014-02-12
Posts: 6

Re: [solved] systemd times out waiting for dev-null.device on encrypted fs

WonderWoofy wrote:

A bit OT, but I just want to mention that having your $HOME on ntfs is probably not the best idea either.  It may work, but because it is not a POSIX compliant filesystem, there is a good chance you might run into some issues.

Thanks for the warning. Sadly, as there are applications I need for work that only run in Windows, I need to dual boot this machine with Windows 8.1. This is the best option I can find for sharing my home directory, which is also a necessity due to the amount of data I have to share between the systems. I would much rather trust to ntfs-3g-ar and its UserMapping (and all the fiddling with ACLs that I had to do) than to the Windows ext2 drivers I can find. They all seem to be several years out of date. Linux is much better at talking NTFS than Windows is at talking EXT. (To be honest, I'm actually quite impressed with Windows 8 since the upgrade to 8.1. As a long term Arch user and a fan of tiling window managers it's interesting to see Windows moving in the right direction. smile)

With 'permissions' in the /etc/fstab and the .NTFS-3G/UserMapping file in place it works almost seamlessly. (It took a lot of tinkering with ACLs in Windows and Linux, but it's working very well now. One tip that I'll write here in case it's of use is that you want the last line of the UserMapping file to be a 'generic' mapping. When I didn't have that there were very strange things going on.)

The only two minor problems I have now are:

1) A few applications don't like FUSE filesystems. Steam worked for a while and then broke; reinstalling it failed at every stage. When I checked, it seems that FUSE is a known problem for Steam. (I don't think it's restricted to NTFS.) My response to that was to create /home/.local/$HOME on my root (ext4) filesystem and symlink out to it for troublesome applications.
2) There are a few characters for filenames that Windows doesn't like, making those files inaccessible in Windows. (Colons are the major culprit.) They're usually quite easily renamed. (The exception being my .maildir folder, which I have had to duplicate natively in cygwin.)

Neither of these are anything more than minor niggles. I appreciate the warning, though.

Having said that, if you have an alternative that lets me share a truecrypt-encrypted drive between Linux and Windows that is better than the NTFS-3G approach, I'd love to hear it for future reference.

Offline

#6 2014-06-02 23:45:05

jwhendy
Member
Registered: 2010-04-01
Posts: 621

Re: [solved] systemd times out waiting for dev-null.device on encrypted fs

A bit late, but I was searching for info on creating a systemd service to mount my shared Truecrypt NTFS partition either at boot or after startx. I just got a new work computer and decided to re-dig into some investigations I did before (here and here).

I haven't been happy with anything I've found. Either boot up whizzes right by password entry (if I try to do it automatically during boot), starting the service spits me from X to a non-X tty due to StandardInput=tty-force, or I get nothing at all (without a StandardInput bit). So... sort of stuck on that front.

In any case, I mainly wanted to comment on sharing between Arch and Windows as I do the exact same thing. I actually do this due to having an encrypted work computer, so I have no option to even mount/access my C: drive. Thus, what I've resorted to is described here (I wrote that):

- /dev/sda1: Windows, whatever I can shrink it to; about 100G
- /dev/sda2: /boot for encrypted Arch, 128M
- /dev/sda3: Arch partition (everything, no separate /home, /usr, etc.), about 30G
- /dev/sda4: the rest for Truecrypt shared partition, ~50G

I pretty much do the same as you, however I've opted to leave it all on my TC partition, and simply symlink what I need to my home dir. It might help to understand what exactly you want to share, as I have very few (like, 1) example of something I actually keep in my home dir that I share across partitions (my emacs config and related files). For that, it's actually on /dev/sda4 and I link to it in both Win and Arch.

I also have a cron job that uses rsync to snapshot my home directory to /dev/sda4 as well. So, I'm always (1x/hr) updating a copy of ~/ (which is always on /dev/sda3) on /dev/sda4. Thus, if I ever did need something, hopefully I'd have it from Windows. The one PITA I encounter is forgetting to put ~/Downloads or ~/Desktop files into /dev/sda4 somewhere, then rebooting to not have access to the file I needed.

Anyway, maybe I'm subject to the same issues as you since all my shared stuff is on NTFS as well... but wanted to share my setup since we're so similar, in the event it helps at all?

Offline

#7 2014-06-07 14:22:13

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: [solved] systemd times out waiting for dev-null.device on encrypted fs

Your comments on how you set up the share with ntfs will surely help others searching here. 

I just wanted to add that regarding your original issue:

tealeaf wrote:
brain0 wrote:

There is no dev-null.device in systemd. I fear something is wrong in your crypttab.

Ah. That was exactly the tip I needed. Thank you.

I had the passphrase file for my /data drive set to /dev/null in /etc/crypttab, because I wanted to enter the passphrase on bootup. It looks like systemd was looking for that device when it started and not finding it.

There is a bug report that seems relevant (but unfortunately is a bit stale) with a mentioned work-around similar to yours: https://bugs.freedesktop.org/show_bug.cgi?id=75816

Offline

#8 2014-06-07 16:38:47

progandy
Member
Registered: 2012-05-17
Posts: 5,203

Re: [solved] systemd times out waiting for dev-null.device on encrypted fs

tealeaf wrote:

Thanks for the warning. Sadly, as there are applications I need for work that only run in Windows, I need to dual boot this machine with Windows 8.1. This is the best option I can find for sharing my home directory, which is also a necessity due to the amount of data I have to share between the systems. I would much rather trust to ntfs-3g-ar and its UserMapping (and all the fiddling with ACLs that I had to do) than to the Windows ext2 drivers I can find. They all seem to be several years out of date. Linux is much better at talking NTFS than Windows is at talking EXT. (To be honest, I'm actually quite impressed with Windows 8 since the upgrade to 8.1. As a long term Arch user and a fan of tiling window managers it's interesting to see Windows moving in the right direction. smile)

ext2fsd got a new update this year and as far as I know it is quite reliable. http://www.ext2fsd.com/
I also started with home on NTFS and a UserMapping file, but using a FUSE filesystem as your primary data storage is just so slow. I was pleasantly surprised when I moved to an ext4 home partition for linux-only data and used NTFS only for windows only and shared files.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

Board footer

Powered by FluxBB