Skip to contentSkip to conversation

Enforce 4k sectorize by default for mkfs

PATCH In review Neal Gompa 8 participants 14 messages Nov 16, 2023 – Jan 5, 2024

Subsystems (2)
lore
Share & tools
lore

Neal Gompa

author
#0 lore raw

v4 cover Enforce 4k sectorize by default for mkfs

The Fedora Asahi SIG[0] is working on bringing up support for Apple Silicon Macintosh computers through the Fedora Asahi Remix[1].

Apple Silicon Macs are unusual in that they currently require 16k page sizes, which means that the current default for mkfs.btrfs(8) makes a filesystem that is unreadable on x86 PCs and most other ARM PCs.

This is now even more of a problem within Apple Silicon Macs as it is now possible to nest 4K Fedora Linux VMs on 16K Fedora Asahi Remix machines to enable performant x86 emulation[2] and the host storage needs to be compatible for both environments.

Thus, I'd like to see us finally make the switchover to 4k sectorsize for new filesystems by default, regardless of page size.

The initial test run by Hector Martin[3] at request of Qu Wenruo looked promising[4], and we've been running with this behavior on Fedora Linux since Fedora Linux 36 (at around 6.2) with no issues.

=== Changelog ===

v4: Fixed minor errors in the cover letter and patch subject

v3: Refreshed cover letter, rebased to latest, updated doc references for v6.7

v2: Rebased to latest, updated doc references for v6.6

Final v1: Collected Reviewed-by tags for inclusion.

RFC v2: Addressed documentation feedback

RFC v1: Initial submission

[0]: https://fedoraproject.org/wiki/SIGs/Asahi
[1]: https://fedora-asahi-remix.org/
[2]: https://sinrega.org/2023-10-06-using-microvms-for-gaming-on-fedora-asahi/
[3]: https://lore.kernel.org/linux-btrfs/[email protected]/T/#m11d7939de96c43b3a7cdabc7c568d8bcafc7ca83
[4]: https://lore.kernel.org/linux-btrfs/[email protected]/T/#mf382b78a8122b0cb82147a536c85b6a9098a2895

Neal Gompa (1):
btrfs-progs: mkfs: Enforce 4k sectorsize by default

 Documentation/Subpage.rst    | 15 ++++++++-------
 Documentation/mkfs.btrfs.rst | 13 +++++++++----
 mkfs/main.c                  |  2 +-
 3 files changed, 18 insertions(+), 12 deletions(-)
Signature · 1 line
2.39.2
author
#1 lore raw

PATCH v4 1/1 btrfs-progs: mkfs: Enforce 4k sectorsize by default

We have had working subpage support in Btrfs for many cycles now. Generally, we do not want people creating filesystems by default with non-4k sectorsizes since it creates portability problems.

---
 Documentation/Subpage.rst    | 17 +++++++++--------
 Documentation/mkfs.btrfs.rst | 13 +++++++++----
 mkfs/main.c                  |  2 +-
 3 files changed, 19 insertions(+), 13 deletions(-)
Documentation/Subpage.rst +9 -8
index c762b6a3..1655ae7e 100644
@@ -9,18 +9,19 @@ to the exactly same size of the block and page. On x86_64 this is typically
 pages, like 64KiB on 64bit ARM or PowerPC. This means filesystems created
 with 64KiB sector size cannot be mounted on a system with 4KiB page size.
 
-While with subpage support systems with 64KiB page size can create
-and mount filesystems with 4KiB sectorsize.  This still needs to use option "-s
-4k" option for :command:`mkfs.btrfs`.
+Since v6.7, filesystems are created with a 4KiB sectorsize by default,
+though it remains possible to create filesystems with other page sizes
+(such as 64KiB with the "-s 64k" option for :command:`mkfs.btrfs`). This
+ensures that new filesystems are compatible across other architecture
+variants using larger page sizes.
 
 Requirements, limitations
 -------------------------
 
-The initial subpage support has been added in v5.15, although it's still
-considered as experimental, most features are already working without problems.
-On a 64KiB page system filesystem with 4KiB sectorsize can be mounted and used
-as usual as long as the initial mount succeeds. There are cases a mount will be
-rejected when verifying compatible features.
+The initial subpage support has been added in v5.15. Most features are
+already working without problems. On a 64KiB page system, a filesystem with
+4KiB sectorsize can be mounted and used as long as the initial mount succeeds.
+Subpage support is used by default for systems with a non-4KiB page size since v6.7.
 
 Please refer to status page of :ref:`status-subpage-block-size` for
 compatibility.
