Forums Neueste Beiträge
 

drbd und btrfs

23/07/2015 - 16:15 von Ulli Horlacher | Report spam
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: horlacher@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/
 

Lesen sie die antworten

#1 Ulli Horlacher
23/07/2015 - 16:53 | Warnen spam
Ulli Horlacher wrote:

:/etc# btrfs device add /dev/drbd2 /data
:/etc# btrfs device add /dev/drbd3 /data

:/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?!



Dasselbe passiert auch, wenn ich ein neues btrfs filesystem anlege:

:/etc# mkfs.btrfs /dev/drbd2 /dev/drbd3

WARNING! - Btrfs v3.12 IS EXPERIMENTAL
WARNING! - see http://btrfs.wiki.kernel.org before using

Turning ON incompat feature 'extref': increased hardlink limit per file to 65536
adding device /dev/drbd3 id 2
fs created label (null) on /dev/drbd2
nodesize 16384 leafsize 16384 sectorsize 4096 size 3.64TiB
Btrfs v3.12

:/etc# mount /dev/drbd2 /mnt/new

:/etc# df -H /mnt/new
Filesystem Size Used Avail Use% Mounted on
/dev/drbd2 4.1T 1.1M 4.0T 1% /mnt/new

:/etc# btrfs filesystem show /mnt/new
Label: none uuid: 586a32eb-fd15-4829-a4bf-c72c6d2f9074
Total devices 2 FS bytes used 896.00KiB
devid 1 size 1.82TiB used 2.03GiB path /dev/drbd2
devid 2 size 1.82TiB used 2.01GiB path /dev/drbd3

:/etc# sleep 15

:/etc# btrfs filesystem show /mnt/new
Label: none uuid: 586a32eb-fd15-4829-a4bf-c72c6d2f9074
Total devices 2 FS bytes used 896.00KiB
devid 1 size 1.82TiB used 2.03GiB path /dev/sdb
devid 2 size 1.82TiB used 2.01GiB path /dev/drbd3



Aus /dev/drbd2 wird nach ein paar Sekunden das raw-device /dev/sdb

:/etc# lf drbd2 /dev
lRWX - 2015-07-23 16:40 /dev/block/147:2 -> ../drbd2
lRWX - 2015-07-23 16:40 /dev/drbd/by-disk/disk/by-id/ata-HGST_HUS724020ALA640_PN2134P5G2P2AX -> ../../../../drbd2
lRWX - 2015-07-23 16:40 /dev/drbd/by-res/data_new/0 -> ../../../drbd2
bRW- 147,002 2015-07-23 16:40 /dev/drbd2

:/etc# lf drbd3 /dev
lRWX - 2015-07-23 16:40 /dev/block/147:3 -> ../drbd3
lRWX - 2015-07-23 16:40 /dev/drbd/by-disk/disk/by-id/ata-HGST_HUS724020ALA640_PN2134P5G2P2XX -> ../../../../drbd3
lRWX - 2015-07-23 16:40 /dev/drbd/by-res/data_new/1 -> ../../../drbd3
bRW- 147,003 2015-07-23 16:40 /dev/drbd3

:/etc# lf HGST /dev
lRWX - 2015-07-23 16:45 /dev/disk/by-id/ata-HGST_HUS724020ALA640_PN2134P5G2P2AX -> ../../sdb
lRWX - 2015-07-23 13:56 /dev/disk/by-id/ata-HGST_HUS724020ALA640_PN2134P5G2P2XX -> ../../sdd
lRWX - 2015-07-23 16:40 /dev/drbd/by-disk/disk/by-id/ata-HGST_HUS724020ALA640_PN2134P5G2P2AX -> ../../../../drbd2
lRWX - 2015-07-23 16:40 /dev/drbd/by-disk/disk/by-id/ata-HGST_HUS724020ALA640_PN2134P5G2P2XX -> ../../../../drbd3

Ullrich Horlacher Server und Virtualisierung
Rechenzentrum IZUS/TIK E-Mail:
Universitaet Stuttgart Tel: ++49-711-68565868
Allmandring 30a Fax: ++49-711-682357
70550 Stuttgart (Germany) WWW: http://www.tik.uni-stuttgart.de/

Ähnliche fragen