Re: [systemd-devel] perform fsck on everyt boot

2019-12-06 Thread Cristian Rodríguez
On Mon, Nov 11, 2019 at 9:34 AM Belisko Marek  wrote:
>
Am I still
> missing something? Thanks.

Yes, what you are trying to do is the wrong thing(tm) to do, please
figure out why there is filesystem corruption in the first place,
while ext4 of course has bugs like any software around, it is not
known for being fragile. I'd bet money on the SD card being crappy.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] perform fsck on everyt boot

2019-11-21 Thread Chris Murphy
On Wed, Nov 20, 2019, 11:58 PM Belisko Marek 
wrote:

> On Thu, Nov 21, 2019 at 7:25 AM Chris Murphy 
> wrote:
> >
> > On Tue, Nov 12, 2019 at 3:52 AM Belisko Marek 
> wrote:
> > >
> > > On Mon, Nov 11, 2019 at 4:47 PM Lennart Poettering
> > >  wrote:
> > > >
> > > > On Mo, 11.11.19 13:33, Belisko Marek (marek.beli...@gmail.com)
> wrote:
> > > > 65;5802;1c
> > > > > Hi,
> > > > >
> > > > > I'm using systemd 234 (build by yocto) and I've setup automount of
> > > > > sdcard in fstab. This works perfectly fine. But I have seen from
> time
> > > > > to time when system goes to emergency mode because sdcard
> filesystem
> > > > > (ext4) have an issue and cannot be mounted. I was thinking about
> > > > > forcing fsck for every boot. Reading manual it should be enough to
> set
> > > > > passno (6th column in fstab) to anything higher then 0. I set ti
> to 2
> > > > > but inspecting logs it doesn't seems fsck is performed. Am I still
> > > > > missing something? Thanks.
> > > >
> > > > Well, note that ext4's fsck only does an actual file system check
> > > > every now and then. Hence: how did you determine fsck wasn't started?
> > > >
> > > > Do you see the relevant fsck in "systemctl -t service | grep
> > > > systemd-fsck@"?
> > > I just saw in log:
> > > [  OK  ] Found device /dev/mmcblk1p1.
> > > Mounting /mnt/sdcard...
> > > [8.339072] EXT4-fs (mmcblk1p1): VFS: Found ext4 filesystem with
> > > invalid superblock checksum.  Run e2fsck?
> > > [FAILED] Failed to mount /mnt/sdcard.
> >
> > This isn't normal. Your effort should be on finding out why this
> > problem is happening in the first place. This doesn't strike me as the
> > (somewhat) ordinary case of unclean unmount, which results in journal
> > replay at next mount attempt. But something considerably more serious.
> Problem is it's very hard to reproduce and this is not rootfs just
> external SDcard for storing some data.
> If I hit this system goes to emergency mode and device is dead and I
> would like to prevent that in first place.
> IMO fsck should help to recover this issue and should continue without
> issues. Thanks.
>

Possibly adding nofail option in fstab will prevent startup from going into
rescue.target.

I'm skeptical of unattended use of fsck. That's what journal replay is for,
and if replay can't fix the problem, then the underlying problem needs to
be fixed rather than papered over with fsck.

You might consider testing this SDCard with f3, which will check for
corruption, and fake flash. Reformat, mount, f3write /mountpoint, f3read
/mountpoint.

I don't trust consumer SDCards for anything. I've had name brand stuff
fail.

The systemd journal should show evidence of either umount success or
failure for this SDCard on restart or shutdown. Do the corruptions only
happen on shutdowns? It both shutdown and restart? SDCards can get really
fussy, exhibiting corruptions, or just brick themselves, when power is
removed while writes are still happening internally. Cheaper flash may be
slower to flush to stable media. You can give it more time by manually
unmounting this SDCard before reboot or shutdown.


Chris Murphy
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] perform fsck on everyt boot

2019-11-20 Thread Andrei Borzenkov
20.11.2019 17:35, Belisko Marek пишет:
> Hi Andrei,
> 
> On Sat, Nov 16, 2019 at 9:31 AM Andrei Borzenkov  wrote:
>>
>> 12.11.2019 13:52, Belisko Marek пишет:
>>> On Mon, Nov 11, 2019 at 4:47 PM Lennart Poettering
>>>  wrote:

 On Mo, 11.11.19 13:33, Belisko Marek (marek.beli...@gmail.com) wrote:
 65;5802;1c
> Hi,
>
> I'm using systemd 234 (build by yocto) and I've setup automount of
> sdcard in fstab. This works perfectly fine. But I have seen from time
> to time when system goes to emergency mode because sdcard filesystem
> (ext4) have an issue and cannot be mounted. I was thinking about
> forcing fsck for every boot. Reading manual it should be enough to set
> passno (6th column in fstab) to anything higher then 0. I set ti to 2
> but inspecting logs it doesn't seems fsck is performed. Am I still
> missing something? Thanks.

 Well, note that ext4's fsck only does an actual file system check
 every now and then. Hence: how did you determine fsck wasn't started?

 Do you see the relevant fsck in "systemctl -t service | grep
 systemd-fsck@"?
