Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Russell Coker <russell@coker.com.au>, linux-btrfs@vger.kernel.org
Subject: Re: btrfs-progs: btrfs dev usa as non-root is wrong and should just abort
Date: Thu, 11 Jul 2024 13:28:38 +0930	[thread overview]
Message-ID: <f4cc6206-a7b8-4986-9177-b813f8b616c8@gmx.com> (raw)
In-Reply-To: <7956171.lvqk35OSZv@cupcakke>



在 2024/7/11 13:25, Russell Coker 写道:
> On Thursday, 11 July 2024 13:47:59 AEST Qu Wenruo wrote:
>>> # btrfs dev usa -b /
>>> /dev/mapper/root, ID: 1
>>>
>>>      Device size:          511493395968
>>
>> The device size is 4K aligned.
>>
>> I guess it's some older fs? As newer mkfs would always round down to the
>> sector size.
>
> My recollection is that I had run mkfs on a system running Debian/Bookworm
> which had different hardware and then used dd to copy it to this one.
>
>>>      Device slack:               1536
>>>      Data,single:          231936622592
>>>      Metadata,DUP:         6442450944
>>>      System,DUP:             67108864
>>>      Unallocated:          273047212032
>>>
>>> $ btrfs dev usa -b /
>>> WARNING: cannot read detailed chunk info, per-device usage will not be
>>> shown, run as root
>>> /dev/mapper/root, ID: 1
>>>
>>>      Device size:           999010539
>>>      Device slack:         18446743563215167723
>>>      Unallocated:          511493394432
>>>>
>>>> And what's the version of the btrfs-progs?
>>>
>>> The Debian package version is 6.6.3-1.2+b1.
>>
>> It may be easier to debug by trying a newer version of btrfs-progs.
>>
>> And since I'm not sure if it's the unalignment causing problems, you may
>> want to resize the fs by:
>>
>> # btrfs device resize -1M <mnt>
>>
>> Then resize to max (which should always align the fs correctly):
>>
>> # btrfs device resize max <mnt>
>
> root@cupcakke:/tmp# btrfs fi resize 1:-1M  /
> Resize device id 1 (/dev/mapper/root) from 476.37GiB to 476.36GiB
> root@cupcakke:/tmp# btrfs fi resize 1:max  /
> Resize device id 1 (/dev/mapper/root) from 476.36GiB to max
>
> etbe@cupcakke:/tmp$ btrfs dev usa -b /
> WARNING: cannot read detailed chunk info, per-device usage will not be shown,
> run as root
> /dev/mapper/root, ID: 1
>     Device size:           999010539
>     Device slack:         18446743563215167723
>     Unallocated:          511493394432

What about the usage output using root privilege?

Just want to be sure that the fs is properly resized to be 4K aligned.

>
> etbe@cupcakke:/tmp$ btrfs dev usa /
> WARNING: cannot read detailed chunk info, per-device usage will not be shown,
> run as root
> /dev/mapper/root, ID: 1
>     Device size:           952.73MiB
>     Device slack:           16.00EiB
>     Unallocated:           476.37GiB
>
> That doesn't seem to have changed anything.
>
And what about newer progs?

Thanks,
Qu

      reply	other threads:[~2024-07-11  3:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-10 11:52 btrfs-progs: btrfs dev usa as non-root is wrong and should just abort Russell Coker
2024-07-10 16:29 ` Boris Burkov
2024-07-11  3:50   ` Russell Coker
2024-07-10 21:13 ` Qu Wenruo
2024-07-11  3:42   ` Russell Coker
2024-07-11  3:47     ` Qu Wenruo
2024-07-11  3:55       ` Russell Coker
2024-07-11  3:58         ` Qu Wenruo [this message]

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=f4cc6206-a7b8-4986-9177-b813f8b616c8@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=russell@coker.com.au \
    /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