Mailing List Archive

after drbd down , is it safe to mount underlying device
Hi,?

Small question regarding the underlying disk

If on the primary, and I started drbd on a disk with existing data,

some time later I unmount and I down drbd....

Can I directly mount the disk again without risk of corruption? or once drbd always drbd?

Cheers,
Tim
Re: after drbd down , is it safe to mount underlying device [ In reply to ]
> Small question regarding the underlying disk
>
> If on the primary, and I started drbd on a disk with existing data,
>
> some time later I unmount and I down drbd....
>
> Can I directly mount the disk again without risk of corruption? or once drbd always drbd?

This is safe so long as you don't write (if you intend to reform the DRBD resource) but beware even mounting some filesystems with `-o ro` can still result in writes. You can add a generic step to prevent this by creating a loop device from the block device:

# losetup -Pfvr --show /dev/....

# ls /dev/loop1*
/dev/loop1 /dev/loop1p1 /dev/loop1p2

# mount /dev/loop1p2 /tmp/x
Error opening '/dev/loop1p2' read-write
Could not mount read-write, trying read-only

(That happened to be an NTFS formatted partition from a virtual machine)

If you do write to the disk and bypass drbd then you'll need to invalidate the secondary and resync.

James