Cannot mount underlying block device after creating dm device.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am testing a mirror target for dmsetup. After creating the dm device I cannot the underlying block device.

[root@bladelinux01 ~]# dumpe2fs /dev/loop0 | head
dumpe2fs 1.41.12 (17-May-2010)
Filesystem volume name:   <none>
Last mounted on:          <not available>
Filesystem UUID:          9c0f4d5c-55d9-4332-b0e7-f48a19333174
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype sparse_super
Filesystem flags:         signed_directory_hash
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue
[root@bladelinux01 ~]# dumpe2fs /dev/loop1 | head
dumpe2fs 1.41.12 (17-May-2010)
Filesystem volume name:   <none>
Last mounted on:          <not available>
Filesystem UUID:          c16fcae4-2271-4701-a91e-6694962935d0
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr resize_inode dir_index filetype sparse_super
Filesystem flags:         signed_directory_hash
Default mount options:    (none)
Filesystem state:         clean
Errors behavior:          Continue


[root@bladelinux01 ~]# mount /dev/loop0 /mnt/ ; mount | grep loop0
/dev/loop0 on /mnt type ext3 (rw)
[root@bladelinux01 ~]# umount /mnt/

[root@bladelinux01 ~]# mount /dev/loop1 /mnt/ ; mount | grep loop1
/dev/loop1 on /mnt type ext3 (rw)
[root@bladelinux01 ~]# umount /mnt/

[root@bladelinux01 ~]# dmsetup create raid1 --table "0 204800 mirror core 1 128 2 7:0 0 7:1 0"

[root@bladelinux01 ~]# dmsetup table raid1
0 204800 mirror core 1 128 2 7:0 0 7:1 0
[root@bladelinux01 ~]# dmsetup info raid1
Name:              raid1
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        0
Event number:      1
Major, minor:      253, 6
Number of targets: 1

[root@bladelinux01 ~]# dmsetup info -c raid1
Name             Maj Min Stat Open Targ Event  UUID
x                253   6 L--w    0    1      1
[root@bladelinux01 ~]# dmsetup deps raid1
2 dependencies  : (7, 1) (7, 0)

[root@bladelinux01 ~]# dmsetup status /dev/mapper/raid1
0 204800 mirror 2 7:0 7:1 1600/1600 1 AA 1 core

I have mounted the newly created dm device and copied some data to it.
[root@bladelinux01 ~]# mount /dev/mapper/raid1 /mnt/ ; mount | grep raid1
/dev/mapper/raid1 on /mnt type ext3 (rw)

[root@bladelinux01 ~]# cp /var/log/messages /mnt/
[root@bladelinux01 ~]# ls -l /mnt/
total 51
drwx------. 2 root root 12288 Nov  2 22:32 lost+found
-rw-------. 1 root root 37417 Nov  2 22:38 messages

I have now unmounted the dm device to test if the daya is written to the underlying block device.
[root@bladelinux01 ~]# umount /mnt/

[root@bladelinux01 ~]# dmsetup info raid1
Name:              raid1
State:             ACTIVE
Read Ahead:        256
Tables present:    LIVE
Open count:        0
Event number:      1
Major, minor:      253, 6
Number of targets: 1

Here the open count is "ZERO", but still I cannot mount the underlying block device.

[root@bladelinux01 ~]# mount /dev/loop0 /mnt/
mount: /dev/loop0 already mounted or /mnt/ busy
[root@bladelinux01 ~]# mount /dev/loop1 /mnt/
mount: /dev/loop1 already mounted or /mnt/ busy

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.
[root@bladelinux01 ~]# dmsetup remove raid1
[root@bladelinux01 ~]# mount /dev/loop0 /mnt/
[root@bladelinux01 ~]# ls -l /mnt/
total 51
drwx------. 2 root root 12288 Nov  2 22:32 lost+found
-rw-------. 1 root root 37417 Nov  2 22:38 messages

[root@bladelinux01 ~]# umount /mnt/
[root@bladelinux01 ~]# mount /dev/loop1 /mnt/
[root@bladelinux01 ~]# ls -l /mnt/
total 51
drwx------. 2 root root 12288 Nov  2 22:32 lost+found
-rw-------. 1 root root 37417 Nov  2 22:38 messages

Why is this behavior. any explanation, please....
 
-- sanjana

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel

[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux