You are not logged in.

#1 2013-01-09 05:22:18

b1tgl0w
Member
Registered: 2011-11-30
Posts: 42

FSCK Journal Replaying on External Drive

The past two times I've mounted my external drive, FSCK has told the filesystem to replay journal transactions. Is this a sign that the drive is going bad or can I still get some more use from it? Is there a way to repair the drive? Is there a program that can check for sure if the drive is bad or going bad?

Edit: When I shut down I got 4 beeps (I think) and this is the message in journalctl for each partition:
Failed to deactivate: Invalid argument
systemd-cryptsetup@home.service control process exited, code=exited status=1
Unit systemd-cryptsetup@home.service entered a failed state


Thank you.

Last edited by b1tgl0w (2013-01-09 05:43:19)

Offline

#2 2013-01-10 10:25:40

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: FSCK Journal Replaying on External Drive

It dose not sound like there is anything wrong with your hard drive smile

The reason the journal is being replayed is becuase the filesystem is not being shutdown correctly.

It looks like the systemd-cryptsetup UNIT file is not correctly unmouting the encrypted partition. Becuase the journal is being replayed we know the filesystem is not being umounted correctly.... it looks like the systemd-cryptsetup UNIT file trying umount the encrypted partition Before the filesystem is umounted, and that is way it is failing. You would not have the journal being replayed even if the /home filesystem was umounted after the systemd-cryptsetup UNIT file. So, we know that at no point on shutdown dose anything umount the /home filesystem. So, it is not a problem with things running out of order. It is a problem that the /home filesystem is just not being umounted at all.

I need to know more about your setup to tell you exactly what you need to do. However, you need to change the way things are setup, so /home is unmounted before the systemd-cryptsetup UNIT file tries to umount the encrypted parition.

I am farly sure that systemd umounts filesystems, so look into how it dose that and configure it to umount /home.

Last edited by hunterthomson (2013-01-10 10:33:14)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#3 2013-01-11 20:19:55

b1tgl0w
Member
Registered: 2011-11-30
Posts: 42

Re: FSCK Journal Replaying on External Drive

I ran /usr/lib/systemd/system-generators/systemd-cryptsetup-generator then copied /run/systemd/generator/systemd-cryptsetup@* to /etc/systemd/service/ and rebooted.

When I booted again, I ran sudo journalctl, and this time there were no errors but also nothing about the encrypted volumes being deactivated or unmounted. Is this normal or are the error messages possibly not getting logged?

Offline

#4 2013-01-12 02:03:10

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: FSCK Journal Replaying on External Drive

I've never used that but just from the man page, is that how you are supposed to do it? It makes it sound as if that stuff should be automatically generated and not that you should need to copy it into systemd's permanent configuration. [But this is based purely on reading the man page which could be just misleading.]

Then again, I don't even have a /etc/systemd/service/ directory...


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2013-01-12 04:39:36

b1tgl0w
Member
Registered: 2011-11-30
Posts: 42

Re: FSCK Journal Replaying on External Drive

You're right. It's not how I should do it, the error messages in journalctl are back. Any ideas? (Any information that might be helpful?)

Offline

#6 2013-01-13 01:54:24

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: FSCK Journal Replaying on External Drive

Have you read the man page? Try to figure out what it uses to generate that stuff and correct the source.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#7 2013-01-17 01:52:52

b1tgl0w
Member
Registered: 2011-11-30
Posts: 42

Re: FSCK Journal Replaying on External Drive

It uses crypttab. Crypttab is fine. I'm still looking into this issue. The journal replays have stopped, but the crypt devices still don't cleanly deactivate.

Last edited by b1tgl0w (2013-01-17 01:53:30)

Offline

#8 2013-01-18 19:23:54

b1tgl0w
Member
Registered: 2011-11-30
Posts: 42

Re: FSCK Journal Replaying on External Drive

Okay, I think I solved it: Had to add the shutdown hook to mkinitcpio.conf and run #mkinitcpio -p linux. I will officially mark this thread as solved after I shutdown the machine several more times and the problem is definitely fixed. Can anyone confirm that this could have been the source of the problem?

Offline

#9 2013-01-18 22:14:15

b1tgl0w
Member
Registered: 2011-11-30
Posts: 42

Re: FSCK Journal Replaying on External Drive

That did not work. Problem persists.

Edit: I reread your post, hunterthomson, and I'm looking into unmounting /dev/mapper/home before the cryptdevice is deactivated. Will report back.

Last edited by b1tgl0w (2013-01-18 23:51:56)

Offline

#10 2013-01-21 01:54:21

b1tgl0w
Member
Registered: 2011-11-30
Posts: 42

Re: FSCK Journal Replaying on External Drive

I've tried adding these files to /usr/lib/systemd/system-shutdown with no success:

/usr/lib/systemd/system-shutdown/umountCrypt.service

[Unit]

Description=/etc/rc.local.shutdown Compatibility
After=rc-local.service

[Service]
Type=oneshot
ExecStart=/etc/rc.local.shutdown
StandardInput=tty
RemainAfterExit=yes

[Install]
WantedBy=shutdown.target
Also=rc-local.service

/usr/lib/systemd/system-shutdown/umountCrypt.bash

#!/bin/bash
umount /var
umount /home
umount /media/WDDIsk

The latter file was automatically deleted. Also note that /etc/rc.local.shutdown looks the same as the above script.

I've also done some searching and other users have similar problems, but with cifs. Unfortunately the solutions in their posts did not work for me.

Can anyone help?

Last edited by b1tgl0w (2013-01-22 05:06:51)

Offline

Board footer

Powered by FluxBB