Re: [systemd-devel] systemd-makefs with very slight data corruption ?

2020-03-31 Thread Lennart Poettering
On Mi, 12.02.20 19:19, Xogium (cont...@xogium.me) wrote:

> Hi,
> I am wondering about how to best implement a mechanism to recreate a specific
> filesystem in case of the slightest data corruption done to it. From what I 
> read
> in systemd-makefs manpage, the tool will not trigger if it can detect that a
> filesystem is already present. However I'm thinking that in some case, the 
> data
> can get corrupted, yet the filesystem still is reported as ext4 to makefs.
> Perhaps I understood wrong, in which case, could I somehow order 
> systemd-makefs
> to be ran only if either systemd-fsck fails, or if mounting fails ? This
> filesystem can easily get corrupted due to power loss, and isn't important for
> the entire system to work, however it would be nicer if this could be detected
> and delt with accordingly.

This is currently not supported. Consider filing an RFE issue on
github asking for this, this appears to make sense to me. I mean
systemd-fsck could just do what systemd-makefs does depending on the
exit code of /sbin/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] systemd-makefs with very slight data corruption ?

2020-02-12 Thread Chuck Wolber
On Wed, Feb 12, 2020 at 10:31 AM Xogium  wrote:


> I am wondering about how to best implement a mechanism to recreate a
> specific
> filesystem in case of the slightest data corruption done to it.
>

I am not sure if there is a built-in method to do what you are asking, but
I think you could
use a drop-in to do it. Simply use a drop-in to add a requires/after into
systemd-makefs
for a service of your own. Your service would do whatever checks you want
and, if
necessary, wipe out the file system altogether, which would then trigger
systemd-makefs
to rebuild it.

You would, of course, need to be careful to write your service
intelligently enough to avoid
wiping out file systems you care to keep around...

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


[systemd-devel] systemd-makefs with very slight data corruption ?

2020-02-12 Thread Xogium
Hi,
I am wondering about how to best implement a mechanism to recreate a specific 
filesystem in case of the slightest data corruption done to it. From what I 
read 
in systemd-makefs manpage, the tool will not trigger if it can detect that a 
filesystem is already present. However I'm thinking that in some case, the data 
can get corrupted, yet the filesystem still is reported as ext4 to makefs. 
Perhaps I understood wrong, in which case, could I somehow order systemd-makefs 
to be ran only if either systemd-fsck fails, or if mounting fails ? This 
filesystem can easily get corrupted due to power loss, and isn't important for 
the entire system to work, however it would be nicer if this could be detected 
and delt with accordingly.
Thanks !
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel