Re: Identifying useable block devices

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

 



On 01/16/2014 02:32 AM, Paul B. Henson wrote:
>> Anatoly Pugachev
>> Sent: Wednesday, January 15, 2014 12:25 PM
>>
>>> the /dev/mapper/.. devices are for internal use only.
>>
>> If so, how come most commands use it (df, mount, findmnt, etc..) and
>> not /dev/vg/vol notation?
> 
> Because /dev/vg/vol is just a symlink to /dev/mapper/vg-vol, and mount
> dereferences it and uses the authoritative name when it actually mounts it.

This applies only if the symlinks/nodes are created directly with
libdevmapper - which is the old classical way. If udev is used to manage /dev
content for dm/lvm devices then the /dev/vg/vol is a symlink to /dev/dm-X
(also /dev/mapper/vg-vol is a symlink to /dev/dm-X). And dm-X is not a
stable name - it can be different across reboots and activation/deactivation
cycle (hence it's never used in scripts etc.). So you have to be very careful
when dereferencing symlinks.

As for mount, findmnt and other utilities from util-linux - they all use
one common code which can handle this situation (e.g. if you call
"findmnt /dev/vg/vol", it shows you /dev/mapper/vg-vol on output, not
the dm-X the /dev/vg/vol is referencing actually).
-- 
Peter

_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/




[Index of Archives]     [Gluster Users]     [Kernel Development]     [Linux Clusters]     [Device Mapper]     [Security]     [Bugtraq]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]

  Powered by Linux