>>> I just saw in log:
>>> [  OK  ] Found device /dev/mmcblk1p1.
>>> Mounting /mnt/sdcard...
>>> [8.339072] EXT4-fs (mmcblk1p1): VFS: Found ext4 filesystem with
>>> invalid superblock checksum.  Run e2fsck?
>>> [FAILED] Failed to mount /mnt/sdcard.
>>>
>>> and then system goes to emergency mode. I inspect logs but cannot see
>>> any systemd-fsck process running.
>>
>> Without seeing /etc/fstab line at the very least anything will be
>> guesswork. E.g. systemd will not emit fsck dependency if fstype is set
>> to "auto".
> Here is line from fstab:
> /dev/mmcblk1p1  /mnt/sdcard  auto   defaults  0  0
> 
> So I'll update to ext4 and add kernel fsck.mode=force command line it
> should perform fsck on every boot?

Yes, I expect it will.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] perform fsck on everyt boot

2019-11-20 Thread Belisko Marek
On Thu, Nov 21, 2019 at 7:25 AM Chris Murphy  wrote:
>
> On Tue, Nov 12, 2019 at 3:52 AM Belisko Marek  wrote:
> >
> > On Mon, Nov 11, 2019 at 4:47 PM Lennart Poettering
> >  wrote:
> > >
> > > On Mo, 11.11.19 13:33, Belisko Marek (marek.beli...@gmail.com) wrote:
> > > 65;5802;1c
> > > > Hi,
> > > >
> > > > I'm using systemd 234 (build by yocto) and I've setup automount of
> > > > sdcard in fstab. This works perfectly fine. But I have seen from time
> > > > to time when system goes to emergency mode because sdcard filesystem
> > > > (ext4) have an issue and cannot be mounted. I was thinking about
> > > > forcing fsck for every boot. Reading manual it should be enough to set
> > > > passno (6th column in fstab) to anything higher then 0. I set ti to 2
> > > > but inspecting logs it doesn't seems fsck is performed. Am I still
> > > > missing something? Thanks.
> > >
> > > Well, note that ext4's fsck only does an actual file system check
> > > every now and then. Hence: how did you determine fsck wasn't started?
> > >
> > > Do you see the relevant fsck in "systemctl -t service | grep
> > > systemd-fsck@"?
> > I just saw in log:
> > [  OK  ] Found device /dev/mmcblk1p1.
> > Mounting /mnt/sdcard...
> > [8.339072] EXT4-fs (mmcblk1p1): VFS: Found ext4 filesystem with
> > invalid superblock checksum.  Run e2fsck?
> > [FAILED] Failed to mount /mnt/sdcard.
>
> This isn't normal. Your effort should be on finding out why this
> problem is happening in the first place. This doesn't strike me as the
> (somewhat) ordinary case of unclean unmount, which results in journal
> replay at next mount attempt. But something considerably more serious.
Problem is it's very hard to reproduce and this is not rootfs just
external SDcard for storing some data.
If I hit this system goes to emergency mode and device is dead and I
would like to prevent that in first place.
IMO fsck should help to recover this issue and should continue without
issues. Thanks.
>
> --
> Chris Murphy

BR,

marek


-- 
as simple and primitive as possible
-
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] perform fsck on everyt boot

2019-11-20 Thread Chris Murphy
On Tue, Nov 12, 2019 at 3:52 AM Belisko Marek  wrote:
>
> On Mon, Nov 11, 2019 at 4:47 PM Lennart Poettering
>  wrote:
> >
> > On Mo, 11.11.19 13:33, Belisko Marek (marek.beli...@gmail.com) wrote:
> > 65;5802;1c
> > > Hi,
> > >
> > > I'm using systemd 234 (build by yocto) and I've setup automount of
> > > sdcard in fstab. This works perfectly fine. But I have seen from time
> > > to time when system goes to emergency mode because sdcard filesystem
> > > (ext4) have an issue and cannot be mounted. I was thinking about
> > > forcing fsck for every boot. Reading manual it should be enough to set
> > > passno (6th column in fstab) to anything higher then 0. I set ti to 2
> > > but inspecting logs it doesn't seems fsck is performed. Am I still
> > > missing something? Thanks.
> >
> > Well, note that ext4's fsck only does an actual file system check
> > every now and then. Hence: how did you determine fsck wasn't started?
> >
> > Do you see the relevant fsck in "systemctl -t service | grep
> > systemd-fsck@"?
> I just saw in log:
> [  OK  ] Found device /dev/mmcblk1p1.
> Mounting /mnt/sdcard...
> [8.339072] EXT4-fs (mmcblk1p1): VFS: Found ext4 filesystem with
> invalid superblock checksum.  Run e2fsck?
> [FAILED] Failed to mount /mnt/sdcard.

