linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] Questions about using f2fs to format the root partition during Slint installation.
@ 2020-06-24 22:17 Didier Spaier
  2020-06-25  0:35 ` Jaegeuk Kim
  0 siblings, 1 reply; 5+ messages in thread
From: Didier Spaier @ 2020-06-24 22:17 UTC (permalink / raw)
  To: linux-f2fs-devel

Hello list,

this email is a follow-up of:
https://www.mail-archive.com/linux-f2fs-devel@lists.sourceforge.net/msg14390.html

I will number the questions Q1, Q2 etc.

To summarize the context and goal: I want that the Slint installer
format the root partition with f2fs when appropriate, if possible
without asking questions to the user about the device.

I target usage of f2fs for the root file system in cases of USB flash
drives aka USB sticks, SD cards, eMMC, as if I understand correctly
these kinds of devices benefit the most of wear minimization and
increase of performance when using f2fs. I plan to use ext4 for SSD
(including NVMe) and hard disks.

This leads to several questions:

Q1: Comments about this choice of target devices for f2fs, knowing that
I favor security over performances and that the "auto" option of the
installer is intended for your grand-mother? I am a grand father myself
<smile>.

Q2. How-to determine if the drive fall in one of the types listed above
without asking the user if possible?

I have considered using the output of lsblk and/or "udevadm info" but
that doesn't seem to provide enough information on the device.

As an aside, I have seen rota=1 for an USB boot stick. ??? 

Q3. What would be the safest options to include in the relevant line of
/etc/fstab forthe root partition using f2fs?

Q4. do you confirm the statement below? it is a quote of web page:
https://wiki.gentoo.org/wiki/F2FS
> When using f2fs > When using f2fs as rootfs fsck fails on boot.
> Solutions are either disabling fsck in /etc/fstab (setting the last
> number to 0) or enabling the force-flag for fsck in /etc/conf.d/fsck.
> See bug #671786

Q5. I am correct f2fs can be expanded but not shrinked. Is it still
true? Will it planned to bring this feature?

Q6. Currently we ship a 4.19 kernel. Would it be preferable to ship a
5.4 one instead shipped in Slackware-current at time of writing, knowing
that we ship an no patched (aka vanilla) kernel and what would be the
benefit of doing so wrt f2fs?

Have a good day,

Didier



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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [f2fs-dev] Questions about using f2fs to format the root partition during Slint installation.
  2020-06-24 22:17 [f2fs-dev] Questions about using f2fs to format the root partition during Slint installation Didier Spaier
@ 2020-06-25  0:35 ` Jaegeuk Kim
  2020-08-23 15:53   ` Didier Spaier
  0 siblings, 1 reply; 5+ messages in thread
From: Jaegeuk Kim @ 2020-06-25  0:35 UTC (permalink / raw)
  To: Didier Spaier; +Cc: linux-f2fs-devel

Hi,

On 06/25, Didier Spaier wrote:
> Hello list,
> 
> this email is a follow-up of:
> https://www.mail-archive.com/linux-f2fs-devel@lists.sourceforge.net/msg14390.html
> 
> I will number the questions Q1, Q2 etc.
> 
> To summarize the context and goal: I want that the Slint installer
> format the root partition with f2fs when appropriate, if possible
> without asking questions to the user about the device.
> 
> I target usage of f2fs for the root file system in cases of USB flash
> drives aka USB sticks, SD cards, eMMC, as if I understand correctly
> these kinds of devices benefit the most of wear minimization and
> increase of performance when using f2fs. I plan to use ext4 for SSD
> (including NVMe) and hard disks.
> 
> This leads to several questions:
> 
> Q1: Comments about this choice of target devices for f2fs, knowing that
> I favor security over performances and that the "auto" option of the
> installer is intended for your grand-mother? I am a grand father myself
> <smile>.

Which security and performance feature do you want to use in the system?
For example, mkfs.f2fs requires some options like:
- fscrypt : -O encrypt
- quota : -O quota
- fsverity : -O verity
- compression : -O compression -O extra_attr
- casefolding : -O casefold -C utf8

> 
> Q2. How-to determine if the drive fall in one of the types listed above
> without asking the user if possible?
> 
> I have considered using the output of lsblk and/or "udevadm info" but
> that doesn't seem to provide enough information on the device.
> 
> As an aside, I have seen rota=1 for an USB boot stick. ??? 

I don't have a good idea to detect this. Maybe by measuring write bandwidth
and checking IO interface?

> 
> Q3. What would be the safest options to include in the relevant line of
> /etc/fstab forthe root partition using f2fs?

default + any features that you're interested in?
We've been using the below option for several years in Android.
https://android.googlesource.com/device/google/coral/+/refs/heads/master/fstab.hardware#11

> 
> Q4. do you confirm the statement below? it is a quote of web page:
> https://wiki.gentoo.org/wiki/F2FS
> > When using f2fs > When using f2fs as rootfs fsck fails on boot.
> > Solutions are either disabling fsck in /etc/fstab (setting the last
> > number to 0) or enabling the force-flag for fsck in /etc/conf.d/fsck.
> > See bug #671786

Yes, likewise e2fsprogs, fsck.f2fs doesn't allow to open ro-mounted disk
with "-a". But we added a patch to allow it with "-f".

> 
> Q5. I am correct f2fs can be expanded but not shrinked. Is it still
> true? Will it planned to bring this feature?

That can be done by ioctl() in runtime since v5.3.
https://lore.kernel.org/linux-f2fs-devel/20190711171336.GA66396@jaegeuk-macbookpro.roam.corp.google.com/#r

> 
> Q6. Currently we ship a 4.19 kernel. Would it be preferable to ship a
> 5.4 one instead shipped in Slackware-current at time of writing, knowing
> that we ship an no patched (aka vanilla) kernel and what would be the
> benefit of doing so wrt f2fs?

v5.4 would be better, and if you have some time, it'd be great to sync
my backporting patches from the below branches. These are all mirrored to
Android common kernels as well.

https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-stable.git/log/?h=linux-5.4.y
https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-stable.git/log/?h=linux-4.19.y
https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-stable.git/log/?h=linux-4.14.y

Thanks,


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [f2fs-dev] Questions about using f2fs to format the root partition during Slint installation.
  2020-06-25  0:35 ` Jaegeuk Kim
