linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Pujol <nicolas.pujol@gmail.com>
To: linux-btrfs@vger.kernel.org
Subject: Resize a btrfs File System : no enough free space... why ?!?
Date: Sat, 1 Oct 2016 10:42:32 +0200	[thread overview]
Message-ID: <CAOf5Se5C+6Y+=uz=Lkv-wrPhHZOMD94hzrtLHwDR3D78UHiSSQ@mail.gmail.com> (raw)

Dears,

I added a news disk to my RAID5 array so I now have 4 * 2Tio disks,
with an +/-6Tio available capacity. On the RAID I have only one LVM
volume to manage all this space :
$ lvdisplay
  --- Logical volume ---
  LV Path                /dev/VG1/Vol3
  LV Name                Vol3
  VG Name                VG1
  LV UUID                dEGmTz-Fj0Z-qbOf-xn67-D5D8-5BNY-EwCsoF
  LV Write Access        read/write
  LV Creation host, time ,
  LV Status              available
  # open                 1
  LV Size                5,46 TiB
  Current LE             1430795
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2

After increased the RAID, then the LVM, I resize the BTRFS :
$ btrfs filesystem resize 1:max /mnt/RAID

Now I have 5,5T available:
# df -h /mnt/RAID
Sys. de fichiers     Taille Utilisé Dispo Uti% Monté sur
/dev/mapper/VG1-Vol3   5,5T    3,5T  1,9T  66% /mnt/RAID

# btrfs fi show
Label: none  uuid: 8dbd4ab0-e3d9-417d-b69b-dfdb51475e7e
    Total devices 1 FS bytes used 43.70GiB
    devid    1 size 100.00GiB used 79.04GiB path /dev/sdc3

Label: none  uuid: b8fd880f-fa7f-4f8b-bf40-1619e4931207
    Total devices 1 FS bytes used 3.46TiB
    devid    1 size 5.46TiB used 3.61TiB path /dev/mapper/VG1-Vol3

# btrfs fi df /mnt/RAID
Data, single: total=3.48TiB, used=3.46TiB
System, DUP: total=8.00MiB, used=416.00KiB
System, single: total=4.00MiB, used=0.00B
Metadata, DUP: total=69.62GiB, used=5.86GiB
Metadata, single: total=8.00MiB, used=0.00B
GlobalReserve, single: total=512.00MiB, used=0.00B

Unfortunately, I want to change the RAID chunk size because it is only
4K so I have to update the size of BTRFS before. Now, array size is
5860537608 so I want to reduce to 5860537344k :
$ btrfs filesystem resize 1:5860537344k /mnt/RAID
Resize '/mnt/RAID' of '1:5860537344k'
ERROR: unable to resize '/mnt/RAID': no enough free space

I tried severals tips but without any success:
# btrfs balance start -v -dusage=0 /mnt/RAID
# btrfs balance start -v -dusage=5 /mnt/RAID
# btrfs filesystem defragment /mnt/RAID

Like I don't understand the error, do you know why I can not resize
the BTRFS partition while 2TB are free?

For information:
# uname -a
Linux PC-NPL 4.6.4-1-ARCH #1 SMP PREEMPT Mon Jul 11 19:12:32 CEST 2016
x86_64 GNU/Linux

# btrfs --version
btrfs-progs v4.6.1

# mdadm --detail /dev/md127
/dev/md127:
        Version : 1.2
  Creation Time : Thu Jun 16 21:32:53 2011
     Raid Level : raid5
     Array Size : 5860537608 (5589.04 GiB 6001.19 GB)
  Used Dev Size : 1953512536 (1863.01 GiB 2000.40 GB)
   Raid Devices : 4
  Total Devices : 4
    Persistence : Superblock is persistent

    Update Time : Sat Oct  1 09:45:38 2016
          State : clean
 Active Devices : 4
Working Devices : 4
 Failed Devices : 0
  Spare Devices : 0

         Layout : parity-last
     Chunk Size : 4K

           Name : PC-NPL.localdomain:0
           UUID : f225928d:d977588a:058808df:cc6c53ca
         Events : 989508

    Number   Major   Minor   RaidDevice State
       1       8       49        0      active sync   /dev/sdd1
       4       8       65        1      active sync   /dev/sde1
       3       8        1        2      active sync   /dev/sda1
       5       8       17        3      active sync   /dev/sdb1

             reply	other threads:[~2016-10-01  8:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-01  8:42 Nicolas Pujol [this message]
2016-10-01 11:04 ` Resize a btrfs File System : no enough free space... why ?!? Duncan
2016-10-01 19:57 ` Chris Murphy
2016-10-01 22:32   ` Nicolas Pujol

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='CAOf5Se5C+6Y+=uz=Lkv-wrPhHZOMD94hzrtLHwDR3D78UHiSSQ@mail.gmail.com' \
    --to=nicolas.pujol@gmail.com \
    --cc=linux-btrfs@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).