欢迎各位兄弟 发布技术文章
这里的技术是共享的
[root@node1 drbd.d]# mke2fs -j /dev/drbd0
mke2fs 1.39 (29-May-2006)
mke2fs: 错误的介质类型 while trying to determine filesystem size
原因是您在辅助节点上,而/ dev / drbd0是只读的.切换到主节点,然后重试.
[root@node1 drbd.d]# drbd-overview #看到了吧 ,本节点是 Secondary ,不是主节点
0:mydrbd Connected Secondary/Secondary UpToDate/UpToDate C r-----
[root@node1 drbd.d]# drbdadm -- --overwrite-data-of-peer primary mydrbd #设置主节点
[root@node1 drbd.d]# drbd-overview #此时本节点是主节点 Primary
0:mydrbd Connected Primary/Secondary UpToDate/UpToDate C r-----
[root@node1 drbd.d]# mke2fs -j /dev/drbd0 #此时能正常格式化
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
123648 inodes, 246974 blocks
12348 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=255852544
8 block groups
32768 blocks per group, 32768 fragments per group
15456 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 29 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
[root@node1 drbd.d]#