@ 2020-08-23 15:53   ` Didier Spaier
  2020-08-31 17:42     ` Jaegeuk Kim
  0 siblings, 1 reply; 5+ messages in thread
From: Didier Spaier @ 2020-08-23 15:53 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: linux-f2fs-devel

Hi,

thanks for your answer, which leads to more questions and a request.

I will quote only the relevant parts of this answer below.

Le 25/06/2020 à 02:35, Jaegeuk Kim a écrit :
> On 06/25, Didier Spaier wrote:

>> this email is a follow-up of:
>> https://www.mail-archive.com/linux-f2fs-devel@lists.sourceforge.net/msg14390.html

...

>> Q1: Comments about this choice of target devices for f2fs, knowing that
>> I favor security over performances and that the "auto" option of the
>> installer is intended for your grand-mother? I am a grand father myself
>> <smile>.
> 
> Which security and performance feature do you want to use in the system?
> For example, mkfs.f2fs requires some options like:
> - fscrypt : -O encrypt
> - quota : -O quota
> - fsverity : -O verity
> - compression : -O compression -O extra_attr
> - casefolding : -O casefold -C utf8
Do I understand well that these features are defined in f2fs.h?
In Linux 5.4.60:
#define F2FS_FEATURE_ENCRYPT		0x0001
#define F2FS_FEATURE_BLKZONED		0x0002
#define F2FS_FEATURE_ATOMIC_WRITE	0x0004
#define F2FS_FEATURE_EXTRA_ATTR		0x0008
#define F2FS_FEATURE_PRJQUOTA		0x0010
#define F2FS_FEATURE_INODE_CHKSUM	0x0020
#define F2FS_FEATURE_FLEXIBLE_INLINE_XATTR	0x0040
#define F2FS_FEATURE_QUOTA_INO		0x0080
#define F2FS_FEATURE_INODE_CRTIME	0x0100
#define F2FS_FEATURE_LOST_FOUND		0x0200
#define F2FS_FEATURE_VERITY		0x0400
#define F2FS_FEATURE_SB_CHKSUM		0x0800
#define F2FS_FEATURE_CASEFOLD		0x1000
  
