linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roman Mamedov <rm@romanrm.net>
To: Filipe Maia <filipe.c.maia@gmail.com>
Cc: linux-raid@vger.kernel.org, linux-xfs@vger.kernel.org
Subject: Re: Sector size changes creating filesystem problems
Date: Wed, 16 Jul 2025 22:10:03 +0500	[thread overview]
Message-ID: <20250716221003.0cda19e3@nvm> (raw)
In-Reply-To: <CAN5hRiUQ7vN0dqP_dNgbM9rY3PaNVPLDiWPRv9mXWfLXrHS0tQ@mail.gmail.com>

On Wed, 16 Jul 2025 15:30:20 +0100
Filipe Maia <filipe.c.maia@gmail.com> wrote:

> Hi,
> 
> When a 4Kn disk is added to an mdadm array with sector size 512, its
> sector size changes to 4096 to accommodate the new disk.
> 
> Here's an example:
> 
> ```
> truncate -s 1G /tmp/loop512a
> truncate -s 1G /tmp/loop512b
> truncate -s 1G /tmp/loop512c
> truncate -s 1G /tmp/loop4Ka
> losetup --sector-size 512  --direct-io=on /dev/loop0  /tmp/loop512a
> losetup --sector-size 512  --direct-io=on /dev/loop1  /tmp/loop512b
> losetup --sector-size 512  --direct-io=on /dev/loop2  /tmp/loop512c
> losetup --sector-size 4096  --direct-io=on /dev/loop3  /tmp/loop4Ka
> mdadm --create /dev/md2 --level=5 --raid-devices=3 /dev/loop[0-2]
> # blockdev returns 512
> blockdev --getss /dev/md2
> mdadm /dev/md2 -a /dev/loop3
> mdadm /dev/md2 -f /dev/loop2
> # blockdev still returns 512
> blockdev --getss /dev/md2
> mdadm -S /dev/md2
> mdadm -A /dev/md2 /dev/loop0 /dev/loop1 /dev/loop3
> # blockdev now returns 4096
> blockdev --getss /dev/md2
> ```
> 
> This breaks filesystems like XFS, with new mounts failing with:
> `mount: /mnt: mount(2) system call failed: Function not implemented.`

If you dd the XFS image from an old 512b disk onto a newly bought large
4K-sector HDD, would it also stop mounting on the new disk in the same way?

Perhaps something to be improved on the XFS side?

-- 
With respect,
Roman

  parent reply	other threads:[~2025-07-16 17:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-16 14:30 Sector size changes creating filesystem problems Filipe Maia
2025-07-16 16:21 ` Yu Kuai
2025-07-17  1:07   ` Yu Kuai
2025-07-17 21:07   ` Martin K. Petersen
2025-07-16 17:10 ` Roman Mamedov [this message]
2025-07-16 17:46   ` Filipe Maia
2025-07-17  4:30   ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250716221003.0cda19e3@nvm \
    --to=rm@romanrm.net \
    --cc=filipe.c.maia@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).