Command to see the logical volume path, device mapper path and its corresponding dm device path


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Command to see the logical volume path, device mapper path and its corresponding dm device path
# 1  
Old 11-21-2017
Command to see the logical volume path, device mapper path and its corresponding dm device path

Currently I am using this laborious command
Code:
lvdisplay | awk '/LV Path/ {p=$3} /LV Name/ {n=$3} /VG Name/ {v=$3}  /Block device/ {d=$3; sub(".*:", "/dev/dm-", d); printf "%s\t%s\t%s\n", p, "/dev/mapper/"v"-"n, d}'

Would like to know if there is any shorter method to get this mapping of combined output (lvpath, /dev/mapper/ and /dev/dm/* ), possibly a single command.
# 2  
Old 11-21-2017
I don't know this command. I don't have any logical volumes so I cannot experiment with the command on my system. But the man page on lvdisplay tells me to use lvs and that command has a -o switch which can be used to select the attributes you are looking for.
eg
Code:
lvs -o lv_path,lv_name,vg_name

and so on. Try
Code:
lvs -o help

for a full list.

Andrew
# 3  
Old 11-21-2017
Quote:
Originally Posted by apmcd47
I don't know this command. I don't have any logical volumes so I cannot experiment with the command on my system. But the man page on lvdisplay tells me to use lvs and that command has a -o switch which can be used to select the attributes you are looking for.
eg
Code:
lvs -o lv_path,lv_name,vg_name

and so on. Try
Code:
lvs -o help

for a full list.

Andrew
Andrew, thank you for the suggestion. I had already explored lvs -o and I did not see any provision to get device mapper path and dm device path as I expected using that

Last edited by rbatte1; 11-21-2017 at 11:37 AM.. Reason: Change CODE tags to ICODE tags within a paragraph
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Convert Relative path to Absolute path, without changing directory to the file location.

Hello, I am creating a file with all the source folders included in my git branch, when i grep for the used source, i found source included as relative path instead of absolute path, how can convert relative path to absolute path without changing directory to that folder and using readlink -f ? ... (4 Replies)
Discussion started by: Sekhar419
4 Replies

2. Shell Programming and Scripting

Moving files from parent path to multiple child path using bash in efficient way

Hi All, Can you please provide some pointers to move files from Base path to multiple paths in efficient way.Folder Structure is already created. /Path/AdminUser/User1/1111/Reports/aaa.txt to /Path/User1/1111/Reports/aaa.txt /Path/AdminUser/User1/2222/Reports/bbb.txt to... (6 Replies)
Discussion started by: karthikgv417
6 Replies

3. Red Hat

Ethernet Port device path?

Hi, I have a server program that reads data coming in on USB ports. Device paths are in the format: /dev/ttyUSB0 Now, I would like to log data from another device coming in over Ethernet. My first step is trying to track down what the correct device path is which I am unsure of. Anyone... (9 Replies)
Discussion started by: fedora18
9 Replies

4. Solaris

Tape device 1cbn path not getting created

After we upgraded one PW450 machine from (networker 7.2 & solaris 9) to (networker 7.4 and solaris 10) through scratch installation Only one of two HP tape drives is shown in inquire command And we are getting strange logs in messages file (attached) For 2nd drive 1cbn character specific file... (4 Replies)
Discussion started by: kashif_islam
4 Replies

5. UNIX for Advanced & Expert Users

PATH included in .o file of device driver

Hello friends, I am building one driver related to wifi. When I am looking its hex dump, I can see that it is including a path to one particular file of kernel headers. It is as under. 6C 75 65 2E 0A 00 00 00 25 64 2E 25 64 2E 25 64 lue.....%d.%d.%d 2D 25 73 00 00 00 00 00 42 45... (4 Replies)
Discussion started by: linuxdevnoob
4 Replies

6. Red Hat

device-mapper-multipath path [undef]

I have an HP blade with Qlogic HBA's connected to an EVA8000. I have downloaded the latest multipath.conf from HP's website. The drive presented to the server appears to be configured and working except the output of "multipath -l" shows for all paths. What is causing this output? mpath0... (2 Replies)
Discussion started by: manzier
2 Replies

7. Shell Programming and Scripting

Executing Commands From Non-Standard Path (Changing user's PATH secretely???)

Hi: I have a requirement as below: I have some standard Unix commands modified and kept them in a directory say /usr/clsh/bin. For example I have a script named "ls" kept here which is modified version of "ls" (say it always gives long listing i.e. ls -l). When any user logs on and types... (2 Replies)
Discussion started by: ramesh_samane
2 Replies

8. AIX

Logical volume to raw device

Hy I have several logical volumes that are turned into raw devices used by Informix DB. I would like to add some more. In /dev directory i see logical volumes as block files: lv_name1, lv_name2 ... and i see raw devices defined as character files: rlv_name1, rlv_name2 ... As i see,... (5 Replies)
Discussion started by: veccinho
5 Replies

9. HP-UX

Question about the hareware path and device name

# ioscan -f | grep disk Class I H/W Path Driver S/W State H/W Type Description disk 3 0/0/2/0.0.0.0 sdisk CLAIMED DEVICE TEAC DV-28E-N disk 1 0/1/1/0.0.0 sdisk CLAIMED DEVICE HP 146 GST3146707LC ... (1 Reply)
Discussion started by: bluepluto
1 Replies

10. UNIX for Dummies Questions & Answers

serial port device path

hi. Im trying to install a switch. And the manual says i should type a command including a SerialPortDevicePath. which is the filepath to serial port used for connection. However.. nothing about how to find this info. Could anyone help me where to find this path? thx mr.T (6 Replies)
Discussion started by: tyskertøs
6 Replies
Login or Register to Ask a Question