Documentation/mkfs.btrfs.rst +9 -4
index 7e23b9f6..be4f49cb 100644
@@ -122,10 +122,15 @@ OPTIONS
 -s|--sectorsize <size>
         Specify the sectorsize, the minimum data block allocation unit.
 
-        The default value is the page size and is autodetected. If the sectorsize
-        differs from the page size, the created filesystem may not be mountable by the
-        running kernel. Therefore it is not recommended to use this option unless you
-        are going to mount it on a system with the appropriate page size.
+        By default, the value is 4KiB, but it can be manually set to match the
+        system page size. However, if the sector size is different from the page
+        size, the resulting filesystem may not be mountable by the current
+        kernel, apart from the default 4KiB. Hence, using this option is not
+        advised unless you intend to mount it on a system with the suitable
+        page size.
+
+        .. note::
+                Versions prior to 6.7 set the sectorsize matching to the page size.
 
 -L|--label <string>
         Specify a label for the filesystem. The *string* should be less than 256
mkfs/main.c +1 -1
index d984c995..0570c8f8 100644
@@ -1384,7 +1384,7 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
 	}
 
 	if (!sectorsize)
-		sectorsize = (u32)sysconf(_SC_PAGESIZE);
+		sectorsize = (u32)SZ_4K;
 	if (btrfs_check_sectorsize(sectorsize))
 		goto error;
 
Signature · 1 line
2.41.0
Reviewed-by on v4 1/1
#2 lore raw

Re: [PATCH v4 1/1] btrfs-progs: mkfs: Enforce 4k sectorsize by default

Quoted 10 lines · Neal Gompa

We have had working subpage support in Btrfs for many cycles now. Generally, we do not want people creating filesystems by default with non-4k sectorsizes since it creates portability problems.

Makes sense to me!

Is mise le meas/Regards,

Eric Curtin

Quoted 79 lines
---
 Documentation/Subpage.rst    | 17 +++++++++--------
 Documentation/mkfs.btrfs.rst | 13 +++++++++----
 mkfs/main.c                  |  2 +-
 3 files changed, 19 insertions(+), 13 deletions(-)
Documentation/Subpage.rst +9 -8
index c762b6a3..1655ae7e 100644
@@ -9,18 +9,19 @@ to the exactly same size of the block and page. On x86_64 this is typically
 pages, like 64KiB on 64bit ARM or PowerPC. This means filesystems created
 with 64KiB sector size cannot be mounted on a system with 4KiB page size.
 
-While with subpage support systems with 64KiB page size can create
-and mount filesystems with 4KiB sectorsize.  This still needs to use option "-s
-4k" option for :command:`mkfs.btrfs`.
+Since v6.7, filesystems are created with a 4KiB sectorsize by default,
+though it remains possible to create filesystems with other page sizes
+(such as 64KiB with the "-s 64k" option for :command:`mkfs.btrfs`). This
+ensures that new filesystems are compatible across other architecture
+variants using larger page sizes.
 
 Requirements, limitations
 -------------------------
 
-The initial subpage support has been added in v5.15, although it's still
-considered as experimental, most features are already working without problems.
-On a 64KiB page system filesystem with 4KiB sectorsize can be mounted and used
-as usual as long as the initial mount succeeds. There are cases a mount will be
-rejected when verifying compatible features.
+The initial subpage support has been added in v5.15. Most features are
+already working without problems. On a 64KiB page system, a filesystem with
+4KiB sectorsize can be mounted and used as long as the initial mount succeeds.
+Subpage support is used by default for systems with a non-4KiB page size since v6.7.
 
 Please refer to status page of :ref:`status-subpage-block-size` for
 compatibility.
Documentation/mkfs.btrfs.rst +9 -4
index 7e23b9f6..be4f49cb 100644
@@ -122,10 +122,15 @@ OPTIONS
 -s|--sectorsize <size>
         Specify the sectorsize, the minimum data block allocation unit.
 
