You are not logged in.

#1 2015-08-19 14:11:18

GuloGuloDesu
Member
Registered: 2013-07-18
Posts: 35

[Solved] LUKS cannot change data mode on remount

I'm not really sure what has happened, I think that maybe my /root directory was flushed (everything deleted), but I'm not sure.  (Long story)

I have my laptop setup with all of my drives encrypted. Normally when I boot my laptop it comes up with:

A password is required to access the root volume:
Enter passphrase for /dev/sda7

:: running hook [openswap]
Enter passphrase for /dev/sda6:

Then it boots to my logon prompt without issue. Now though after I put in both of my passphrases it comes up with:

[FAILED] to start Load Kernel Modules.
See 'sysemctl status systemd-modules-load.service' for details
Mounting Configuration File System...
Starting Apply Kernel Variables...
[OK] Mounted Configuration File System.
[OK] Started udev Coldplug all Devices.
[OK] Started Apply Kernel Variables
[OK] Started udev Kernel Device Manager.

Found device APPLE_SSD_SM0512F Linux\x20filesystem.
Starting Cryptography Setup for var...
Found device APPLE_SSD_SM0512F Linux\x20filesystem.
Starting Cryptography Setup for Home
Please enter passphrase for disk Linux\x20filesystem (home)! [74.284323] EXT4-fs (dm-0): Cannot change data mode on remount

I apologize that was not a copy and paste, that was me transcribing from another PC.

It asks me to re-enter my passphrase for both home and var and if I don't the laptop goes into a recovery mode.  Although if I type in the passphrase correctly, it will boot my laptop. If I miss type the passphrase, or wait too long it goes into a recovery mode.
When I check my systemctl, I have the following two errors:

*sysemd-modules-load.service    loaded failed failed    Load Kernel Modules
systemd-random-seed.service     loaded active exited Load/Save Random Seed
*systemd-remount-fs.service       loaded failed failed   Remount Root and Kernel File System

Here is my fstab, which was the only thing I could think of that might actually have the problem

# /dev/mapper/root
UUID=783bae3c-0162-4d26-a263-1374ff8fcfbd    /    ext4    rw,relatime,data=ordered    0 1

# /dev/mapper/var
UUID=aa6896f5-578e-4bd6-953c-e8c924f80611    /var    ext4    rw,relatime,data=ordered    0 2

# /dev/mapper/home
UUID=d6ece33f-0387-45e2-a801-79ab3b9eb2f5    /home    ext4    rw,relatime,data=ordered 0 2

# /dev/sda5
UUID=21d85dee-8669-4faa-806f-a46e09fae46f    /boot    ext4    rw,relatime,stripe=4,data=ordered    0 2

(Typed not copied and pasted.)

If need be I can try to bring this laptop back up on the network to start copying and pasted from systemctl and config files.

I have been reading through different posts about the remount issue, but I haven't found quite what I am supposed to do to try and get this resolved. I will continue to read and do research, and if I find a solution I will come back and post my solution.

Any help would be greatly appreciated.

Last edited by GuloGuloDesu (2015-08-25 01:58:41)

Offline

#2 2015-08-19 14:30:05

frostschutz
Member
Registered: 2013-11-15
Posts: 1,421

Re: [Solved] LUKS cannot change data mode on remount

data mode probably refers to data=ordered

if that can't be changed on remount, you must use this option on the first mount, or more specifically, tell the initramfs to use this option

have you recently changed your fstab? in that case updating initramfs might suffice. otherwise you might need to add a fancy kernel parameter. I am not sure which of the two mkinitcpio uses to decide on rootfs mount options by default.

removing the data= options from fstab might work as well, but then you're not using those options if they're important to you ...

Last edited by frostschutz (2015-08-19 14:30:54)

Offline

#3 2015-08-20 14:03:50

GuloGuloDesu
Member
Registered: 2013-07-18
Posts: 35

Re: [Solved] LUKS cannot change data mode on remount

frostschutz wrote:

data mode probably refers to data=ordered

if that can't be changed on remount, you must use this option on the first mount, or more specifically, tell the initramfs to use this option

have you recently changed your fstab? in that case updating initramfs might suffice. otherwise you might need to add a fancy kernel parameter. I am not sure which of the two mkinitcpio uses to decide on rootfs mount options by default.

removing the data= options from fstab might work as well, but then you're not using those options if they're important to you ...

I have not made any changes to my fstab in quite some time.
I tried removing the data=ordered in the fstab for all of my mounts but that did not solve the problem.

I took a look at my /etc/mkinitcpio.conf and I found that it had changed at some point, but I have no clue when. It was set to this:

HOOKS="base udev autodetect modconf block encrypt openswap resume filesystems keyboard fsck"

When it used to be set to this:

HOOKS="base udev autodetect modconf block encrypt lvm2 openswap resume filesystems shutdown keyboard fsck"

So I updated it to be the way it was when I first installed the OS and ran mkinitcpio -p linux and rebooted. But still no luck, it still asks me to enter in my passphrase another 2 times for Home and Var.

It's like it isn't applying the passphrase that I set to all of the drives when it attempts to boot. That would be why it can't remount, as the drives are still encrypted. I'm going through my build notes, and I am not seeing anything that is sticking out that I should take a look at. But I am still troubleshooting.

Any other possible suggestions?

Offline

#4 2015-08-21 15:10:40

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

Re: [Solved] LUKS cannot change data mode on remount

Your fstab mapper entries for those mounts

# /dev/mapper/var
UUID=aa6896f5-578e-4bd6-953c-e8c924f80611
...

look like you don't use lvm (see the now missing lvm2 hook as well) but separate partitions. That's the reason it asks for passphrases. Without lvm only the / partition gets unlocked by the encrypt hook passphrase at boot. Might be that you had setup LUKS keys to automatically unlock the other mounts/partitions during boot in your wiped (first sentence of your post) /root directory. If that's the case, you only need to create new keys for /var and /home and reference them in crypttab.

Offline

#5 2015-08-25 01:58:00

GuloGuloDesu
Member
Registered: 2013-07-18
Posts: 35

Re: [Solved] LUKS cannot change data mode on remount

Strike0 wrote:

Your fstab mapper entries for those mounts

# /dev/mapper/var
UUID=aa6896f5-578e-4bd6-953c-e8c924f80611
...

look like you don't use lvm (see the now missing lvm2 hook as well) but separate partitions. That's the reason it asks for passphrases. Without lvm only the / partition gets unlocked by the encrypt hook passphrase at boot. Might be that you had setup LUKS keys to automatically unlock the other mounts/partitions during boot in your wiped (first sentence of your post) /root directory. If that's the case, you only need to create new keys for /var and /home and reference them in crypttab.

You sir were spot on.  I was able to find the solution to this problem a couple of days ago before reading the post.  It appears that I had a gaping hole in my documentation of my build, as I did not have any info on my crypttab. I have since rectified this hole and resolved my issue.

Thank you both for your help with troubleshooting this, and in the future I will pay closer attention to who runs what commands where on my gear.

Offline

Board footer

Powered by FluxBB