17

This is a just upgraded Ubuntu 10.04.1 LTS machine.

The /dev/mapper/isw_dghbbcaabe_RAID_Volume11 is "new" to the upgrade but I don't know what physical drives/partitions are included in the "device".

I have tried:

root@barabasi:~# blkid   
/dev/sda1: UUID="8258e116-265a-4797-59d1-fae72a643620" TYPE="swap" 
/dev/sdb: TYPE="isw_raid_member" 
/dev/mapper/isw_dghbbcaabe_RAID_Volume11: UUID="1d4721b1-5649-4772-8a03-5c3db81eba1b" TYPE="ext3" 
/dev/mapper/isw_dghbbcaabe_RAID_Volume15: UUID="b9a639af-dee8-4e0c-90f6-15432efac4f2" TYPE="swap"

and

root@barabasi:~# ls -alh /dev/disk/by-uuid/  
total 0 
drwxr-xr-x 2 root root 100 2011-01-14 12:49 . 
drwxr-xr-x 5 root root 100 2011-01-14 12:49 .. 
lrwxrwxrwx 1 root root 41 2011-01-14 12:49 1d4721b1-5649-4772-8a03-5c3db81eba1b ->    ../../mapper/isw_dghbbcaabe_RAID_Volume11 
lrwxrwxrwx 1 root root 10 2011-01-14 12:49 8258e116-265a-4797-59d1-fae72a643620 -> ../../sda1 
lrwxrwxrwx 1 root root 41 2011-01-14 12:49 b9a639af-dee8-4e0c-90f6-15432efac4f2 -> ../../mapper/isw_dghbbcaabe_RAID_Volume15

But I still don't know what physical drives are involved.

6 Answers 6

19

Best quick overview I have seen is lsblk, which prints a reasonable output even if you have a complicated setup.

$ lsblk
NAME                     MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda                        8:0    0 223,6G  0 disk 
├─sda1                     8:1    0   350M  0 part 
├─sda2                     8:2    0    29G  0 part 
├─sda3                     8:3    0   488M  0 part /boot
├─sda4                     8:4    0     1K  0 part 
└─sda5                     8:5    0 193,8G  0 part 
  ├─vg_ssd-lv_root_solid 254:0    0  13,3G  0 lvm  /
  ├─vg_ssd-lv_srv_solid  254:2    0  46,6G  0 lvm  /srv
  └─vg_ssd-lv_home_solid 254:3    0   107G  0 lvm  /home
sdb                        8:16   0  74,5G  0 disk 
└─sdb1                     8:17   0  74,5G  0 part 
  ├─vg_ssd-lv_swap_solid 254:1    0   3,7G  0 lvm  [SWAP]
  └─vg_ssd-lv_videos     254:4    0    28G  0 lvm  /mnt/videos

See also: this more detailed answer on server fault.

2
  • I think this is really a quick and easy way to find it out! Thanks.
    – russoue
    Oct 11, 2018 at 19:49
  • Thank you! This should be the accepted answer. Sep 25, 2019 at 1:20
13

I found the easiest command is -

$ sudo dmsetup deps -o devname

Which gives you the actual device name without the need to figure out the major/minor numbers.

5

Or just execute the following command:

$ sudo dmsetup ls --tree

which will show how your block devices are stacked.

1
  • This one doesn't seem to give the underlying /dev/sdX devices for me, just the major/minor number (e.g. (8:2)). Not sure how to get the device name, apart from going to fish in /dev/ for it: ls -al /dev/ | grep '8, *2'
    – mwfearnley
    Dec 20, 2022 at 9:38
3

You can use dmsetup. Invoke:

$ sudo dmsetup -v table /dev/mapper/isw_dghbbcaabe_RAID_Volume11

That will give you a list of sectors which are mapped to another device. In my case (encrypted root partition), I get the following output:

$ sudo dmsetup table /dev/mapper/hacki-mobile 
0 567028121 crypt aes-cbc-essiv:sha256 0000000000000000000000000000000000000000000000000000000000000000 0 8:6 2056

That means that sectors 0-567028121 are mapped to a device with major/minor number 8/6. That is the 6th partition on my sda drive, as you can see with:

$ ls -Al /dev/sda6
brw-rw---- 1 root disk 8, 6 2010-12-21 14:38 /dev/sda6

Your output from dmsetup maybe a bit different, as I'm on Ubuntu 10.04

1

Below are some examples.

lvs -o +devices
lvdisplay -m
lvdisplay | awk '/LV Name/{n=$3} /Block device/{d=$3; sub(".*:","dm-",d); print d,n;}'
2
  • You really should explain how this addresses the question.
    – guntbert
    Jul 15, 2016 at 20:54
  • +1 for sudo lvs -o +devices, but not sure about the others.
    – mwfearnley
    Dec 20, 2022 at 9:41
0

This is just a hint! Because I came to this question and found an answer by myself.

Sometimes you can use ls -lha /dev/mapper/ or similar to see the mapped devices and you can use mount to resolve it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .