Bei mir scheint sich drbd mit btrfs nicht zu vertragen.
Ubuntu 14.04
drbd 8.4.4
Btrfs v3.12
Bisher hab ich ein btrfs filesystem, das aus 2 drbd Platten (data) besteht:
root@toy02:~/bin# drbd-overview
0:data/0 Connected Primary/Secondary UpToDate/UpToDate C r----- /data btrfs 3.7T 119G 3.6T 4%
1:data/1 Connected Primary/Secondary UpToDate/UpToDate C r-----
2:data_new/0 Connected Primary/Secondary UpToDate/UpToDate C r-----
3:data_new/1 Connected Primary/Secondary UpToDate/UpToDate C r-----
root@toy02:/etc# btrfs filesystem show /data
Label: data uuid: 411af13f-6cae-4f03-99dc-5941acb3135b
Total devices 2 FS bytes used 117.98GiB
devid 1 size 1.82TiB used 70.03GiB path /dev/drbd0
devid 2 size 1.82TiB used 70.03GiB path /dev/drbd1
root@toy02:/etc# /opt/btrfs-4.0/bin/btrfs fi usage /data
Overall:
Device size: 3.64TiB
Device allocated: 140.06GiB
Device unallocated: 3.50TiB
Device missing: 0.00B
Used: 118.13GiB
Free (estimated): 3.52TiB (min: 1.77TiB)
Data ratio: 1.00
Metadata ratio: 2.00
Global reserve: 0.00B (used: 0.00B)
Data,RAID0: Size:138.00GiB, Used:117.82GiB
/dev/drbd0 69.00GiB
/dev/drbd1 69.00GiB
Metadata,RAID1: Size:1.00GiB, Used:157.56MiB
/dev/drbd0 1.00GiB
/dev/drbd1 1.00GiB
System,RAID1: Size:32.00MiB, Used:16.00KiB
/dev/drbd0 32.00MiB
/dev/drbd1 32.00MiB
Unallocated:
/dev/drbd0 1.75TiB
/dev/drbd1 1.75TiB
root@toy02:/etc# df -H /data
Filesystem Size Used Avail Use% Mounted on
/dev/drbd0 4.1T 127G 3.9T 4% /data
Das funktioniert so weit ganz gut.
Nun moechte ich diesem filesystem die 2 drbd Platten von data_new
hinzufuegen:
root@toy02:~/etc# l /dev/drbd*
dRWX - 2015-07-23 13:56 /dev/drbd
bRW- 147,000 2015-07-23 13:58 /dev/drbd0
bRW- 147,001 2015-07-23 13:58 /dev/drbd1
bRW- 147,002 2015-07-23 13:56 /dev/drbd2
bRW- 147,003 2015-07-23 13:56 /dev/drbd3
root@toy02:/etc# btrfs device add /dev/drbd2 /data
root@toy02:/etc# btrfs filesystem show /data
Label: data uuid: 411af13f-6cae-4f03-99dc-5941acb3135b
Total devices 3 FS bytes used 117.98GiB
devid 1 size 1.82TiB used 70.03GiB path /dev/drbd0
devid 2 size 1.82TiB used 70.03GiB path /dev/drbd1
devid 3 size 1.82TiB used 0.00 path /dev/drbd2
root@toy02:/etc# btrfs device add /dev/drbd3 /data
root@toy02:/etc# btrfs filesystem show /data
Label: data uuid: 411af13f-6cae-4f03-99dc-5941acb3135b
Total devices 4 FS bytes used 117.98GiB
devid 1 size 1.82TiB used 70.03GiB path /dev/drbd0
devid 2 size 1.82TiB used 70.03GiB path /dev/drbd1
devid 3 size 1.82TiB used 0.00 path /dev/sdb
devid 4 size 1.82TiB used 0.00 path /dev/drbd3
Wieso wurde auf einmal aus /dev/drbd2 das raw-device /dev/sdb?!
Grad eben hatte es doch noch gestimmt!
Aus /etc/drbd.conf:
resource data_new {
volume 0 {
device /dev/drbd2;
disk /dev/disk/by-id/ata-HGST_HUS724020ALA640_PN2134P5G2P2AX;
meta-disk internal;
}
root@toy02:/etc# ll /dev/disk/by-id/ata-HGST_HUS724020ALA640_PN2134P5G2P2AX
lrwxrwxrwx root root - 2015-07-23 15:53:19 /dev/disk/by-id/ata-HGST_HUS724020ALA640_PN2134P5G2P2AX -> ../../sdb
Also wieder weg damit:
root@toy02:/etc# btrfs device delete /dev/drbd2 /data
root@toy02:/etc# btrfs filesystem show /data
Label: data uuid: 411af13f-6cae-4f03-99dc-5941acb3135b
Total devices 3 FS bytes used 117.98GiB
devid 1 size 1.82TiB used 70.03GiB path /dev/drbd0
devid 2 size 1.82TiB used 70.03GiB path /dev/drbd1
devid 4 size 1.82TiB used 0.00 path /dev/drbd3
Und nochmals hinzugefuegt:
root@toy02:/etc# btrfs device add /dev/drbd2 /data
root@toy02:/etc# btrfs filesystem show /data
Label: data uuid: 411af13f-6cae-4f03-99dc-5941acb3135b
Total devices 4 FS bytes used 117.98GiB
devid 1 size 1.82TiB used 70.03GiB path /dev/drbd0
devid 2 size 1.82TiB used 70.03GiB path /dev/drbd1
devid 4 size 1.82TiB used 0.00 path /dev/drbd3
devid 5 size 1.82TiB used 0.00 path /dev/drbd2
Aber schon wenige Sekunden spaeter wieder:
root@toy02:/etc# btrfs filesystem show /data
Label: data uuid: 411af13f-6cae-4f03-99dc-5941acb3135b
Total devices 4 FS bytes used 117.98GiB
devid 1 size 1.82TiB used 70.03GiB path /dev/drbd0
devid 2 size 1.82TiB used 70.03GiB path /dev/drbd1
devid 4 size 1.82TiB used 0.00 path /dev/drbd3
devid 5 size 1.82TiB used 0.00 path /dev/sdb
WTF?!
--
Ullrich Horlacher Server und Virtualisierung
Rechenzentrum IZUS/TIK E-Mail:
horl...@tik.uni-stuttgart.de
Universitaet Stuttgart Tel:
++49-711-68565868
Allmandring 30a Fax:
++49-711-682357
70550 Stuttgart (Germany) WWW:
http://www.tik.uni-stuttgart.de/