Skip to contentSkip to conversation

btrfs filesystem resize <ID>:max not working

DISCUSSION André-Sebastian Liebe 2 participants 3 messages Apr 9, 2015 – Apr 10, 2015 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Hey list,

I've got a problem with resizing a multi drive filesystem.
I had a 5 disk array of 4TB drives. Then I added a 5th (6TB) drive to the array and replaced one of the 4TB ones with a 6TB drive. As you can see in my btrfs fi sh output below, my newly added drive (ID=6) has the expected size of 5.46TiB, but my replaced drive (ID=4) won't show up as 6TB as expected. Neither a btrfs fi res max /data/pool0 nor a btrfs fi res 4:max /data/pool0 had any effect.

Any suggestions how to reclaim the 2TB free space of drive 4?

Thanks in advance

André-Sebastian Liebe

Quoted 1 line

Kernel:Linux apc01 3.19.2-1-ARCH #1 SMP PREEMPT Wed Mar 18 16:21:02

CET 2015 x86_64 GNU/Linux

Quoted 1 line

btrfs-progs: btrfs-progs v3.19

My 6 drives used by the apc01_pool (none of them has a partition table) Konsole output

Quoted 10 lines
# hdparm -I /dev/sdb | grep "device size"           
       device size with M = 1024*1024:     3815447 MBytes
       device size with M = 1000*1000:     4000787 MBytes (4000 GB)
# hdparm -I /dev/sdc | grep "device size"  
       device size with M = 1024*1024:     3815447 MBytes
       device size with M = 1000*1000:     4000787 MBytes (4000 GB)
# hdparm -I /dev/sdd | grep "device size"  
       device size with M = 1024*1024:     3815447 MBytes
       device size with M = 1000*1000:     4000787 MBytes (4000 GB)
# hdparm -I /dev/sde | grep "device size"  
Quoted 8 lines
       device size with M = 1024*1024:     3815447 MBytes
       device size with M = 1000*1000:     4000787 MBytes (4000 GB)
# hdparm -I /dev/sdf | grep "device size"  
       device size with M = 1024*1024:     5723166 MBytes
       device size with M = 1000*1000:     6001175 MBytes (6001 GB)
# hdparm -I /dev/sdg | grep "device size"  
       device size with M = 1024*1024:     5723166 MBytes
       device size with M = 1000*1000:     6001175 MBytes (6001 GB)

btrfs filesystem:
Konsole output

Quoted 9 lines
# btrfs fi sh
Label: 'apc01_pool0'  uuid: 066141c6-16ca-4a30-b55c-e606b90ad0fb
       Total devices 6 FS bytes used 23.43TiB
       devid    1 size 3.64TiB used 3.61TiB path /dev/sdd
       devid    2 size 3.64TiB used 3.61TiB path /dev/sdc
       devid    3 size 3.64TiB used 3.61TiB path /dev/sde
       devid    4 size 3.64TiB used 3.61TiB path /dev/sdg
       devid    5 size 3.64TiB used 3.61TiB path /dev/sdb
       devid    6 size 5.46TiB used 5.43TiB path /dev/sdf
#1 lore raw
Quoted 5 lines · André-Sebastian Liebe

Hey list,

I've got a problem with resizing a multi drive filesystem. I had a 5 disk array of 4TB drives. Then I added a 5th (6TB) drive to the array and replaced one of the 4TB ones with a 6TB drive.

You did device add, device delete, then fi resize? It should work but it's better to use btrfs replace start for this sort of operation since it does all of that in one step.

Quoted 7 lines

As you can
see in my btrfs fi sh output below, my newly added drive (ID=6) has the expected size of 5.46TiB, but my replaced drive (ID=4) won't show up as 6TB as expected. Neither a btrfs fi res max /data/pool0 nor a btrfs fi res 4:max /data/pool0 had any effect.

Any suggestions how to reclaim the 2TB free space of drive 4?

Not sure, this has always worked for me in the past, online. You could try unmounting and doing a btrfs dev scan, remounting, and then retrying the command. There's nothing in dmesg? There should be something there whether it succeeds or fails.

Signature · 1 line
Chris Murphy
#2 lore raw

Hey all,

Quoted 9 lines · Chris Murphy
Quoted 5 lines · André-Sebastian Liebe

Hey list,

I've got a problem with resizing a multi drive filesystem. I had a 5 disk array of 4TB drives. Then I added a 5th (6TB) drive to the array and replaced one of the 4TB ones with a 6TB drive.

You did device add, device delete, then fi resize? It should work but it's better to use btrfs replace start for this sort of operation since it does all of that in one step.

I did a device replace.

Quoted 11 lines
Quoted 7 lines

As you can
see in my btrfs fi sh output below, my newly added drive (ID=6) has the expected size of 5.46TiB, but my replaced drive (ID=4) won't show up as 6TB as expected. Neither a btrfs fi res max /data/pool0 nor a btrfs fi res 4:max /data/pool0 had any effect.

Any suggestions how to reclaim the 2TB free space of drive 4?

Not sure, this has always worked for me in the past, online. You could try unmounting and doing a btrfs dev scan, remounting, and then retrying the command. There's nothing in dmesg? There should be something there whether it succeeds or fails.

Okay, I did a scrub, unmounted it, scanned for devices, remounted it and redid the resize for drive 4. This time I got a syslog entry showing the start of the resize and about 5 minutes later the command finished without an error.

Konsole output

Quoted 2 lines
Apr 10 08:58:39 apc01 kernel: BTRFS info (device sdd): resizing devid 4
Apr 10 08:58:39 apc01 kernel: BTRFS: new size for /dev/sdg is

6001175126016

btrfs fi sh finally shows both of my 6TB drives

Konsole output

Quoted 9 lines
# btrfs fi sh
Label: 'apc01_pool0'  uuid: 066141c6-16ca-4a30-b55c-e606b90ad0fb
       Total devices 6 FS bytes used 23.43TiB
       devid    1 size 3.64TiB used 3.61TiB path /dev/sdd
       devid    2 size 3.64TiB used 3.60TiB path /dev/sdc
       devid    3 size 3.64TiB used 3.60TiB path /dev/sde
       devid    4 size 5.46TiB used 3.60TiB path /dev/sdg
       devid    5 size 3.64TiB used 3.61TiB path /dev/sdb
       devid    6 size 5.46TiB used 5.43TiB path /dev/sdf

Thanks for the hint!

Cheers
André