Hi,<br><br>I am testing a mirror target for dmsetup. After creating the dm device I cannot the underlying block device.<br><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# dumpe2fs /dev/loop0 | head</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">dumpe2fs 1.41.12 (17-May-2010)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Filesystem volume name:   <none></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Last mounted on:          <not available></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Filesystem UUID:          9c0f4d5c-55d9-4332-b0e7-f48a19333174</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Filesystem magic number:  0xEF53</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Filesystem revision #:    1 (dynamic)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Filesystem features:      has_journal ext_attr resize_inode dir_index filetype sparse_super</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Filesystem flags:         signed_directory_hash</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Default mount options:    (none)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Filesystem state:         clean</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Errors behavior:          Continue</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# dumpe2fs /dev/loop1 | head</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">dumpe2fs 1.41.12 (17-May-2010)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Filesystem volume name:   <none></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Last mounted on:          <not available></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Filesystem UUID:          c16fcae4-2271-4701-a91e-6694962935d0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Filesystem magic number:  0xEF53</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Filesystem revision #:    1 (dynamic)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Filesystem features:      has_journal ext_attr resize_inode dir_index filetype sparse_super</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Filesystem flags:         signed_directory_hash</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Default mount options:    (none)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Filesystem state:         clean</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Errors behavior:          Continue</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# mount /dev/loop0 /mnt/ ; mount | grep loop0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">/dev/loop0 on /mnt type ext3 (rw)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# umount /mnt/</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# mount /dev/loop1 /mnt/ ; mount | grep loop1</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">/dev/loop1 on /mnt type ext3 (rw)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# umount /mnt/</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# dmsetup create raid1 --table "0 204800 mirror core 1 128 2 7:0 0 7:1 0"</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# dmsetup table raid1</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">0 204800 mirror core 1 128 2 7:0 0 7:1 0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# dmsetup info raid1</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Name:              raid1</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">State:             ACTIVE</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Read Ahead:        256</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Tables present:    LIVE</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Open count:        0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Event number:      1</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Major, minor:      253, 6</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Number of targets: 1</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# dmsetup info -c raid1</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Name             Maj Min Stat Open Targ Event  UUID</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">x                253   6 L--w    0    1      1</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# dmsetup deps raid1</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">2 dependencies  : (7, 1) (7, 0)</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# dmsetup status /dev/mapper/raid1</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">0 204800 mirror 2 7:0 7:1 1600/1600 1 AA 1 core</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">I have mounted the newly created dm device and copied some data to it. </span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# mount /dev/mapper/raid1 /mnt/ ; mount | grep raid1</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">/dev/mapper/raid1 on /mnt type ext3 (rw)</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# cp /var/log/messages /mnt/</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# ls -l /mnt/</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">total 51</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">drwx------. 2 root root 12288 Nov  2 22:32 lost+found</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">-rw-------. 1 root root 37417 Nov  2 22:38 messages</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">I have now unmounted the dm device to test if the daya is written to the underlying block device.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# umount /mnt/</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# dmsetup info raid1</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Name:              raid1</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">State:             ACTIVE</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Read Ahead:        256</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Tables present:    LIVE</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Open count:        0</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Event number:      1</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Major, minor:      253, 6</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Number of targets: 1</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Here the open count is "ZERO", but still I cannot mount the underlying block device.</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# mount /dev/loop0 /mnt/</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">mount: /dev/loop0 already mounted or /mnt/ busy</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# mount /dev/loop1 /mnt/</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">mount: /dev/loop1 already mounted or /mnt/ busy</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">But if I remove the dm device created and try to mount the underlying block-device, I can mount both the device which took part in mirroring and I can access the data in both the disk.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# dmsetup remove raid1</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# mount /dev/loop0 /mnt/</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# ls -l /mnt/</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">total 51</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">drwx------. 2 root root 12288 Nov  2 22:32 lost+found</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-rw-------. 1 root root 37417 Nov  2 22:38 messages</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# umount /mnt/</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# mount /dev/loop1 /mnt/</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">[root@bladelinux01 ~]# ls -l /mnt/</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">total 51</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">drwx------. 2 root root 12288 Nov  2 22:32 lost+found</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">-rw-------. 1 root root 37417 Nov  2 22:38 messages</span><br style="font-family: courier new,monospace;" clear="all">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Why is this behavior. any explanation, please....</span><br> <br><span style="font-family:courier new,monospace">-- sanjana</span><br>
<br>