I ask because I don't see them listed in a man page where I would have
expected to find them, like mkfs.f2fs (8) or mount (8)

I don't see them listed in:
https://github.com/torvalds/linux/blob/master/Documentation/filesystems/f2fs.rst

... 

>> Q3. What would be the safest options to include in the relevant line of
>> /etc/fstab forthe root partition using f2fs?
> 
> default + any features that you're interested in?
> We've been using the below option for several years in Android.
> https://android.googlesource.com/device/google/coral/+/refs/heads/master/fstab.hardware#11

The mount flags and options are described in f2fs.rst but I don't expect a
casual user to read that.

So I suggest that all the mount options specific to f2fs be listed in an
document intended for end users (man f2fs?) as that could help favor its
adoption by Linux distributions as an alternative to ext4 when relevant.

Maybe you could consult with util-linux devs, as man mount is part of the
util-linux package; to just add a line to the text quoted below?

FILESYSTEM-SPECIFIC MOUNT OPTIONS
       This section lists options that are specific to particular
       filesystems.  Where  possible, you  should  first  consult
       filesystem-specific manual pages for details.  Some of those pages
       are listed in the following table.
              
       Filesystem(s)      Manual page
       btrfs              btrfs(5)
       cifs               mount.cifs(8)
       ext2, ext3, ext4   ext4(5)
       fuse               fuse(8)
       nfs                nfs(5)
       tmpfs              tmpfs(5)
       xfs                xfs(5)

the added line would just be for instance:

       f2fs               f2fs(8)

Indeed 

I know I should propose to contribute writing man f2fs, unfortunately my
knowledge of f2fs is very close to non existent.

Incidentally, the options listed in
https://android.googlesource.com/device/google/coral/+/refs/heads/master/fstab.hardware#11
indicate that f2fs is only used for the partition mounted as /data.

I don't know Android at all but thought that /system is more or less the
equivalent of root (/) in other Linux distributions. If that's the case,
why not us also f2fs for it? Maybe I am fully wrong, please correct me.
I would be grateful for any pointer to a document explaining the purposes
of the various mount points in Android as they differ from the FHS:
https://refspecs.linuxfoundation.org/fhs.shtml

Best regards,

