[DRBD-user] Command 'drbdmeta 0 v08 /dev/sda3 internal create-md' terminated with exit code 40

Colom, Jaime colom at infosim.net
Tue Jul 22 21:47:10 CEST 2014

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


Hi Guys,

I have been trying to setup and configure DRBD in my system in order to replicate the information for MySQL. I have followed the instructions line by line, but I keep getting the following error the moment I try to create the partition for the DRBD:

Notice that I have created sda3 storage for the DRBD-managed data:


# lsblk

NAME                            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT

sr0                              11:0    1  1024M  0 rom

sda                               8:0    0 465.8G  0 disk

├─sda1                            8:1    0   500M  0 part /boot

├─sda2                            8:2    0 445.8G  0 part

│ ├─vg_ausha1srv-lv_root (dm-0) 253:0    0   5.1G  0 lvm  /

│ ├─vg_ausha1srv-lv_swap (dm-1) 253:1    0   5.9G  0 lvm  [SWAP]

│ ├─vg_ausha1srv-lv_home (dm-2) 253:2    0  19.5G  0 lvm  /home

│ └─vg_ausha1srv-lv_var (dm-3)  253:3    0 415.3G  0 lvm  /var

└─sda3


As per instructions, If your hosts don’t already have an empty partition that you plan to use for the DRBD-managed data then that must be created first – even before that confirm that you have a disk available which hasn’t already been partitioned:


# fdisk -cu /dev/sda3


The device presents a logical sector size that is smaller than

the physical sector size. Aligning to a physical sector (or optimal

I/O) size boundary is recommended, or performance may be impacted.


Command (m for help): p


Disk /dev/sda3: 21.0 GB, 20971520000 bytes

255 heads, 63 sectors/track, 2549 cylinders, total 40960000 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 4096 bytes

I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk identifier: 0x722c5a42


     Device Boot      Start         End      Blocks   Id  System


Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 1

First sector (2048-40959999, default 2048):

Using default value 2048

Last sector, +sectors or +size{K,M,G} (2048-40959999, default 40959999):

Using default value 40959999


Command (m for help): p


Disk /dev/sda3: 21.0 GB, 20971520000 bytes

255 heads, 63 sectors/track, 2549 cylinders, total 40960000 sectors

Units = sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 4096 bytes

I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk identifier: 0x722c5a42


     Device Boot      Start         End      Blocks   Id  System

/dev/sda3p1            2048    40959999    20478976   83  Linux


Command (m for help): w

The partition table has been altered!


Calling ioctl() to re-read partition table.


WARNING: Re-reading the partition table failed with error 22: Invalid argument.

The kernel still uses the old table. The new table will be used at

the next reboot or after you run partprobe(8) or kpartx(8)

Syncing disks.


# mkfs.ext4 /dev/sda3

# lsblk

NAME                            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT

sr0                              11:0    1  1024M  0 rom

sda                               8:0    0 465.8G  0 disk

├─sda1                            8:1    0   500M  0 part /boot

├─sda2                            8:2    0 445.8G  0 part

│ ├─vg_ausha1srv-lv_root (dm-0) 253:0    0   5.1G  0 lvm  /

│ ├─vg_ausha1srv-lv_swap (dm-1) 253:1    0   5.9G  0 lvm  [SWAP]

│ ├─vg_ausha1srv-lv_home (dm-2) 253:2    0  19.5G  0 lvm  /home

│ └─vg_ausha1srv-lv_var (dm-3)  253:3    0 415.3G  0 lvm  /var

└─sda3                            8:3    0  19.5G  0 part <——----- OK



# drbdadm create-md clusterdb_res

md_offset 20971515904

al_offset 20971483136

bm_offset 20970840064


Found ext3 filesystem

    20480000 kB data area apparently used

    20479336 kB left usable by current configuration


Device size would be truncated, which

would corrupt data and result in

'access beyond end of device' errors.

You need to either

   * use external meta data (recommended)

   * shrink that filesystem first

   * zero out the device (destroy the filesystem)

Operation refused.


Command 'drbdmeta 0 v08 /dev/sda3 internal create-md' terminated with exit code 40

drbdadm create-md clusterdb_res: exited with code 40



I have gone over old queries about this same subject, but no one gives a detail description on how to solve this. Here is my /etc/drbd.d/clusterdb_res.res file.


on ha1-srv {

device /dev/drbd0;

disk /dev/sda3;

address   1.1.1.11:7788;

flexible-meta-disk internal;

}


on ha2-srv {

device /dev/drbd0;

disk /dev/sda3;

address  1.1.1.12:7788;

meta-disk internal;

}


I will appreciate if you can look at the steps I am following and tell me if I am missing something. Let me know if you need more information.


Many Thanks in Advance,

Jaime

--



Infosim Germany – Singapore – North America
Friedrich-Bergius-Ring 15, 97076 Wuerzburg, Germany
Tel: +49 (0) 931 205 92 200
http://www.infosim.net

--
Infosim GmbH & Co. KG – trade register Wuerzburg HRA 5400 / CEO Dr. Stefan Kohler
Infosim Verwaltungs GmbH – trade register Wuerzburg HRB 8208 / CEO Dr. Stefan Kohler

Check out the new StableNet(R) release 6.7!


More information about the drbd-user mailing list