In /proc/mounts
, my system used to show /dev/mapper/sda2_crypt
as /
. After used for some days, including kernel and software upgrading, the line changed to /dev/dm-0
as /
. What happened? I booted into the old kernel and it was still /dev/dm-0
.
1 Answer
It's normal when you are using a multipath device. Each multipath device has a World Wide Identifier (WWID), which is guaranteed to be globally unique and unchanging. By default, the name of a multipath device is set to its WWID. Alternately, you can set the user_friendly_names option in the multipath configuration file, which causes DM-Multipath to use a node-unique alias of the form mpathn as the name. For example, a node with two HBAs attached to a storage controller with two ports via a single unzoned FC switch sees four devices: /dev/sda
, /dev/sdb
, /dev/sdc
, and /dev/sdd
.
DM-Multipath creates a single device with a unique WWID that reroutes I/O to those four underlying devices according to the multipath configuration. When the user_friendly_names
configuration option is set to yes in /etc/multipath.conf
, the name of the multipath device is set to mpathn. When new devices are brought under the control of DM-Multipath, the new devices may be seen in two different places under the /dev directory: /dev/mapper/mpathn
and /dev/dm-n
.
- The devices in
/dev/mapper
are created early in the boot process. Use these devices to access the multipathed devices, for example when creating logical volumes. - Any devices of the form
/dev/dm-n
are for internal use only and should never be used.
You can also set the name of a multipath device to a name of your choosing by using the alias option in the multipaths section of the multipath configuration file.
For more information see this The DM-Multipath Configuration File
-
Sorry, I am still confused. I do not have multipath related packages installed. And I do not have /etc/multipath.conf, either. I also blacklisted dm_multipath.ko. So why the internal mount point changed? Dec 15, 2015 at 14:03
-
Another point is that, as you said sda1_crypt is created early, is it earlier than dm-0? I see sda1_crypt is just a link to dm-0. Dec 15, 2015 at 14:04
-
-
It is Trusty. Everything updated to latest and the new kernel is 4.3.2, old one is 4.3.0. Dec 15, 2015 at 15:12
-
I may have found the reason. Some changes in 4.3 on BTRFS made the difference. I mean by my testing, only BTRFS + 4.3 kernel changed from
/dev/mapper/something
to/dev/dm-x
. Dec 20, 2015 at 9:16