使用 drbdadm create-md res1的时候报错如下:
# drbdadm create-md res1
md_offset 214747312128
al_offset 214747279360
bm_offset 214740725760
Found ext3 filesystem
209714176 kB data area apparently used
209707740 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 v09 /dev/vdb1 internal create-md 1' terminated with exit code 40
解决方法:
dd if=/dev/zero of=/dev/vdb1 bs=1M count=128
参考链接:
https://www.recitalsoftware.com/blogs/28-howto-drbd-drbdadm-create-md-fails
https://serverfault.com/questions/27168/drbd-on-a-disk-with-existing-file-system-that-takes-all-the-place
原因分析:
DRBD在使用create-md时,发现在所要使用的vdb磁盘上已存在文件系统,这时DRBD会阻止向磁盘上写元数据。所以在使用DRBD时,磁盘使用fdisk划分好分区就行了,不需要格式化。如发现不对,欢迎指正。