Re: [f2fs-dev] TRIM issue

2020-01-09 Thread Piergiorgio Sartor
Hi,

thanks for the reply, please see my comments
embedded below.

On Wed, Jan 08, 2020 at 06:29:30PM -0800, Jaegeuk Kim wrote:
> Hi,
> 
> On 01/08, Piergiorgio Sartor wrote:
> > Hi all,
> > 
> > I've a small box, with Fedora 31 up-to-date.
> > 
> > The system has LUKS + LVM + f2fs.
> > 
> > Since kernel 5.3.16-300.fc31.x86_64 the fstrim.service,
> > triggered by the systemd service fstrim.timer or from
> > command line, does return an error:
> > 
> > Starting Discard unused blocks on filesystems from /etc/fstab...
> > fstrim: /home: FITRIM ioctl failed: Read-only file system
> > fstrim: /: FITRIM ioctl failed: Read-only file system
> > fstrim.service: Main process exited, code=exited, status=32/n/a
> > fstrim.service: Failed with result 'exit-code'.
> > Failed to start Discard unused blocks on filesystems from /etc/fstab.
> 
> It smells like trying fstrim along with /etc/fstab before mounting the
> partitions?

The error is reported also when running, as root,
the command "systemctl start fstrim.service" from
command line, that is with partitions available.
So, I do not think it is before mounting. Also,
this is usually started weekly from fstrim.timer,
and this requires a running system.
It could be a strange conflict with systemd, but
with ext4 there is no problem, it happens with f2fs.

> > Note the following:
> > 1) Both /home and / are rw
> > 2) LUKS and LVM allow discard to the underlying device
> > 3) An other PC, with same layout, but ext4, does work as expected
> > 4) kernel 5.4.7-200.fc31.x86_64 (latest for f31) has same result
> > 5) fstrim -vA or -va does not return an error, exit code is 0,
> > but it always says 0 (zero) bytes are trimmed:
> > 
> > /home: 0 B (0 bytes) trimmed on /dev/mapper/fedora--server-home
> > /: 0 B (0 bytes) trimmed on /dev/mapper/fedora--server-root
> 
> This is normal. Since f2fs issues discard commands asynchronously, fstrim
> just collects discard candidates and returns right away. Later, it will
> actually issue the candidates in background. Whereas, if it was mounted as
> "-o nodiscard", fstrim will wait for whole discard commands being issued
> and completed as you expect.

OK, I remounted / with "nodiscard", created a 1GB
file, synched the fs, deleted the file and issued
"fstrim -vA".
I can confirm 1GB was trimmed, more precisely 1.1GB
according to "fstrim".

I repeated the test, but instead using "systemctl
start fstrim.service".
Same error as before.
But, a succesive "fstrim -vA" returned only 2.7MB
trimmed.
This could be that the "fstrim" call was executed
properly, but some error report was triggered.
Maybe the read-only file system is not correct,
but something happened.
I would like to stress again that ext4 does not
trigger this error.

So, there is something related with f2fs, at
least with the interaction with fstrim and
systemd.

I have one question.

Since f2fs is mounted with "discard" and, as I
understand it, f2fs will issue discard as soon
as a segment is freed, is it relevant to have
the weekly fstrim from systemd?

Thanks a lot in advance,

bye,

pg

> 
> Thanks,
> 
> > 
> > 6) mount shows that the f2fs mounts have "discard" flag
> > 
> > So, I suspect there is something with f2fs which somehow
> > confuses the trimming process.
> > 
> > I had a quick search, but I could not find any other
> > similar report, except one about systemd, but that
> > does not seem related.
> > 
> > Any idea? Suggestions?
> > Debugging possibilities?
> > 
> > Thanks a lot in advance,
> > 
> > bye,
> > 
> > -- 
> > 
> > piergiorgio
> > 
> > 
> > ___
> > Linux-f2fs-devel mailing list
> > Linux-f2fs-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

-- 

piergiorgio


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


[f2fs-dev] TRIM issue

2020-01-08 Thread Piergiorgio Sartor
Hi all,

I've a small box, with Fedora 31 up-to-date.

The system has LUKS + LVM + f2fs.

Since kernel 5.3.16-300.fc31.x86_64 the fstrim.service,
triggered by the systemd service fstrim.timer or from
command line, does return an error:

Starting Discard unused blocks on filesystems from /etc/fstab...
fstrim: /home: FITRIM ioctl failed: Read-only file system
fstrim: /: FITRIM ioctl failed: Read-only file system
fstrim.service: Main process exited, code=exited, status=32/n/a
fstrim.service: Failed with result 'exit-code'.
Failed to start Discard unused blocks on filesystems from /etc/fstab.

Note the following:
1) Both /home and / are rw
2) LUKS and LVM allow discard to the underlying device
3) An other PC, with same layout, but ext4, does work as expected
4) kernel 5.4.7-200.fc31.x86_64 (latest for f31) has same result
5) fstrim -vA or -va does not return an error, exit code is 0,
but it always says 0 (zero) bytes are trimmed:

/home: 0 B (0 bytes) trimmed on /dev/mapper/fedora--server-home
/: 0 B (0 bytes) trimmed on /dev/mapper/fedora--server-root

6) mount shows that the f2fs mounts have "discard" flag

So, I suspect there is something with f2fs which somehow
confuses the trimming process.

I had a quick search, but I could not find any other
similar report, except one about systemd, but that
does not seem related.

Any idea? Suggestions?
Debugging possibilities?

Thanks a lot in advance,

bye,

-- 

piergiorgio


___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


[f2fs-dev] Cold log explanation

2018-02-10 Thread Piergiorgio Sartor
Hi all,

I noticed that "mkfs.f2fs" has an option, "-e",
to store certain files into the "cold log".

First, basic question, what is the "cold log" or,
better, what is the differnce between the "normal"
("warm", I guess) log and this one.

Second, it is possible to disable this list *after*
filesystem creation?
Maybe even with it mounted?

Thanks a lot in advance,

-- 

piergiorgio

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


[f2fs-dev] f2fs on top ov LV

2018-02-02 Thread Piergiorgio Sartor
Hi all,

I'm planning to prepare a Linux installation
on an USB flash drive.

The idea is to have /boot (with ext, since grub2
does not support f2fs yet) and / with f2fs.
Both on the USB flash drive while /home will be
somewhere else.

Now, I've a backup tool exploiting lvm snapshots
and I would like to use it.

This means / will be on top of an LV.

Does it make any sense to have f2fs over lvm?
Will still be some benefits from f2fs in this
setup?

How about snapshots? Could they cause problems?
Usually the filesystem mounted from lvm snapshot
has consistency issues, which are they usually
solved by journal.
I guess f2fs should be fine, but I would like to
confirm with experts here.

Of course, one possibility would be to use f2fs
on the raw partition, waiting for snapshot to
be implemented.
What's the plan about this?

Thanks a lot for any answers,

bye,

-- 

piergiorgio

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


Re: [f2fs-dev] f2fs not mountable: CRC validation failed

2017-03-27 Thread Piergiorgio Sartor
Hi,

thanks for the answer.

On Sun, Mar 26, 2017 at 04:45:37PM -0700, Jaegeuk Kim wrote:
> Hello,
> 
> On 03/26, Piergiorgio Sartor wrote:
> > Hi all,
> > 
> > I apologize in advance in case this is the
> > wrong place for support (if so, please
> > point me in the right direction).
> > 
> > I've an USB stick formatted with f2fs,
> > used under Linux on a RPi2.
> > To be clear, it is a USB device, not
> > an SD card.
> > 
> > After a crash, the USB stick is not mountable
> > any more.
> > There is no HW error on the stick.
> > 
> > A "fsck" returns, among other information:
> > 
> > [f2fs_crc_valid: 486] CRC validation failed: cal_crc = 3543933224, blk_crc 
> > = 719768680 buff_size = 0xffc
> > [f2fs_crc_valid: 486] CRC validation failed: cal_crc = 1071250051, blk_crc 
> > = 2385854943 buff_size = 0xffc
> > [f2fs_do_mount:2018] Can't find valid checkpoint
> 
> Wow, this means all the checkpoint blocks were corrupted by USB stick, since 
> we
> always guarantee one of them should be valid, which can be used as trusted 
> root
> index. I'm in doubt whether or not USB stick supports cache_flush reliably 
> tho.

Well, it was quite an hard crash, the Rpi2 was
not reachable via ssh and it was lost by the
DNS server (not any more resolvable).
It seems to me it is possible the crash was
so severe to damage the fs indepedently from
the USB stick capabilities...
BTW, it is plenty of reports of SD card damaged
by crash of RPi2.

> If you have a chance, now f2fs supports multiple devices, so you'd better use
> two paritions: one is very small local storage and the other is an USB stick, 
> so
> that local storage keeps superblock and checkpoint more reliably.

Which kernel version support this?
Furthermore, the "small local storage" would be,
in this case, the SD card, which does not seem
to me reliable (if this is required).

> > And it does not perform any check / repair.
> > 
> > I'm a bit puzzled, I wonder if there is way
> > to force a repair, partially could be OK too.
> > 
> > Clearly, "fsck.f2fs -f" did not work.
> > 
> > Any chance to save some data?
> 
> Hmm, fsck.f2fs always starts from valid checkpoint and superblock, so you 
> can't.
> In order to retrieve some data, it needs to scan whole image to get inodes, 
> but
> it looks like another tool that we need to implement.

OK, well, when it will be ready... :-)

In any case, it would be good to have such a
tool, if the fs can be recovered by it.

I think my only option, right now, is to
re-install the system.

> Thanks,

Thank you,

bye,

pg

> > 
> > f2fs-tools is version 1.8.0 (I guess it's latest).
> > 
> > System is Fedora 25, the tool is self compiled.
> > 
> > Thanks a lot in advance, in case other information
> > are required, please let me know.
> > 
> > bye,
> > 
> > -- 
> > 
> > piergiorgio
> > 
> > --
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > ___
> > Linux-f2fs-devel mailing list
> > Linux-f2fs-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

-- 

piergiorgio

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


[f2fs-dev] f2fs not mountable: CRC validation failed

2017-03-26 Thread Piergiorgio Sartor
Hi all,

I apologize in advance in case this is the
wrong place for support (if so, please
point me in the right direction).

I've an USB stick formatted with f2fs,
used under Linux on a RPi2.
To be clear, it is a USB device, not
an SD card.

After a crash, the USB stick is not mountable
any more.
There is no HW error on the stick.

A "fsck" returns, among other information:

[f2fs_crc_valid: 486] CRC validation failed: cal_crc = 3543933224, blk_crc = 
719768680 buff_size = 0xffc
[f2fs_crc_valid: 486] CRC validation failed: cal_crc = 1071250051, blk_crc = 
2385854943 buff_size = 0xffc
[f2fs_do_mount:2018] Can't find valid checkpoint

And it does not perform any check / repair.

I'm a bit puzzled, I wonder if there is way
to force a repair, partially could be OK too.

Clearly, "fsck.f2fs -f" did not work.

Any chance to save some data?

f2fs-tools is version 1.8.0 (I guess it's latest).

System is Fedora 25, the tool is self compiled.

Thanks a lot in advance, in case other information
are required, please let me know.

bye,

-- 

piergiorgio

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel