Linux

mkfs.ext3:嘗試確定文件系統大小時的介質類型錯誤

  • November 6, 2012

當我嘗試使用 mkfs.ext3 格式化 /dev/drbd0 時,我收到錯誤消息:

mkfs.ext3:嘗試確定文件系統大小時介質類型錯誤。

我在這裡找到了解決方案:

http://eng.eelcowesemann.nl/linux-unix/general/mkfs-ext3-wrong-medium-type-while-trying-to-determine-filesystem-size/

但是,如果我執行 sueggested 命令 drbdadm primary test,我會收到以下錯誤:

0:狀態更改失敗:(-1) 配置命令“drbdsetup 0 primary”不允許多個主節點,退出程式碼為 11

有任何想法嗎 ?

命令 cat /proc/drbd 的輸出:

version: 8.3.7 (api:88/proto:86-91)
srcversion: EE47D8BF18AC166BE219757
0: cs:Connected ro:Secondary/Primary ds:UpToDate/UpToDate C r----
   ns:0 nr:0 dw:0 dr:0 al:0 bm:0 lo:0 pe:0 ua:0 ap:0 ep:1 wo:b oos:0

drbd.conf:

# You can find an example in  /usr/share/doc/drbd.../drbd.conf.example

   #include "drbd.d/global_common.conf";
   #include "drbd.d/*.res";

   global {
      usage-count yes;
  }
common {
syncer {
  rate 100M;
}
}
resource test {
protocol C;
handlers {
pri-on-incon-degr "echo o > /proc/sysrq-trigger ; halt -f";
pri-lost-after-sb "echo o > /proc/sysrq-trigger ; halt -f";
local-io-error "echo o > /proc/sysrq-trigger ; halt -f";
#  outdate-peer "/usr/sbin/drbd-peer-outdater";
}
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;
  # on-disconnect-reconnect;
 after-sb-0pri discard-younger-primary;
 after-sb-1pri consensus;
 after-sb-2pri disconnect;
 rr-conflict disconnect;
# allow-two-primaries;
}
syncer {
  rate 100M;
  al-extents 257;
}
on VOXDEMOSRV01 {
  device     /dev/drbd0;
  disk       /dev/sda6;
  address    192.168.1.134:7788;
  meta-disk /dev/sda7[0];
}
on VOXDEMOSRVOWN01 {
  device     /dev/drbd0;
  disk       /dev/sda2;
  address    192.168.1.146:7788;
meta-disk /dev/sda5[0];

mkfs.ext3:嘗試確定文件系統大小時介質類型錯誤。

原因是您在輔助節點上並且/dev/drbd0是只讀的。切換到主節點並重試。

這個問題可能是因為兩個drbd都是次要的,你必須讓他們一個是主要的,另一個是次要的。下面是我的配置:

#service drbd status
drbd driver loaded OK; device status:
version: 8.3.13 (api:88/proto:86-96)
GIT-hash: 83ca112086600faacab2f157bc5a9324f7bd7f77 build by dag@Build64R6, 2012-05-07 11:52:13

m:res cs ro ds p mounted fstype 1:r0 Connected Secondary/Primar y UpToDate/UpToDate C

引用自:https://serverfault.com/questions/315465