I am most of the way through converting a raid1 mdadm with lvm on top to a btrfs system. the two disks/partitions involved are on /dev/sdb
and /dev/sdc
.
In the original configuration both disks had 3 partitions and device /dev/md1
was made up of /dev/sdb3
and /dev/sdc3
. The conversion process was as follows
- fail and then remove /dev/sdb3
- use fdisk to repartition /dev/sdb into 4 partitions - I couldn't sync kernel to new partiion layout so rebooted
- made a btrfs filesystem on
/dev/sdb4
(also on/dev/sdb2
but thats not important here) size 1.7TB - created a mount point on
/mnt/sdb4
created subvolumes to correspond to each of my logical volumes on my (now degraded) raid device. One of these (vbox
) was to hold virtual box images, so I didchattr +C /mnt/sdb4/vbox
- User rsync to copy each of my logical volumes on the raid device to the appropriate subvolume on btrfs. As each completed I unmounted the raid volume, adjusted
/etc/fstab
to now mount using the btrfs subvolume and then mounted it. When all this completed I rebooted to be sure it all came up properly. - I then removed all the logical volumes and finally the volume group from the raid array, and then stopped and deleted the raid device. Rebooted once more
- Used
fdisk
to repartition/dev/sdc
to the similar 4 partitions on/dev/sdb
I made and independant btrfs filesystem in/dev/sdc2
- I mounted
/dev/sdb4
(subvol=/) on/mnt/sdb4
and then issued the following commandbtrfs device add -f /dev/sdc4 /mnt/sdb4
- Finally I issued this command
btrfs balance start -dconvert=raid1 -mconvert=raid1 /mnt/sdb4
HOWEVER this failed with "ERROR: error during balancing '/mnt/sdb4': No space left on device There may be more info in syslog - try dmesg | tail"
I tried looking in syslog as recommended, but that doesn't help
[ 634.536221] BTRFS info (device sdb4): disk added /dev/sdc4
[ 671.472167] BTRFS info (device sdb4): relocating block group 12582912 flags 1
[ 671.934540] BTRFS info (device sdb4): found 946 extents
[ 672.622029] BTRFS info (device sdb4): found 946 extents
[ 672.913928] BTRFS info (device sdb4): 379 enospc errors during balance
The output from btrfs fi show
is
``` Label: 'raid' uuid: c3356f85-4b40-409d-a775-72e9c6735ed8 Total devices 2 FS bytes used 377.08GiB devid 1 size 1.71TiB used 379.02GiB path /dev/sdb4 devid 2 size 1.00KiB used 0.00B path /dev/sdc4
Label: 'debianb' uuid: 94a949e0-b815-4dce-812d-7000f4654a10 Total devices 1 FS bytes used 285.25MiB devid 1 size 100.00GiB used 3.02GiB path /dev/sdb2
Label: 'debianc' uuid: 02ed1d78-8501-4940-ac61-fa9dcf084b56 Total devices 1 FS bytes used 112.00KiB devid 1 size 100.00GiB used 2.02GiB path /dev/sdc2 ```
Which shows plenty of space.
I am doing all of this on debian stretch
So why is the no space left on device being reported, and what can I do to get this filesystem properly converted to raid1?