-        The default value is the page size and is autodetected. If the sectorsize
-        differs from the page size, the created filesystem may not be mountable by the
-        running kernel. Therefore it is not recommended to use this option unless you
-        are going to mount it on a system with the appropriate page size.
+        By default, the value is 4KiB, but it can be manually set to match the
+        system page size. However, if the sector size is different from the page
+        size, the resulting filesystem may not be mountable by the current
+        kernel, apart from the default 4KiB. Hence, using this option is not
+        advised unless you intend to mount it on a system with the suitable
+        page size.
+
+        .. note::
+                Versions prior to 6.7 set the sectorsize matching to the page size.
 
 -L|--label <string>
         Specify a label for the filesystem. The *string* should be less than 256
mkfs/main.c +1 -2
index d984c995..0570c8f8 100644
@@ -1384,7 +1384,7 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
        }
 
        if (!sectorsize)
-               sectorsize = (u32)sysconf(_SC_PAGESIZE);
+               sectorsize = (u32)SZ_4K;
        if (btrfs_check_sectorsize(sectorsize))
                goto error;
 
--

2.41.0

#3 lore raw
In reply to Neal Gompa
Quoted 13 lines · Neal Gompa

The Fedora Asahi SIG[0] is working on bringing up support for Apple Silicon Macintosh computers through the Fedora Asahi Remix[1].

Apple Silicon Macs are unusual in that they currently require 16k page sizes, which means that the current default for mkfs.btrfs(8) makes a filesystem that is unreadable on x86 PCs and most other ARM PCs.

This is now even more of a problem within Apple Silicon Macs as it is now possible to nest 4K Fedora Linux VMs on 16K Fedora Asahi Remix machines to enable performant x86 emulation[2] and the host storage needs to be compatible for both environments.

Quoted 7 lines

Thus, I'd like to see us finally make the switchover to 4k sectorsize for new filesystems by default, regardless of page size.

The initial test run by Hector Martin[3] at request of Qu Wenruo looked promising[4], and we've been running with this behavior on Fedora Linux since Fedora Linux 36 (at around 6.2) with no issues.

This is a good change and well documented. This isn't being ignored, it's just a policy change that we have to be conservative about considering. We only in the last 3 months have added a Apple Silicon machine to our testing infrastructure (running Fedora Asahi fwiw) to make sure we're getting consistent subpage-blocksize testing. Generally speaking it's been fine, we've fixed a few things and haven't broken anything, but it's still comes with some risks when compared to the default of using the pagesize.

We will continue to discuss this amongst ourselves and figure out what we think would be a reasonable timeframe to make this switch and let you know what we're thinking ASAP. Thanks,

Josef

#4 lore raw
Quoted 30 lines · Josef Bacik
Quoted 13 lines · Neal Gompa

The Fedora Asahi SIG[0] is working on bringing up support for Apple Silicon Macintosh computers through the Fedora Asahi Remix[1].

Apple Silicon Macs are unusual in that they currently require 16k page sizes, which means that the current default for mkfs.btrfs(8) makes a filesystem that is unreadable on x86 PCs and most other ARM PCs.

This is now even more of a problem within Apple Silicon Macs as it is now possible to nest 4K Fedora Linux VMs on 16K Fedora Asahi Remix machines to enable performant x86 emulation[2] and the host storage needs to be compatible for both environments.

Quoted 7 lines

Thus, I'd like to see us finally make the switchover to 4k sectorsize for new filesystems by default, regardless of page size.

The initial test run by Hector Martin[3] at request of Qu Wenruo looked promising[4], and we've been running with this behavior on Fedora Linux since Fedora Linux 36 (at around 6.2) with no issues.

This is a good change and well documented. This isn't being ignored, it's just a policy change that we have to be conservative about considering. We only in the last 3 months have added a Apple Silicon machine to our testing infrastructure (running Fedora Asahi fwiw) to make sure we're getting consistent subpage-blocksize testing. Generally speaking it's been fine, we've fixed a few things and haven't broken anything, but it's still comes with some risks when compared to the default of using the pagesize.

Quoted 3 lines

We will continue to discuss this amongst ourselves and figure out what we think would be a reasonable timeframe to make this switch and let you know what we're thinking ASAP. Thanks,

Reminder that the Raspberry Pi 5 is also shipping with 16K pages by default now. The clock is ticking for an ever-growing stream of people upset that they can't mount/data-rescue/etc their rPi5 NAS disks from an x86 machine ;)

- Hector

#5 lore raw
Quoted 33 lines · Hector Martin
Quoted 30 lines · Josef Bacik
Quoted 13 lines · Neal Gompa

