<div>Hi,</div><div>I use sparse files to organize a DRBD resource.</div><div>I am using build from source drbd-8.4.1.</div><div>I use the default commons with device configured as:</div><div><br></div><div><div>[root@nodeb ~]# cat /etc/drbd.d/drbd0.res</div>
<div>resource DRBD0 {</div><div><br></div><div> syncer {</div><div> csums-alg md5;</div><div> }</div><div> on <a href="http://nodea.cyclone-trading.com">nodea.cyclone-trading.com</a> {</div><div> device /dev/drbd0;</div>
<div> disk /dev/loop0;</div><div> address <a href="http://192.168.150.128:7791">192.168.150.128:7791</a>;</div><div> meta-disk /dev/loop1[0];</div><div> }</div><div> on <a href="http://nodeb.cyclone-trading.com">nodeb.cyclone-trading.com</a> {</div>
<div> device /dev/drbd0;</div><div> disk /dev/loop0;</div><div> address <a href="http://192.168.150.129:7791">192.168.150.129:7791</a>;</div><div> meta-disk /dev/loop1[0];</div><div> }</div>
<div>}</div></div><div><br></div><div>The underlying loop devices go to sparse files as follows:</div><div><div>[root@nodeb ~]# losetup -a</div><div>/dev/loop0: [0802]:791356 (/root/LUN0.sparse)</div><div>/dev/loop1: [0802]:791357 (/root/LUN1.sparse)</div>
<div>[root@nodeb ~]# ll LUN*</div><div>-rw-r--r--. 1 root root 1099511627776 May 9 09:37 LUN0.sparse</div><div>-rw-r--r--. 1 root root 134217728 May 9 08:24 LUN1.sparse</div><div>[root@nodeb ~]# du -h LUN*</div><div>
423M LUN0.sparse</div><div>33M LUN1.sparse</div></div><div><br></div><div><br></div><div>everything works as expected until I down DRBD0 mark loop0 as read-only and then try to "up" the DRBD0 resource:</div>
<div><br></div><div><div>[root@nodeb ~]# drbdadm down all</div><div>[root@nodeb ~]# cat /proc/drbd</div><div>version: 8.4.1 (api:1/proto:86-100)</div><div>GIT-hash: 91b4c048c1a0e06777b5f65d312b38d47abaea80 build by <a href="mailto:root@NodeA.cyclone-trading.com">root@NodeA.cyclone-trading.com</a>, 2012-05-09 07:39:38</div>
</div><div><br></div><div><div>[root@nodeb ~]# blockdev --getro /dev/loop0</div><div>0</div><div>[root@nodeb ~]# blockdev --setro /dev/loop0</div><div>[root@nodeb ~]# blockdev --getro /dev/loop0</div><div>1</div><div>[root@nodeb ~]# drbdadm up DRBD0</div>
<div>0: Failure: (104) Can not open backing device.</div><div>Command 'drbdsetup attach 0 /dev/loop0 /dev/loop1 0' terminated with exit code 10</div></div><div><br></div><div>I will highly appreciate the insight on why using a read-only source is a problem - once the metadata device is accessible for writes.</div>
<div><br></div><div>Many Thanks!</div><div>./Dimitar Boyn</div><div><br></div><div><br></div><div><br></div><br>