Operating System - Linux
1819792 Members
3030 Online
109607 Solutions
New Discussion юеВ

diff b/w /dev/dm-0 and /dev/mapper/36005.......

 
SOLVED
Go to solution
Maaz
Valued Contributor

diff b/w /dev/dm-0 and /dev/mapper/36005.......

this machine is connected to a FC LUN via multiple paths. /dev/sd{a,b,c,d} are the same/one LUN. The Linux Multipath daemon is working on this machine.

fdisk shows the /dev/dm-0, while 'df -hT' shows /dev/mapper/3600508b40006e2cc0000c000005d0000 , likewise /etc/fstab also contains /dev/mapper/3600508b40006e2cc0000c000005d0000, instead of /dev/dm-0.

why the difference ? I mean if I have a disk '/dev/cciss/c0d0p1, then 'fdisk' and 'df' both shows this disk without any difference.

but in case of multipathing fdisk and df shows different names of the same disk .. why ?

Please help
Regards

# fdisk -l

Disk /dev/cciss/c0d0: 73.3 GB, 73369497600 bytes
255 heads, 63 sectors/track, 8920 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/cciss/c0d0p1 1 262 2104483+ 82 Linux swap / Solaris
/dev/cciss/c0d0p2 * 263 288 208845 83 Linux
/dev/cciss/c0d0p3 289 8920 69336540 83 Linux

Disk /dev/sda: 300.6 GB, 300647710720 bytes
255 heads, 63 sectors/track, 36551 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sda doesn't contain a valid partition table

Disk /dev/sdb: 300.6 GB, 300647710720 bytes
255 heads, 63 sectors/track, 36551 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 300.6 GB, 300647710720 bytes
255 heads, 63 sectors/track, 36551 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdc doesn't contain a valid partition table

Disk /dev/sdd: 300.6 GB, 300647710720 bytes
255 heads, 63 sectors/track, 36551 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdd doesn't contain a valid partition table

Disk /dev/dm-0: 300.6 GB, 300647710720 bytes
255 heads, 63 sectors/track, 36551 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/dm-0 doesn't contain a valid partition table

virtual:~
4 REPLIES 4
Matti_Kurkela
Honored Contributor

Re: diff b/w /dev/dm-0 and /dev/mapper/36005.......

/dev/dm-* devices belong to the "device-mapper" subsystem, which is used to implement LVM, dm-multipath and software RAID in Linux 2.6.* kernel series.

The /dev/dm-* names are not persistent: they are allocated ascending order to whatever disk device-mapper is used with. There is no guarantee that /dev/dm-0 will still be /dev/dm-0 after a reboot. These device names should only be used for device-mapper debugging.

The /dev/mapper/ is the WWID reported by the disk, so it is guaranteed to always refer to that particular disk and nothing else.

MK
MK
Maaz
Valued Contributor

Re: diff b/w /dev/dm-0 and /dev/mapper/36005.......

thanks Matti Kurkela for help/reply.

OK, I got you.
now please explain me one more thing...

on this machine when I ran the GUI tool(YaST) for managing storage device and file systems, I found this FC LUN as "/dev/mapper/", the GUI tool does not shows the /dev/dm-*.

but fdisk only shows the /dev/dm-*.

Now my question is that, if I try to create a file system on this FC connected LUN from command line, then how do I know the /dev/mapper/ of the LUN ? because fdisk only shows the /dev/dm-*. I mean without using the GUI tool how can I know the /dev/mapper/ ?

how to know the "/dev/mapper/" of /dev/dm-0 ?

say I want to make a file system, and fdisk reports me /dev/dm-0, now on command line
# mkfs.ext3 /dev/mapper/
so how do I know the long series of number related to this /dev/dm-0

Regards



Matti_Kurkela
Honored Contributor
Solution

Re: diff b/w /dev/dm-0 and /dev/mapper/36005.......

Apparently fdisk is missing the programming to automatically detect multipath devices. But if you use "fdisk /dev/mapper/", it should work.

The /dev/dm-* devices can be used for many purposes: LVM, software RAID, and multipathing for example. For some reason fdisk lists the dm-* devices, although they are not useful for permanent configurations of any kind.

If you need to know the current mapping between /dev/dm-* devices and /dev/mapper/* devices, use "ls -l /dev/dm-*" and "ls -l /dev/mapper". If a /dev/dm-* device has the same major and minor device number than the /dev/mapper/* device, it refers to the same disk.

If you are using a complex device-mapper setup (e.g. multipathing + LVM), try "dmsetup ls --tree" to get a quick view of how the various mappings interact.

MK
MK
Steven E. Protter
Exalted Contributor

Re: diff b/w /dev/dm-0 and /dev/mapper/36005.......

Shalom,

The /dev/dm## devices are the result of the built in multi-pathing detecting a second path.

These devices probably should not be used unless you have intentionally provided multi pathing confdiguration.

Ways this can happen:
* Two HBA cards providing two paths to the same disk.

You can use these devices if you complete configuration of multi pathing.

Or you can ignore them.

The choice is yours.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com