The Fedora Asahi SIG[0] is working on bringing up support for Apple Silicon Macintosh computers through the Fedora Asahi Remix[1].

Apple Silicon Macs are unusual in that they currently require 16k page sizes, which means that the current default for mkfs.btrfs(8) makes a filesystem that is unreadable on x86 PCs and most other ARM PCs.

This is now even more of a problem within Apple Silicon Macs as it is now possible to nest 4K Fedora Linux VMs on 16K Fedora Asahi Remix machines to enable performant x86 emulation[2] and the host storage needs to be compatible for both environments.

Quoted 7 lines

Thus, I'd like to see us finally make the switchover to 4k sectorsize for new filesystems by default, regardless of page size.

The initial test run by Hector Martin[3] at request of Qu Wenruo looked promising[4], and we've been running with this behavior on Fedora Linux since Fedora Linux 36 (at around 6.2) with no issues.

This is a good change and well documented. This isn't being ignored, it's just a policy change that we have to be conservative about considering. We only in the last 3 months have added a Apple Silicon machine to our testing infrastructure (running Fedora Asahi fwiw) to make sure we're getting consistent subpage-blocksize testing. Generally speaking it's been fine, we've fixed a few things and haven't broken anything, but it's still comes with some risks when compared to the default of using the pagesize.

Quoted 8 lines
Quoted 3 lines

We will continue to discuss this amongst ourselves and figure out what we think would be a reasonable timeframe to make this switch and let you know what we're thinking ASAP. Thanks,

Reminder that the Raspberry Pi 5 is also shipping with 16K pages by default now. The clock is ticking for an ever-growing stream of people upset that they can't mount/data-rescue/etc their rPi5 NAS disks from an x86 machine ;)

As long as they are using 5.15+ kernel, they should be able to mount and use their RPI NAS with disks from x86 machines.

The change is only for the default mkfs options.

Thanks,
Qu

Quoted 2 lines

- Hector

#6 lore raw
Quoted 7 lines · On Wed, 29 Nov 2023 06:27:26 +1030 Qu Wenruo <[email protected]> wrote:
Quoted 4 lines

Reminder that the Raspberry Pi 5 is also shipping with 16K pages by default now. The clock is ticking for an ever-growing stream of people upset that they can't mount/data-rescue/etc their rPi5 NAS disks from an x86 machine ;)

As long as they are using 5.15+ kernel, they should be able to mount and use their RPI NAS with disks from x86 machines.

Doesn't the subpage sectorsize featureset only support sectors less than page size, not the other way round?

"mkfs.btrfs -s 16K" fails to mount on 6.1.62:

[1077897.120376] BTRFS error (device dm-22): sectorsize 16384 not yet supported for page size 4096
[1077897.120624] BTRFS error (device dm-22): superblock contains fatal errors
[1077897.121394] BTRFS error (device dm-22): open_ctree failed
Signature · 2 lines
With respect,
Roman
#7 lore raw
Quoted 8 lines · Roman Mamedov
Quoted 5 lines · On Wed, 29 Nov 2023 06:27:26 +1030 Qu Wenruo <[email protected]> wrote:
Quoted 4 lines

Reminder that the Raspberry Pi 5 is also shipping with 16K pages by default now. The clock is ticking for an ever-growing stream of people upset that they can't mount/data-rescue/etc their rPi5 NAS disks from an x86 machine ;)

Quoted 5 lines
Quoted 2 lines

As long as they are using 5.15+ kernel, they should be able to mount and use their RPI NAS with disks from x86 machines.

Doesn't the subpage sectorsize featureset only support sectors less than page size, not the other way round?

Well, if using the existing disks, it's really more common to let 16K page size systems to mount 4K sector systems.

Quoted 7 lines

"mkfs.btrfs -s 16K" fails to mount on 6.1.62:

[1077897.120376] BTRFS error (device dm-22): sectorsize 16384 not yet supported for page size 4096
[1077897.120624] BTRFS error (device dm-22): superblock contains fatal errors
[1077897.121394] BTRFS error (device dm-22): open_ctree failed

That's always the case.

Although with the recent folio changes, we may add support for multi-page sectorsizes in the future.

Thanks,
Qu

author
#8 lore raw
In reply to Qu Wenruo
Quoted 46 lines · Qu Wenruo
Quoted 33 lines · Hector Martin
Quoted 30 lines · Josef Bacik
Quoted 13 lines · Neal Gompa

The Fedora Asahi SIG[0] is working on bringing up support for Apple Silicon Macintosh computers through the Fedora Asahi Remix[1].

Apple Silicon Macs are unusual in that they currently require 16k page sizes, which means that the current default for mkfs.btrfs(8) makes a filesystem that is unreadable on x86 PCs and most other ARM PCs.

This is now even more of a problem within Apple Silicon Macs as it is now possible to nest 4K Fedora Linux VMs on 16K Fedora Asahi Remix machines to enable performant x86 emulation[2] and the host storage needs to be compatible for both environments.

Quoted 7 lines

Thus, I'd like to see us finally make the switchover to 4k sectorsize for new filesystems by default, regardless of page size.

The initial test run by Hector Martin[3] at request of Qu Wenruo looked promising[4], and we've been running with this behavior on Fedora Linux since Fedora Linux 36 (at around 6.2) with no issues.

This is a good change and well documented. This isn't being ignored, it's just a policy change that we have to be conservative about considering. We only in the last 3 months have added a Apple Silicon machine to our testing infrastructure (running Fedora Asahi fwiw) to make sure we're getting consistent subpage-blocksize testing. Generally speaking it's been fine, we've fixed a few things and haven't broken anything, but it's still comes with some risks when compared to the default of using the pagesize.

Quoted 8 lines
Quoted 3 lines

We will continue to discuss this amongst ourselves and figure out what we think would be a reasonable timeframe to make this switch and let you know what we're thinking ASAP. Thanks,

Reminder that the Raspberry Pi 5 is also shipping with 16K pages by default now. The clock is ticking for an ever-growing stream of people upset that they can't mount/data-rescue/etc their rPi5 NAS disks from an x86 machine ;)

Quoted 5 lines

As long as they are using 5.15+ kernel, they should be able to mount and use their RPI NAS with disks from x86 machines.

The change is only for the default mkfs options.

Right, and the thing is, it's fairly common for the disks to be formatted from a Raspberry Pi. So until some kind of support for using any sector size on any architecture regardless of page size lands, this is going to be a big problem.

Signature · 1 line
真実はいつも一つ!/ Always, there's only one truth!
#9 lore raw
Quoted 50 lines · Neal Gompa
Quoted 49 lines · Qu Wenruo
Quoted 33 lines · Hector Martin
Quoted 30 lines · Josef Bacik
Quoted 13 lines · Neal Gompa

The Fedora Asahi SIG[0] is working on bringing up support for Apple Silicon Macintosh computers through the Fedora Asahi Remix[1].

Apple Silicon Macs are unusual in that they currently require 16k page sizes, which means that the current default for mkfs.btrfs(8) makes a filesystem that is unreadable on x86 PCs and most other ARM PCs.

This is now even more of a problem within Apple Silicon Macs as it is now possible to nest 4K Fedora Linux VMs on 16K Fedora Asahi Remix machines to enable performant x86 emulation[2] and the host storage needs to be compatible for both environments.

Quoted 7 lines

Thus, I'd like to see us finally make the switchover to 4k sectorsize for new filesystems by default, regardless of page size.

The initial test run by Hector Martin[3] at request of Qu Wenruo looked promising[4], and we've been running with this behavior on Fedora Linux since Fedora Linux 36 (at around 6.2) with no issues.

This is a good change and well documented. This isn't being ignored, it's just a policy change that we have to be conservative about considering. We only in the last 3 months have added a Apple Silicon machine to our testing infrastructure (running Fedora Asahi fwiw) to make sure we're getting consistent subpage-blocksize testing. Generally speaking it's been fine, we've fixed a few things and haven't broken anything, but it's still comes with some risks when compared to the default of using the pagesize.

Quoted 8 lines
Quoted 3 lines

We will continue to discuss this amongst ourselves and figure out what we think would be a reasonable timeframe to make this switch and let you know what we're thinking ASAP. Thanks,

Reminder that the Raspberry Pi 5 is also shipping with 16K pages by default now. The clock is ticking for an ever-growing stream of people upset that they can't mount/data-rescue/etc their rPi5 NAS disks from an x86 machine ;)

As long as they are using 5.15+ kernel, they should be able to mount and use their RPI NAS with disks from x86 machines.

Quoted 8 lines
Quoted 2 lines

The change is only for the default mkfs options.

Right, and the thing is, it's fairly common for the disks to be formatted from a Raspberry Pi. So until some kind of support for using any sector size on any architecture regardless of page size lands, this is going to be a big problem.

Yup, I meant what I said.

Someone sets up a rPi5 as a NAS, formats the disk from it, as you would normally when setting up such a thing from scratch. Later, the rPi stops working, as rPis often do. This person's data is now *completely inaccessible* until they find another Raspberry Pi 5 or an Apple Silicon laptop.

This is going to be *common*. And since the 16K decision is made at format time, these people are going to be oblivious until they find themselves with an urgent need to acquire a Raspberry Pi 5 to access their data at all, and then they're going to be mad. So the longer you wait to flip the switch, the more people unaware of their own data's fragile accessibility condition you will build up, and the more upset people you're going to have even long after the change was finally made.

- Hector

#10 lore raw
Quoted 62 lines · Hector Martin
Quoted 50 lines · Neal Gompa
Quoted 49 lines · Qu Wenruo
Quoted 33 lines · Hector Martin
Quoted 30 lines · Josef Bacik
Quoted 13 lines · Neal Gompa

The Fedora Asahi SIG[0] is working on bringing up support for Apple Silicon Macintosh computers through the Fedora Asahi Remix[1].

Apple Silicon Macs are unusual in that they currently require 16k page sizes, which means that the current default for mkfs.btrfs(8) makes a filesystem that is unreadable on x86 PCs and most other ARM PCs.

This is now even more of a problem within Apple Silicon Macs as it is now possible to nest 4K Fedora Linux VMs on 16K Fedora Asahi Remix machines to enable performant x86 emulation[2] and the host storage needs to be compatible for both environments.

Quoted 7 lines

Thus, I'd like to see us finally make the switchover to 4k sectorsize for new filesystems by default, regardless of page size.

The initial test run by Hector Martin[3] at request of Qu Wenruo looked promising[4], and we've been running with this behavior on Fedora Linux since Fedora Linux 36 (at around 6.2) with no issues.

This is a good change and well documented. This isn't being ignored, it's just a policy change that we have to be conservative about considering. We only in the last 3 months have added a Apple Silicon machine to our testing infrastructure (running Fedora Asahi fwiw) to make sure we're getting consistent subpage-blocksize testing. Generally speaking it's been fine, we've fixed a few things and haven't broken anything, but it's still comes with some risks when compared to the default of using the pagesize.

Quoted 8 lines
Quoted 3 lines

We will continue to discuss this amongst ourselves and figure out what we think would be a reasonable timeframe to make this switch and let you know what we're thinking ASAP. Thanks,

Reminder that the Raspberry Pi 5 is also shipping with 16K pages by default now. The clock is ticking for an ever-growing stream of people upset that they can't mount/data-rescue/etc their rPi5 NAS disks from an x86 machine ;)

As long as they are using 5.15+ kernel, they should be able to mount and use their RPI NAS with disks from x86 machines.

Quoted 8 lines
Quoted 2 lines

The change is only for the default mkfs options.

Right, and the thing is, it's fairly common for the disks to be formatted from a Raspberry Pi. So until some kind of support for using any sector size on any architecture regardless of page size lands, this is going to be a big problem.

Quoted 7 lines

Yup, I meant what I said.

Someone sets up a rPi5 as a NAS, formats the disk from it, as you would normally when setting up such a thing from scratch. Later, the rPi stops working, as rPis often do. This person's data is now *completely inaccessible* until they find another Raspberry Pi 5 or an Apple Silicon laptop.

Got it.

I am putting too much trust on RPI, as my experience is pretty good so far (just for VM hosting and running fstests), thus I though everyone would just go x86->aarch64, at least for NAS hosting/VM testing...

Quoted 8 lines

This is going to be *common*. And since the 16K decision is made at format time, these people are going to be oblivious until they find themselves with an urgent need to acquire a Raspberry Pi 5 to access their data at all, and then they're going to be mad. So the longer you wait to flip the switch, the more people unaware of their own data's fragile accessibility condition you will build up, and the more upset people you're going to have even long after the change was finally made.

In that case, I'm totally fine to support the switch of default sector size, sooner than later.

With Asahi already running 4K sector sizes, and I have not received any death thread for the loss of one's data, I believe the prerequisite for the switch is already here.

