Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: DRBD: Users

Upgrade 0.7 to 8.2 fails when using LVM

 

 

DRBD users RSS feed   Index | Next | Previous | View Threaded


matthias.weigel at maweos

Sep 1, 2008, 6:30 AM

Post #1 of 2 (333 views)
Permalink
Upgrade 0.7 to 8.2 fails when using LVM

Hi,

I use drbd 0.7 for some years and want to upgrade to drbd 8.2.

My setup:

ext3->lvm2->drbd->md->sd

On a test machine i get this error when i try to convert the 0.7
metadata to 8.2 format:

#drbdadm create-md fthdisk2
v08 Magic number not found
md_offset 1069150208
al_offset 1069117440
bm_offset 1069084672

Found LVM2 physical volume signature
Device size would be truncated, which
would corrupt data and result in
'access beyond end of device' errors.
If you want me to do this, you need to zero out the first part
of the device (destroy the content).
You should be very sure that you mean it.
Operation refused.

Command 'drbdmeta /dev/drbd0 v08 /dev/md7 internal create-md' terminated
with exit code 40
drbdadm aborting



I do not have this probem when not using LVM!!!
What have i done wrong?
Or is something so evil about LVM, that DRBD metadata cannot be converted?
How can i convert the metadata?
Do i have to destroy and rebuild the whole DRBD setup?




Here is the rest what i have done on my testing box. I currently use
Centos4 and the DRBD-RPMs from Centos.
(The testing box is currently standalone, but i have the same problem,
if it is connected).


First create a new drbd 0.7 config. /dev/md7 is 1GB.

# cat /proc/mdstat
Personalities : [raid1]
md7 : active raid1 sdc1[0]
1044096 blocks [1/1] [U]

# dd if=/dev/zero of=/dev/md7

# drbdadm up all
# cat /proc/drbd
version: 0.7.25 (api:79/proto:74)
GIT-hash: 3a9c7c136a9af8df921b3628129dafbe212ace9f build by
buildcentos[at]v20z-c4i386, 2008-07-24 10:51:01
0: cs:WFConnection st:Secondary/Unknown ld:Inconsistent
ns:0 nr:0 dw:0 dr:0 al:0 bm:112 lo:0 pe:0 ua:0 ap:0
1: cs:Unconfigured

# drbdadm -- --do-what-I-say primary all
# cat /proc/drbd
version: 0.7.25 (api:79/proto:74)
GIT-hash: 3a9c7c136a9af8df921b3628129dafbe212ace9f build by
buildcentos[at]v20z-c4i386, 2008-07-24 10:51:01
0: cs:WFConnection st:Primary/Unknown ld:Consistent
ns:0 nr:0 dw:0 dr:0 al:0 bm:112 lo:0 pe:0 ua:0 ap:0
1: cs:Unconfigured


#pvcreate /dev/drbd0
Physical volume "/dev/drbd0" successfully created

#pvscan
PV /dev/drbd0 lvm2 [891.44 MB]
Total: 1 [891.44 MB] / in use: 0 [0 ] / in no VG: 1 [891.44 MB]

#pvdisplay
--- NEW Physical volume ---
PV Name /dev/drbd0
VG Name
PV Size 891.44 MB
Allocatable NO
PE Size (KByte) 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID p8lPYo-LT00-JYtt-kGBC-NNr3-RpSU-zxLj0T


#vgcreate fth /dev/drbd0
Volume group "fth" successfully created

#lvcreate -L100M -nfailover fth
Logical volume "failover" created

#lvdisplay
--- Logical volume ---
LV Name /dev/fth/failover
VG Name fth
LV UUID L9sEWW-HeaK-8UoV-l2Cn-7XSw-MBSR-pqGs8e
LV Write Access read/write
LV Status available
# open 0
LV Size 100.00 MB
Current LE 25
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:0

#mke2fs /dev/fth/failover
mke2fs 1.35 (28-Feb-2004)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
25688 inodes, 102400 blocks
5120 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
13 block groups
8192 blocks per group, 8192 fragments per group
1976 inodes per group
Superblock backups stored on blocks:
8193, 24577, 40961, 57345, 73729

Writing inode tables: done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 24 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.

#tune2fs -j -c0 -i0 /dev/fth/failover
tune2fs 1.35 (28-Feb-2004)
Setting maximal mount count to -1
Setting interval between check 0 seconds
Creating journal inode: done
This filesystem will be automatically checked every -1 mounts or
0 days, whichever comes first. Use tune2fs -c or -i to override.

#mount /dev/fth/failover /mnt

#df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 3510364 2206504 1125540 67% /
/dev/sda1 101086 11696 84171 13% /boot
none 257740 0 257740 0% /dev/shm
/dev/mapper/fth-failover
99150 5664 88366 7% /mnt


Now i have a working lvm on top of DRBD 0.7 setup.
Lets upgrade to DRBD 8.2. I used
http://fghaas.wordpress.com/2007/10/03/step-by-step-upgrade-from-drbd-07-to-drbd-8/
as a guide.

#umount /mnt

#vgchange -a n fth
0 logical volume(s) in volume group "fth" now active

#drbdadm down all

#rmmod drbd

#rpm -e kmod-drbd-0.7.25-2.2.6.9_67.0.22.EL drbd-0.7.25-1.el4.centos
#rpm -i drbd82-8.2.6-1.el4.centos.i386.rpm
kmod-drbd82-8.2.6-2.2.6.9_67.0.22.EL.i686.rpm

#depmod -a

fixup/change drbd.conf


#drbdadm create-md fthdisk2
v08 Magic number not found
md_offset 1069150208
al_offset 1069117440
bm_offset 1069084672

Found LVM2 physical volume signature
Device size would be truncated, which
would corrupt data and result in
'access beyond end of device' errors.
If you want me to do this, you need to zero out the first part
of the device (destroy the content).
You should be very sure that you mean it.
Operation refused.

Command 'drbdmeta /dev/drbd0 v08 /dev/md7 internal create-md' terminated
with exit code 40
drbdadm aborting





My V0.7 drbd.conf:
resource fthdisk2 {
protocol C;
incon-degr-cmd "echo '!DRBD! pri on incon-degr' | wall ; sleep 60 ;
halt -f";
startup {
wfc-timeout 0; ## Infinite!
degr-wfc-timeout 120; ## 2 minutes.
}
disk {
on-io-error detach;
}
net {
# timeout 60;
# connect-int 10;
# ping-int 10;
# max-buffers 2048;
# max-epoch-size 2048;
}
syncer {
rate 4M;
group 1;
}
on fth1.maweos.de {
device /dev/drbd0;
disk /dev/md7;
address 192.168.208.51:7789;
meta-disk internal;
}
on fth2.maweos.de {
device /dev/drbd0;
disk /dev/md7;
address 192.168.208.52:7789;
meta-disk internal;
}
}



My V82 drbd.conf:
common {
protocol C;
startup {
wfc-timeout 0; ## Infinite!
degr-wfc-timeout 120; ## 2 minutes.
}
disk {
on-io-error detach;
# ONLY USE THIS OPTION IF YOU KNOW WHAT YOU ARE DOING.
# no-disk-flushes;
# no-md-flushes;

}
net {
# timeout 60;
# connect-int 10;
# ping-int 10;
# max-buffers 2048;
# max-epoch-size 2048;
}
syncer {
rate 10M;
}
handlers {
[.....]
}
}

resource fthdisk2 {
on fth1.maweos.de {
device /dev/drbd0;
disk /dev/md7;
address 192.168.208.51:7789;
meta-disk internal;
}
on fth2.maweos.de {
device /dev/drbd0;
disk /dev/md7;
address 192.168.208.52:7789;
meta-disk internal;
}
}




Best Regards

Matthias Weigel






_______________________________________________
drbd-user mailing list
drbd-user[at]lists.linbit.com
http://lists.linbit.com/mailman/listinfo/drbd-user


lars.ellenberg at linbit

Sep 1, 2008, 8:20 AM

Post #2 of 2 (319 views)
Permalink
Re: Upgrade 0.7 to 8.2 fails when using LVM [In reply to]

On Mon, Sep 01, 2008 at 03:30:34PM +0200, Matthias Weigel wrote:
> Hi,
>
> I use drbd 0.7 for some years and want to upgrade to drbd 8.2.
>
> My setup:
>
> ext3->lvm2->drbd->md->sd
>
> On a test machine i get this error when i try to convert the 0.7
> metadata to 8.2 format:
>
> #drbdadm create-md fthdisk2
> v08 Magic number not found
> md_offset 1069150208
> al_offset 1069117440
> bm_offset 1069084672
>
> Found LVM2 physical volume signature
> Device size would be truncated, which
> would corrupt data and result in
> 'access beyond end of device' errors.
> If you want me to do this, you need to zero out the first part
> of the device (destroy the content).
> You should be very sure that you mean it.
> Operation refused.
>
> Command 'drbdmeta /dev/drbd0 v08 /dev/md7 internal create-md' terminated
> with exit code 40
> drbdadm aborting
>

too much paranoia on my part makes drbdmeta refuse to create (which is
ok) or convert (which should be allowed, but is not, unfortunately)
meta data on a partition where an LVM physical volume signature is
detected.

as a work-around, you can

(please double check for typos! it is your data!)

dd if=/dev/md7 iflag=direct bs=1M count=1 of=md7.1M.backup
sync
dd if=/dev/zero of=/dev/md7 bs=1M count=1 oflag=direct

drbdmeta /dev/drbd0 v08 /dev/md7 internal create-md

drbdadm primary fthdisk2

dd if=md7.1M.backup of=/dev/drbd0 bs=1M count=1

or, if you feel more comfortable,
hack the drbdmeta source code to not refuse...

sorry for that.

--
: Lars Ellenberg
: LINBIT HA-Solutions GmbH
: DRBD®/HA support and consulting http://www.linbit.com

DRBD® and LINBIT® are registered trademarks
of LINBIT Information Technologies GmbH
__
please don't Cc me, but send to list -- I'm subscribed
_______________________________________________
drbd-user mailing list
drbd-user[at]lists.linbit.com
http://lists.linbit.com/mailman/listinfo/drbd-user

DRBD users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.