Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.
running the latest CentOS release of drbd (8.2.6), and tried to shrink a DRBD device backed by LVM. here's an abbreviated running log of what i did with the error at the end: 1030 beast$~: drbdadm primary storage 1031 beast$~: cat /proc/drbd version: 8.2.6 (api:88/proto:86-88) GIT-hash: 3e69822d3bb4920a8c1bfdf7d647169eba7d2eb4 build by buildsvn at c5-i386-build, 2008-10-03 11:43:01 0: cs:Connected st:Primary/Secondary ds:UpToDate/UpToDate C r--- ns:7293796 nr:952 dw:7294748 dr:963597 al:254 bm:87 lo:0 pe:0 ua: 0 ap:0 oos:0 1: cs:Connected st:Secondary/Secondary ds:UpToDate/UpToDate C r--- ns:1909448 nr:48 dw:1909496 dr:39244029 al:1597 bm:1042 lo:0 pe:0 ua:0 ap:0 oos:0 1033 beast$~: umount /storage/ 1037 beast$~: e2fsck -f /dev/drbd0 e2fsck 1.39 (29-May-2006) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information storage: 301/32014336 files (18.6% non-contiguous), 1380170/64002133 blocks 1038 beast$~: resize2fs -p /dev/drbd0 39G resize2fs 1.39 (29-May-2006) Resizing the filesystem on /dev/drbd0 to 10223616 (4k) blocks. Begin pass 2 (max = 327631) Relocating blocks XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Begin pass 3 (max = 1954) Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Begin pass 4 (max = 21) Updating inode references XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX The filesystem on /dev/drbd0 is now 10223616 blocks long. 1039 beast$~: drbdadm secondary storage 1040 beast$~: drbdadm down storage 1041 beast$~: cat /proc/drbd version: 8.2.6 (api:88/proto:86-88) GIT-hash: 3e69822d3bb4920a8c1bfdf7d647169eba7d2eb4 build by buildsvn at c5-i386-build, 2008-10-03 11:43:01 0: cs:Unconfigured 1: cs:Connected st:Secondary/Secondary ds:UpToDate/UpToDate C r--- ns:1909448 nr:48 dw:1909496 dr:39244029 al:1597 bm:1042 lo:0 pe:0 ua:0 ap:0 oos:0 1042 beast$~: drbdadm dump-md storage > /tmp/storage_metadata 1043 beast$~: cat /tmp/storage_metadata # DRBD meta data dump # 2009-05-10 02:22:35 -0600 [1241943755] # beast.apartmentlines.com> drbdmeta /dev/drbd0 v08 /dev/VolGroup00/ storage internal dump-md # version "v08"; # md_size_sect 15704 # md_offset 262160773120 # al_offset 262160740352 # bm_offset 262152736768 uuid { 0x7298A797A5A8B812; 0x0000000000000000; 0x9BD06AE59BDA855C; 0x12C8D1990833C635; flags 0x00000011; } la-size-sect 512017064; bm-byte-per-bit 4096; device-uuid 0xAC9A0CBA55FAB25C; # bm-bytes 8000272; bm { # at 0kB 1000064 times 0x0000000000000000; } # bits-set 0; 1044 beast$~: lvreduce -L 40G VolGroup00/storage /dev/hda: open failed: No medium found WARNING: Reducing active logical volume to 40.00 GB THIS MAY DESTROY YOUR DATA (filesystem etc.) Do you really want to reduce storage? [y/n]: y Reducing logical volume storage to 40.00 GB Logical volume storage successfully resized 1045 beast$~: drbdadm create-md storage v08 Magic number not found md_offset 42949668864 al_offset 42949636096 bm_offset 42948325376 Found ext3 filesystem which uses 40894464 kB current configuration leaves usable 41941724 kB ==> This might destroy existing data! <== Do you want to proceed? [need to type 'yes' to confirm] yes v07 Magic number not found v07 Magic number not found v08 Magic number not found Writing meta data... initialising activity log NOT initialized bitmap New drbd meta data block sucessfully created. 1046 beast$~: cp /tmp/storage_metadata /tmp/storage_metadata.orig 1047 beast$~: sed -i -e 's/la-size-sect.*/la-size-sect 83883448;/g' / tmp/storage_metadata 1048 beast$~: diff -u /tmp/storage_metadata.orig /tmp/storage_metadata --- /tmp/storage_metadata.orig 2009-05-10 02:30:40.000000000 -0600 +++ /tmp/storage_metadata 2009-05-10 02:31:10.000000000 -0600 @@ -14,7 +14,7 @@ 0x7298A797A5A8B812; 0x0000000000000000; 0x9BD06AE59BDA855C; 0x12C8D1990833C635; flags 0x00000011; } -la-size-sect 512017064; +la-size-sect 83883448; bm-byte-per-bit 4096; device-uuid 0xAC9A0CBA55FAB25C; # bm-bytes 8000272; 1051 beast$~: drbdmeta_cmd=$(drbdadm -d dump-md storage) 1052 beast$~: ${drbdmeta_cmd/dump-md/restore-md} /tmp/storage_metadata Valid meta-data in place, overwrite? [need to type 'yes' to confirm] yes reinitialising confused in meta_restore_md:TK_NUM: expected to write 131072 bytes, actually wrote 36864 any ideas? thanks, chad