And even if there are hidden bugs, default to 4K is in fact going to make it faster to get reports and fixed.

Thanks,
Qu

Quoted 2 lines

- Hector

author
#11 lore raw
Quoted 91 lines · Qu Wenruo
Quoted 62 lines · Hector Martin
Quoted 50 lines · Neal Gompa
Quoted 49 lines · Qu Wenruo
Quoted 33 lines · Hector Martin
Quoted 30 lines · Josef Bacik
Quoted 13 lines · Neal Gompa

The Fedora Asahi SIG[0] is working on bringing up support for Apple Silicon Macintosh computers through the Fedora Asahi Remix[1].

Apple Silicon Macs are unusual in that they currently require 16k page sizes, which means that the current default for mkfs.btrfs(8) makes a filesystem that is unreadable on x86 PCs and most other ARM PCs.

This is now even more of a problem within Apple Silicon Macs as it is now possible to nest 4K Fedora Linux VMs on 16K Fedora Asahi Remix machines to enable performant x86 emulation[2] and the host storage needs to be compatible for both environments.

Quoted 7 lines

Thus, I'd like to see us finally make the switchover to 4k sectorsize for new filesystems by default, regardless of page size.

The initial test run by Hector Martin[3] at request of Qu Wenruo looked promising[4], and we've been running with this behavior on Fedora Linux since Fedora Linux 36 (at around 6.2) with no issues.

This is a good change and well documented. This isn't being ignored, it's just a policy change that we have to be conservative about considering. We only in the last 3 months have added a Apple Silicon machine to our testing infrastructure (running Fedora Asahi fwiw) to make sure we're getting consistent subpage-blocksize testing. Generally speaking it's been fine, we've fixed a few things and haven't broken anything, but it's still comes with some risks when compared to the default of using the pagesize.

Quoted 8 lines
Quoted 3 lines

We will continue to discuss this amongst ourselves and figure out what we think would be a reasonable timeframe to make this switch and let you know what we're thinking ASAP. Thanks,

Reminder that the Raspberry Pi 5 is also shipping with 16K pages by default now. The clock is ticking for an ever-growing stream of people upset that they can't mount/data-rescue/etc their rPi5 NAS disks from an x86 machine ;)

As long as they are using 5.15+ kernel, they should be able to mount and use their RPI NAS with disks from x86 machines.

Quoted 8 lines
Quoted 2 lines

The change is only for the default mkfs options.

Right, and the thing is, it's fairly common for the disks to be formatted from a Raspberry Pi. So until some kind of support for using any sector size on any architecture regardless of page size lands, this is going to be a big problem.

Quoted 7 lines

Yup, I meant what I said.

Someone sets up a rPi5 as a NAS, formats the disk from it, as you would normally when setting up such a thing from scratch. Later, the rPi stops working, as rPis often do. This person's data is now *completely inaccessible* until they find another Raspberry Pi 5 or an Apple Silicon laptop.

Got it.

I am putting too much trust on RPI, as my experience is pretty good so far (just for VM hosting and running fstests), thus I though everyone would just go x86->aarch64, at least for NAS hosting/VM testing...

Quoted 8 lines

This is going to be *common*. And since the 16K decision is made at format time, these people are going to be oblivious until they find themselves with an urgent need to acquire a Raspberry Pi 5 to access their data at all, and then they're going to be mad. So the longer you wait to flip the switch, the more people unaware of their own data's fragile accessibility condition you will build up, and the more upset people you're going to have even long after the change was finally made.

In that case, I'm totally fine to support the switch of default sector size, sooner than later.

Quoted 7 lines

With Asahi already running 4K sector sizes, and I have not received any death thread for the loss of one's data, I believe the prerequisite for the switch is already here.

And even if there are hidden bugs, default to 4K is in fact going to make it faster to get reports and fixed.

For what it's worth, this change was applied at the Fedora level, so *all* architectures have been using 4k sectorize by default for some time now, including Fedora Asahi (ARM 16k) and Fedora POWER (64k).

Signature · 1 line
真実はいつも一つ!/ Always, there's only one truth!
#12 lore raw
In reply to Neal Gompa
Quoted 34 lines · Neal Gompa

The Fedora Asahi SIG[0] is working on bringing up support for Apple Silicon Macintosh computers through the Fedora Asahi Remix[1].