Didier
  





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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [f2fs-dev] Questions about using f2fs to format the root partition during Slint installation.
  2020-08-23 15:53   ` Didier Spaier
@ 2020-08-31 17:42     ` Jaegeuk Kim
  2020-09-01 22:50       ` Didier Spaier
  0 siblings, 1 reply; 5+ messages in thread
From: Jaegeuk Kim @ 2020-08-31 17:42 UTC (permalink / raw)
  To: Didier Spaier; +Cc: linux-f2fs-devel

Hi,

On 08/23, Didier Spaier wrote:
> Hi,
> 
> thanks for your answer, which leads to more questions and a request.
> 
> I will quote only the relevant parts of this answer below.
> 
> Le 25/06/2020 à 02:35, Jaegeuk Kim a écrit :
> > On 06/25, Didier Spaier wrote:
> 
> >> this email is a follow-up of:
> >> https://www.mail-archive.com/linux-f2fs-devel@lists.sourceforge.net/msg14390.html
> 
> ...
> 
> >> Q1: Comments about this choice of target devices for f2fs, knowing that
> >> I favor security over performances and that the "auto" option of the
> >> installer is intended for your grand-mother? I am a grand father myself
> >> <smile>.
> > 
> > Which security and performance feature do you want to use in the system?
> > For example, mkfs.f2fs requires some options like:
> > - fscrypt : -O encrypt
> > - quota : -O quota
> > - fsverity : -O verity
> > - compression : -O compression -O extra_attr
> > - casefolding : -O casefold -C utf8
> Do I understand well that these features are defined in f2fs.h?
> In Linux 5.4.60:
> #define F2FS_FEATURE_ENCRYPT		0x0001
> #define F2FS_FEATURE_BLKZONED		0x0002
> #define F2FS_FEATURE_ATOMIC_WRITE	0x0004
> #define F2FS_FEATURE_EXTRA_ATTR		0x0008
> #define F2FS_FEATURE_PRJQUOTA		0x0010
> #define F2FS_FEATURE_INODE_CHKSUM	0x0020
> #define F2FS_FEATURE_FLEXIBLE_INLINE_XATTR	0x0040
> #define F2FS_FEATURE_QUOTA_INO		0x0080
> #define F2FS_FEATURE_INODE_CRTIME	0x0100
> #define F2FS_FEATURE_LOST_FOUND		0x0200
> #define F2FS_FEATURE_VERITY		0x0400
> #define F2FS_FEATURE_SB_CHKSUM		0x0800
> #define F2FS_FEATURE_CASEFOLD		0x1000
>   
> I ask because I don't see them listed in a man page where I would have
> expected to find them, like mkfs.f2fs (8) or mount (8)
> 
> I don't see them listed in:
> https://github.com/torvalds/linux/blob/master/Documentation/filesystems/f2fs.rst
> 
> ... 

Sorry for inconvenience. Let me enhance documentation a bit.

> 
> >> Q3. What would be the safest options to include in the relevant line of
> >> /etc/fstab forthe root partition using f2fs?
> > 
> > default + any features that you're interested in?
> > We've been using the below option for several years in Android.
> > https://android.googlesource.com/device/google/coral/+/refs/heads/master/fstab.hardware#11
> 
> The mount flags and options are described in f2fs.rst but I don't expect a
> casual user to read that.
> 
> So I suggest that all the mount options specific to f2fs be listed in an
> document intended for end users (man f2fs?) as that could help favor its
> adoption by Linux distributions as an alternative to ext4 when relevant.
> 
> Maybe you could consult with util-linux devs, as man mount is part of the
> util-linux package; to just add a line to the text quoted below?
> 
> FILESYSTEM-SPECIFIC MOUNT OPTIONS
>        This section lists options that are specific to particular
>        filesystems.  Where  possible, you  should  first  consult
>        filesystem-specific manual pages for details.  Some of those pages
>        are listed in the following table.
>               
>        Filesystem(s)      Manual page
>        btrfs              btrfs(5)
>        cifs               mount.cifs(8)
>        ext2, ext3, ext4   ext4(5)
>        fuse               fuse(8)
>        nfs                nfs(5)
>        tmpfs              tmpfs(5)
>        xfs                xfs(5)
> 
> the added line would just be for instance:
> 
>        f2fs               f2fs(8)

It seems recent "man mount(8)" moves to guide Documentation/filesystems as well.
But, I think I need to prepare a sort of "man f2fs(5)" in f2fs-tools.

FILESYSTEM-SPECIFIC MOUNT OPTIONS
       You should consult the respective man page for the filesystem first.  If you want to know what options  the  ext4
       filesystem  supports, then check the ext4(5) man page.  If that doesn't exist, you can also check the correspond‐
       ing mount page like mount.cifs(8).  Note that you might have to install the respective userland tools.

       The following options apply only to certain filesystems.  We sort them by filesystem.  They  all  follow  the  -o
       flag.

       What options are supported depends a bit on the running kernel.  More info may be found in the kernel source sub‐
       directory Documentation/filesystems.

> 
> Indeed 
> 
> I know I should propose to contribute writing man f2fs, unfortunately my
> knowledge of f2fs is very close to non existent.
> 
> Incidentally, the options listed in
> https://android.googlesource.com/device/google/coral/+/refs/heads/master/fstab.hardware#11
> indicate that f2fs is only used for the partition mounted as /data.
> 
> I don't know Android at all but thought that /system is more or less the
> equivalent of root (/) in other Linux distributions. If that's the case,
> why not us also f2fs for it? Maybe I am fully wrong, please correct me.
> I would be grateful for any pointer to a document explaining the purposes
> of the various mount points in Android as they differ from the FHS:
> https://refspecs.linuxfoundation.org/fhs.shtml

Android /system is a read-only partition which provides a device boot-up, while
all the data for applications and users are stored in /data as read-write.
For now, there's no strong motivation to replace the filesystem for /system. :)

> 
> Best regards,
> 
> Didier
>   
> 
> 


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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [f2fs-dev] Questions about using f2fs to format the root partition during Slint installation.
  2020-08-31 17:42     ` Jaegeuk Kim
