Adjusting the size of the tarragondata volume

At one point I was getting low on space on tarragondata, so I added an additional physical device to the btrfs filesystem containing tarragondata.

[root@tarragon backup_scripts]# btrfs fi show
Label: 'tarragon_data' uuid: d6e4b6fc-8745-4e6e-b6b4-8548142b5154
 Total devices 2 FS bytes used 92.04GiB
 devid 1 size 120.00GiB used 120.00GiB path /dev/xvdf1
 devid 2 size 30.00GiB used 30.00GiB path /dev/xvdg

This is fine, but there are a couple of problems. The main one is that I can no longer use the EC2 snapshot capability on tarragondata, which meant that the nightly EC2 snapshot feature I was using had to be deimplemented.

But now I am about to create a new tarragon instance, and it would be really helpful to be able to snapshot tarragondata (Amazon snapshot, not btrfs snapshot) and then create a new Amazon volume with a consistent snapshot for testing.

So to do that, I am going to use the btrfs feature of adding and removing physical volumes to consolidate tarragondata on a single physical volume.

Steps are:

1) create a new 150GB physical volume in Amazon EC2 dashboard, and attach it to tarragon.

2) On tarragon, add the new physical volume to the tarragondata btrfs filesystem.

 btrfs device add /dev/xvdh /mnt/tarragondata

3) Remove the older smaller physical devices one at a time:

 btrfs device delete /dev/xvdg /mnt/tarragondata
 btrfs device delete /dev/xvdf1 /mnt/tarragondata

This successfully moved all the data and metadata to a new 150GB drive, which enabled me to snapshot it.