Apple Silicon Macs are unusual in that they currently require 16k page sizes, which means that the current default for mkfs.btrfs(8) makes a filesystem that is unreadable on x86 PCs and most other ARM PCs.

This is now even more of a problem within Apple Silicon Macs as it is now possible to nest 4K Fedora Linux VMs on 16K Fedora Asahi Remix machines to enable performant x86 emulation[2] and the host storage needs to be compatible for both environments.

Thus, I'd like to see us finally make the switchover to 4k sectorsize for new filesystems by default, regardless of page size.

The initial test run by Hector Martin[3] at request of Qu Wenruo looked promising[4], and we've been running with this behavior on Fedora Linux since Fedora Linux 36 (at around 6.2) with no issues.

=== Changelog ===

v4: Fixed minor errors in the cover letter and patch subject

v3: Refreshed cover letter, rebased to latest, updated doc references for v6.7

v2: Rebased to latest, updated doc references for v6.6

Final v1: Collected Reviewed-by tags for inclusion.

RFC v2: Addressed documentation feedback

RFC v1: Initial submission

Quoted 8 lines

[0]: https://fedoraproject.org/wiki/SIGs/Asahi
[1]: https://fedora-asahi-remix.org/
[2]: https://sinrega.org/2023-10-06-using-microvms-for-gaming-on-fedora-asahi/
[3]: https://lore.kernel.org/linux-btrfs/[email protected]/T/#m11d7939de96c43b3a7cdabc7c568d8bcafc7ca83
[4]: https://lore.kernel.org/linux-btrfs/[email protected]/T/#mf382b78a8122b0cb82147a536c85b6a9098a2895

Neal Gompa (1):
btrfs-progs: mkfs: Enforce 4k sectorsize by default

FYI, current plan is to add the change to 6.7 release with ETA in January. We've discussed this and given the increasing demand for that from various distros and testing coverage so done far it seems that it's sufficient.

author
#13 lore raw
Quoted 42 lines · David Sterba
Quoted 40 lines · Neal Gompa

The Fedora Asahi SIG[0] is working on bringing up support for Apple Silicon Macintosh computers through the Fedora Asahi Remix[1].

Apple Silicon Macs are unusual in that they currently require 16k page sizes, which means that the current default for mkfs.btrfs(8) makes a filesystem that is unreadable on x86 PCs and most other ARM PCs.

This is now even more of a problem within Apple Silicon Macs as it is now possible to nest 4K Fedora Linux VMs on 16K Fedora Asahi Remix machines to enable performant x86 emulation[2] and the host storage needs to be compatible for both environments.

Thus, I'd like to see us finally make the switchover to 4k sectorsize for new filesystems by default, regardless of page size.

The initial test run by Hector Martin[3] at request of Qu Wenruo looked promising[4], and we've been running with this behavior on Fedora Linux since Fedora Linux 36 (at around 6.2) with no issues.

=== Changelog ===

v4: Fixed minor errors in the cover letter and patch subject

v3: Refreshed cover letter, rebased to latest, updated doc references for v6.7

v2: Rebased to latest, updated doc references for v6.6

Final v1: Collected Reviewed-by tags for inclusion.

RFC v2: Addressed documentation feedback

RFC v1: Initial submission

[0]: https://fedoraproject.org/wiki/SIGs/Asahi
[1]: https://fedora-asahi-remix.org/
[2]: https://sinrega.org/2023-10-06-using-microvms-for-gaming-on-fedora-asahi/
[3]: https://lore.kernel.org/linux-btrfs/[email protected]/T/#m11d7939de96c43b3a7cdabc7c568d8bcafc7ca83
[4]: https://lore.kernel.org/linux-btrfs/[email protected]/T/#mf382b78a8122b0cb82147a536c85b6a9098a2895

Quoted 8 lines
Quoted 2 lines

Neal Gompa (1):
btrfs-progs: mkfs: Enforce 4k sectorsize by default

FYI, current plan is to add the change to 6.7 release with ETA in January. We've discussed this and given the increasing demand for that from various distros and testing coverage so done far it seems that it's sufficient.

Is this queued yet for the btrfs-progs v6.7 release? I don't see it in your devel tree[1] yet...

[1]: https://github.com/kdave/btrfs-progs/commits/devel/

Signature · 1 line
真実はいつも一つ!/ Always, there's only one truth!