On 29 April 2018 at 02:50, Qu Wenruo <quwenruo.bt...@gmx.com> wrote:
>
>
> On 2018年04月29日 04:16, Paul Richards wrote:
>> On 28 April 2018 at 20:39, Patrik Lundquist <patrik.lundqu...@gmail.com> 
>> wrote:
>>> On 28 April 2018 at 20:54, Paul Richards <paul.richa...@gmail.com> wrote:
>>>>
>>>> Hi,
>>>> I recently upgraded from Linux 4.4.0 to 4.13.0 (Ubuntu 16.04 stock to
>>>> hwe kernel).
>>>>
>>>> Since then, I've noticed lots of btrfs warnings in dmesg (example at
>>>> the end).  I believe these warnings to be benign, and they relate to
>>>> my partition not being a multiple of 4KiB in size (I confirmed that
>>>> alignment is okay in this instance).
>>>
>>>
>>> Run btrfs rescue fix-device-size <device>.
>>>
>>
>>
>> Excellent, that looks like exactly what I need.  It's a shame my
>> google-fu didn't uncover it before I posted.
>>
>> However, the "fix-device-size" sub-command is not available in
>> btrfs-tools (v4.4) from Ubuntu 16.04.  I guess my original question
>> still stands.  Is this warning safe for me to ignore?
>
> Safe to ignore.
>
> And there is another way to solve it.
>
> Shrink your fs by 4K, and newer kernel will do the round down for you
> and result new device size to be aligned.
>
> Thanks,
> Qu
>


Thanks - this fixed the issue for me (modulo my problem below..).  I
thought I should follow up with exactly what I did for anyone else
looking to fix this.

I used this command to identify which devices were not exact multiples
of 4KiB in size:

% btrfs fi show --raw /storage
Label: none  uuid: c4b33374-9006-47d7-b6f9-2136dc988f9a
Total devices 3 FS bytes used 7027891666944
devid    1 size 8001560055808 used 4691211583488 path /dev/mapper/storage1
devid    3 size 8001560059392 used 4691211583488 path /dev/mapper/storage3
devid    4 size 8001560059392 used 4690104287232 path /dev/mapper/storage4

I used a calculator to determine that devids 3 and 4 were the
offenders (they don't divide by 4006 nicely).


I then ran:
% btrfs fi resize 3:-1K /storage
% btrfs fi resize 4:-1K /storage

Which has resulted in this:
% btrfs fi show --raw /storage
Label: none  uuid: c4b33374-9006-47d7-b6f9-2136dc988f9a
Total devices 3 FS bytes used 7027891666944
devid    1 size 8001560055808 used 4691211583488 path /dev/mapper/storage1
devid    3 size 8001560055808 used 4691211583488 path /dev/mapper/storage3
devid    4 size 8001560055808 used 4690104287232 path /dev/mapper/storage4

PERFECT! :)


The issue I have now is that the filesystem cannot be unmounted.
"umount" reports "target is busy", but I cannot find anything relevant
with "lsof" or "fuser" (this is a very quiet home NAS).  Is this
something related to the resize?



For what it's worth, here are the sizes of the underlying devices
(output somewhat redacted):

% lsblk -b
NAME         MAJ:MIN RM          SIZE RO TYPE  MOUNTPOINT
storage3 253:2    0 8001560059392  0 crypt
storage4 253:1    0 8001560059392  0 crypt
storage1 253:0    0 8001560059392  0 crypt /storage/.snapshots

It looks like all the devices are an odd size.  One of these disks was
added after the others, presumably with a newer kernel that rounded
the btrfs dev size downwards.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to