7 After the block devices on both nodes are fully synchronized, format the DRBD device on the
primary with a file system such as reiserfs. Any Linux file system can be used. For example,
enter
mkfs.reiserfs -f /dev/drbd0
IMPORTANT: Always use the /dev/drbd<n> name in the command, not the actual /
dev/disk device name.
9.4 Testing the DRBD Service
If the install and configuration procedures worked as expected, you are ready to run a basic test of
the drbd functionality. This test also helps with understanding how the software works.
1 Test the DRBD service on node 1.
1a Open a terminal console, then log in as the root user or equivalent.
1b Create a mount point on node 1, such as /r0mount, by entering
mkdir /r0mount
1c Mount the drbd device by entering
mount -o rw /dev/drbd0 /r0mount
1d Create a file from the primary node by entering
touch /r0mount/from_node1
2 Test the DRBD service on node 2.
2a Open a terminal console, then log in as the root user or equivalent.
2b Dismount the disk on node 1 by typing the following command on node 1:
umount /r0mount
2c Downgrade the DRBD service on node 1 by typing the following command on node 1:
drbdadm secondary r0
2d On node 2, promote the DRBD service to primary by entering
drbdadm primary r0
2e On node 2, check to see if node 2 is primary by entering
rcdrbd status
2f On node 2, create a mount point such as /r0mount, by entering
mkdir /r0mount
2g On node 2, mount the DRBD device by entering
mount -o rw /dev/drbd0 /r0mount
2h Verify that the file you created on node 1 in
ls /r0mount
The /r0mount/from_node1 file should be listed.
3 If the service is working on both nodes, the DRBD setup is complete.
4 Set up node 1 as the primary again.
4a Dismount the disk on node 2 by typing the following command on node 2:
umount /r0mount
4b Downgrade the DRBD service on node 2 by typing the following command on node 2:
Step 1d
is viewable by entering
Installing and Managing DRBD Services 103
Need help?
Do you have a question about the LINUX ENTERPRISE SERVER 10 - STORAGE ADMINISTRATION GUIDE 7-2007 and is the answer not in the manual?