@ 2020-09-01 22:50       ` Didier Spaier
  0 siblings, 0 replies; 5+ messages in thread
From: Didier Spaier @ 2020-09-01 22:50 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: linux-f2fs-devel

Hi,

Le 31/08/2020 à 19:42, Jaegeuk Kim a écrit :
> Hi,
> 
> On 08/23, Didier Spaier wrote:
>> Hi,
>>
>> thanks for your answer, which leads to more questions and a request.
>>
>> I will quote only the relevant parts of this answer below.
>>
>> Le 25/06/2020 à 02:35, Jaegeuk Kim a écrit :
>>> On 06/25, Didier Spaier wrote:
>>
>>>> this email is a follow-up of:
>>>> https://www.mail-archive.com/linux-f2fs-devel@lists.sourceforge.net/msg14390.html
>>
>> ...
>>
>>>> Q1: Comments about this choice of target devices for f2fs, knowing that
>>>> I favor security over performances and that the "auto" option of the
>>>> installer is intended for your grand-mother? I am a grand father myself
>>>> <smile>.
>>>
>>> Which security and performance feature do you want to use in the system?
>>> For example, mkfs.f2fs requires some options like:
>>> - fscrypt : -O encrypt
>>> - quota : -O quota
>>> - fsverity : -O verity
>>> - compression : -O compression -O extra_attr
>>> - casefolding : -O casefold -C utf8
>> Do I understand well that these features are defined in f2fs.h?
>> In Linux 5.4.60:
>> #define F2FS_FEATURE_ENCRYPT		0x0001
>> #define F2FS_FEATURE_BLKZONED		0x0002
>> #define F2FS_FEATURE_ATOMIC_WRITE	0x0004
>> #define F2FS_FEATURE_EXTRA_ATTR		0x0008
>> #define F2FS_FEATURE_PRJQUOTA		0x0010
>> #define F2FS_FEATURE_INODE_CHKSUM	0x0020
>> #define F2FS_FEATURE_FLEXIBLE_INLINE_XATTR	0x0040
>> #define F2FS_FEATURE_QUOTA_INO		0x0080
>> #define F2FS_FEATURE_INODE_CRTIME	0x0100
>> #define F2FS_FEATURE_LOST_FOUND		0x0200
>> #define F2FS_FEATURE_VERITY		0x0400
>> #define F2FS_FEATURE_SB_CHKSUM		0x0800
>> #define F2FS_FEATURE_CASEFOLD		0x1000
>>   
>> I ask because I don't see them listed in a man page where I would have
>> expected to find them, like mkfs.f2fs (8) or mount (8)
>>
>> I don't see them listed in:
>> https://github.com/torvalds/linux/blob/master/Documentation/filesystems/f2fs.rst
>>
>> ... 
> 
> Sorry for inconvenience. Let me enhance documentation a bit.

Thanks in advance. I know that it takes time to update documentation
and that you are busy enough already. 

>>>> Q3. What would be the safest options to include in the relevant line of
>>>> /etc/fstab forthe root partition using f2fs?
>>>
>>> default + any features that you're interested in?
>>> We've been using the below option for several years in Android.
>>> https://android.googlesource.com/device/google/coral/+/refs/heads/master/fstab.hardware#11
>>
>> The mount flags and options are described in f2fs.rst but I don't expect a
>> casual user to read that.
>>
>> So I suggest that all the mount options specific to f2fs be listed in an
>> document intended for end users (man f2fs?) as that could help favor its
>> adoption by Linux distributions as an alternative to ext4 when relevant.
>>
>> Maybe you could consult with util-linux devs, as man mount is part of the
>> util-linux package; to just add a line to the text quoted below?
>>
>> FILESYSTEM-SPECIFIC MOUNT OPTIONS
>>        This section lists options that are specific to particular
>>        filesystems.  Where  possible, you  should  first  consult
>>        filesystem-specific manual pages for details.  Some of those pages
>>        are listed in the following table.
>>               
>>        Filesystem(s)      Manual page
>>        btrfs              btrfs(5)
>>        cifs               mount.cifs(8)
>>        ext2, ext3, ext4   ext4(5)
>>        fuse               fuse(8)
>>        nfs                nfs(5)
>>        tmpfs              tmpfs(5)
>>        xfs                xfs(5)
>>
>> the added line would just be for instance:
>>
>>        f2fs               f2fs(8)
> 
> It seems recent "man mount(8)" moves to guide Documentation/filesystems as well.
> But, I think I need to prepare a sort of "man f2fs(5)" in f2fs-tools.

I'd be glad for that, should be very useful.

> FILESYSTEM-SPECIFIC MOUNT OPTIONS
>        You should consult the respective man page for the filesystem first.  If you want to know what options  the  ext4
>        filesystem  supports, then check the ext4(5) man page.  If that doesn't exist, you can also check the correspond‐
>        ing mount page like mount.cifs(8).  Note that you might have to install the respective userland tools.
> 
>        The following options apply only to certain filesystems.  We sort them by filesystem.  They  all  follow  the  -o
>        flag.
> 
>        What options are supported depends a bit on the running kernel.  More info may be found in the kernel source sub‐
>        directory Documentation/filesystems.
> 
>>
>> Indeed 
>>
>> I know I should propose to contribute writing man f2fs, unfortunately my
>> knowledge of f2fs is very close to non existent.
>>
>> Incidentally, the options listed in
>> https://android.googlesource.com/device/google/coral/+/refs/heads/master/fstab.hardware#11
>> indicate that f2fs is only used for the partition mounted as /data.
>>
>> I don't know Android at all but thought that /system is more or less the
>> equivalent of root (/) in other Linux distributions. If that's the case,
>> why not us also f2fs for it? Maybe I am fully wrong, please correct me.
>> I would be grateful for any pointer to a document explaining the purposes
>> of the various mount points in Android as they differ from the FHS:
>> https://refspecs.linuxfoundation.org/fhs.shtml
> 
> Android /system is a read-only partition which provides a device boot-up, while
> all the data for applications and users are stored in /data as read-write.
> For now, there's no strong motivation to replace the filesystem for /system. :)
> 
>>
>> Best regards,
>>
>> Didier



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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-01 22:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-24 22:17 [f2fs-dev] Questions about using f2fs to format the root partition during Slint installation Didier Spaier
2020-06-25  0:35 ` Jaegeuk Kim
2020-08-23 15:53   ` Didier Spaier
2020-08-31 17:42     ` Jaegeuk Kim
2020-09-01 22:50       ` Didier Spaier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).