This isn't normal. Your effort should be on finding out why this
problem is happening in the first place. This doesn't strike me as the
(somewhat) ordinary case of unclean unmount, which results in journal
replay at next mount attempt. But something considerably more serious.

-- 
Chris Murphy
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] perform fsck on everyt boot

2019-11-20 Thread Belisko Marek
Hi Andrei,

On Sat, Nov 16, 2019 at 9:31 AM Andrei Borzenkov  wrote:
>
> 12.11.2019 13:52, Belisko Marek пишет:
> > On Mon, Nov 11, 2019 at 4:47 PM Lennart Poettering
> >  wrote:
> >>
> >> On Mo, 11.11.19 13:33, Belisko Marek (marek.beli...@gmail.com) wrote:
> >> 65;5802;1c
> >>> Hi,
> >>>
> >>> I'm using systemd 234 (build by yocto) and I've setup automount of
> >>> sdcard in fstab. This works perfectly fine. But I have seen from time
> >>> to time when system goes to emergency mode because sdcard filesystem
> >>> (ext4) have an issue and cannot be mounted. I was thinking about
> >>> forcing fsck for every boot. Reading manual it should be enough to set
> >>> passno (6th column in fstab) to anything higher then 0. I set ti to 2
> >>> but inspecting logs it doesn't seems fsck is performed. Am I still
> >>> missing something? Thanks.
> >>
> >> Well, note that ext4's fsck only does an actual file system check
> >> every now and then. Hence: how did you determine fsck wasn't started?
> >>
> >> Do you see the relevant fsck in "systemctl -t service | grep
> >> systemd-fsck@"?
> > I just saw in log:
> > [  OK  ] Found device /dev/mmcblk1p1.
> > Mounting /mnt/sdcard...
> > [8.339072] EXT4-fs (mmcblk1p1): VFS: Found ext4 filesystem with
> > invalid superblock checksum.  Run e2fsck?
> > [FAILED] Failed to mount /mnt/sdcard.
> >
> > and then system goes to emergency mode. I inspect logs but cannot see
> > any systemd-fsck process running.
>
> Without seeing /etc/fstab line at the very least anything will be
> guesswork. E.g. systemd will not emit fsck dependency if fstype is set
> to "auto".
Here is line from fstab:
/dev/mmcblk1p1  /mnt/sdcard  auto   defaults  0  0

So I'll update to ext4 and add kernel fsck.mode=force command line it
should perform fsck on every boot? Thanks.
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel


BR,

marek


-- 
as simple and primitive as possible
-
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] perform fsck on everyt boot

2019-11-16 Thread Andrei Borzenkov
12.11.2019 13:52, Belisko Marek пишет:
> On Mon, Nov 11, 2019 at 4:47 PM Lennart Poettering
>  wrote:
>>
>> On Mo, 11.11.19 13:33, Belisko Marek (marek.beli...@gmail.com) wrote:
>> 65;5802;1c
>>> Hi,
>>>
>>> I'm using systemd 234 (build by yocto) and I've setup automount of
>>> sdcard in fstab. This works perfectly fine. But I have seen from time
>>> to time when system goes to emergency mode because sdcard filesystem
>>> (ext4) have an issue and cannot be mounted. I was thinking about
>>> forcing fsck for every boot. Reading manual it should be enough to set
>>> passno (6th column in fstab) to anything higher then 0. I set ti to 2
>>> but inspecting logs it doesn't seems fsck is performed. Am I still
>>> missing something? Thanks.
>>
>> Well, note that ext4's fsck only does an actual file system check
>> every now and then. Hence: how did you determine fsck wasn't started?
>>
>> Do you see the relevant fsck in "systemctl -t service | grep
>> systemd-fsck@"?
> I just saw in log:
> [  OK  ] Found device /dev/mmcblk1p1.
> Mounting /mnt/sdcard...
> [8.339072] EXT4-fs (mmcblk1p1): VFS: Found ext4 filesystem with
> invalid superblock checksum.  Run e2fsck?
> [FAILED] Failed to mount /mnt/sdcard.
> 
> and then system goes to emergency mode. I inspect logs but cannot see
> any systemd-fsck process running.

Without seeing /etc/fstab line at the very least anything will be
guesswork. E.g. systemd will not emit fsck dependency if fstype is set
to "auto".
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] perform fsck on everyt boot

2019-11-12 Thread Belisko Marek
On Mon, Nov 11, 2019 at 4:47 PM Lennart Poettering
 wrote:
>
> On Mo, 11.11.19 13:33, Belisko Marek (marek.beli...@gmail.com) wrote:
> 65;5802;1c
> > Hi,
> >
> > I'm using systemd 234 (build by yocto) and I've setup automount of
> > sdcard in fstab. This works perfectly fine. But I have seen from time
> > to time when system goes to emergency mode because sdcard filesystem
> > (ext4) have an issue and cannot be mounted. I was thinking about
> > forcing fsck for every boot. Reading manual it should be enough to set
> > passno (6th column in fstab) to anything higher then 0. I set ti to 2
> > but inspecting logs it doesn't seems fsck is performed. Am I still
> > missing something? Thanks.
>
> Well, note that ext4's fsck only does an actual file system check
> every now and then. Hence: how did you determine fsck wasn't started?
>
> Do you see the relevant fsck in "systemctl -t service | grep
> systemd-fsck@"?
I just saw in log:
[  OK  ] Found device /dev/mmcblk1p1.
Mounting /mnt/sdcard...
[8.339072] EXT4-fs (mmcblk1p1): VFS: Found ext4 filesystem with
invalid superblock checksum.  Run e2fsck?
[FAILED] Failed to mount /mnt/sdcard.

and then system goes to emergency mode. I inspect logs but cannot see
any systemd-fsck process running.
>
> Lennart
>
> --
> Lennart Poettering, Berlin

BR,

marek


-- 
as simple and primitive as possible
-
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] perform fsck on everyt boot

2019-11-11 Thread Michael Biebl
Am Mo., 11. Nov. 2019 um 16:47 Uhr schrieb Lennart Poettering
:
> Well, note that ext4's fsck only does an actual file system check
> every now and then.

Afair this is outdated knowledge. newer e2fsprogs versions no longer
setup ext4 file systems to do regular fscks.
At least on Debian sid, /etc/mke2fs.conf contains

enable_periodic_fsck = 0

Regards,
Michael


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] perform fsck on everyt boot

2019-11-11 Thread Lennart Poettering
On Mo, 11.11.19 13:33, Belisko Marek (marek.beli...@gmail.com) wrote:
65;5802;1c
> Hi,
>
> I'm using systemd 234 (build by yocto) and I've setup automount of
> sdcard in fstab. This works perfectly fine. But I have seen from time
> to time when system goes to emergency mode because sdcard filesystem
> (ext4) have an issue and cannot be mounted. I was thinking about
> forcing fsck for every boot. Reading manual it should be enough to set
> passno (6th column in fstab) to anything higher then 0. I set ti to 2
> but inspecting logs it doesn't seems fsck is performed. Am I still
> missing something? Thanks.

Well, note that ext4's fsck only does an actual file system check
every now and then. Hence: how did you determine fsck wasn't started?

Do you see the relevant fsck in "systemctl -t service | grep
systemd-fsck@"?

Lennart

--
Lennart Poettering, Berlin
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] perform fsck on everyt boot

2019-11-11 Thread František Šumšal
Hello,

FWIK passno > 0 in /etc/fstab configures only order in which the fsck
is performed, not the frequency. To configure the frequency as well,
I'd recommend taking a look at `man systemd-fsck@.service`, especially
the `fsck.mode=force` kernel command line parameter, which should do
exactly what you're trying to achieve.

On 11/11/19 1:33 PM, Belisko Marek wrote:
> Hi,
> 
> I'm using systemd 234 (build by yocto) and I've setup automount of
> sdcard in fstab. This works perfectly fine. But I have seen from time
> to time when system goes to emergency mode because sdcard filesystem
> (ext4) have an issue and cannot be mounted. I was thinking about
> forcing fsck for every boot. Reading manual it should be enough to set
> passno (6th column in fstab) to anything higher then 0. I set ti to 2
> but inspecting logs it doesn't seems fsck is performed. Am I still
> missing something? Thanks.
> 
> BR,
> 
> marek
> 


-- 
Frantisek Sumsal
GPG key ID: 0xFB738CE27B634E4B



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel

Re: [systemd-devel] perform fsck on everyt boot

2019-11-11 Thread Reindl Harald


Am 11.11.19 um 13:33 schrieb Belisko Marek:
> I'm using systemd 234 (build by yocto) and I've setup automount of
> sdcard in fstab. This works perfectly fine. But I have seen from time
> to time when system goes to emergency mode because sdcard filesystem
> (ext4) have an issue and cannot be mounted. I was thinking about
> forcing fsck for every boot. Reading manual it should be enough to set
> passno (6th column in fstab) to anything higher then 0. I set ti to 2
> but inspecting logs it doesn't seems fsck is performed. Am I still
> missing something? Thanks.

every boot dunno, but every day is simple to set with tune2fs [-i
interval[d|m|w]]
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel