3

I'm trying to figure out what partition dm-X is on. It's on /dev/sdaX, but which X? What am I missing? I know there has to be a way to find this out. I need to grow my physical volume, but can't do it until I know which partition to touch. Here's what I've tried so far:

root@debian:~# ls /dev/sda*
/dev/sda  /dev/sda1  /dev/sda2  /dev/sda5

root@debian:~# ls -l /dev/mapper/*
crw------- 1 root root 10, 59 Jan 24 15:33 /dev/mapper/control
lrwxrwxrwx 1 root root      7 Jan 24 15:33 /dev/mapper/debian-home -> ../dm-6
lrwxrwxrwx 1 root root      7 Jan 24 15:33 /dev/mapper/debian-root -> ../dm-1
lrwxrwxrwx 1 root root      7 Jan 24 15:33 /dev/mapper/debian-swap_1 -> ../dm-4
lrwxrwxrwx 1 root root      7 Jan 24 15:33 /dev/mapper/debian-tmp -> ../dm-5
lrwxrwxrwx 1 root root      7 Jan 24 15:33 /dev/mapper/debian-usr -> ../dm-2
lrwxrwxrwx 1 root root      7 Jan 24 15:33 /dev/mapper/debian-var -> ../dm-3
lrwxrwxrwx 1 root root      7 Jan 24 15:33 /dev/mapper/sda5_crypt -> ../dm-0

root@debian:~# pvs
  PV         VG     Fmt  Attr PSize PFree
  /dev/dm-0  debian lvm2 a-   7.76g    0 

root@debian:~# pvscan
  PV /dev/dm-0   VG debian   lvm2 [7.76 GiB / 0    free]
  Total: 1 [7.76 GiB] / in use: 1 [7.76 GiB] / in no VG: 0 [0   ]

root@debian:~# pvdisplay
  --- Physical volume ---
  PV Name               /dev/dm-0
  VG Name               debian
  PV Size               7.76 GiB / not usable 1020.00 KiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              1986
  Free PE               0
  Allocated PE          1986
  PV UUID               cR4fIF-sUtS-edOh-7bB2-eKgV-jf1H-oHy3Ml
1
  • Is this the giveaway here? lrwxrwxrwx 1 root root 7 Jan 24 15:33 /dev/mapper/sda5_crypt -> ../dm-0
    – zonkybonk
    Jan 25, 2012 at 3:42

1 Answer 1

1

Your listing of /dev/mapper shows that sda5_crypt points to /dev/dm-0, so chances are the underlying partition is /dev/sda5. If you want to be sure, check /etc/crypttab. If you want to be really sure, use dmsetup ls.

1
  • Ahh, yes /etc/crypttab shows the volume. Thanks!
    – zonkybonk
    Jan 25, 2012 at 18:04

You must log in to answer this question.

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