6

Read my story below.

I'm using LVM2 with following information:

Scan for VG:

# vgs
  VG   #PV #LV #SN Attr   VSize   VFree 
  unix   1   1   0 wz--n- 115.00g 45.00g

Scan for LV

# lvs
  LV   VG   Attr   LSize  Origin Snap%  Move Log Copy%  Convert
  work unix -wi-s- 70.00g

Attempt to activate VG, LV

# vgchange -ay
  device-mapper: resume ioctl failed: Invalid argument
  Unable to resume unix-work (254:1)
  1 logical volume(s) in volume group "unix" now active

Check LV activated or not

# lvdisplay 
  /dev/mapper/unix-work: open failed: No such file or directory
  --- Logical volume ---
  LV Name                /dev/unix/work
  VG Name                unix
  LV UUID                HzzTTr-rX2d-w1dP-NEQL-QksJ-rmHW-jMTxO7
  LV Write Access        read/write
  LV Status              NOT available
  LV Size                70.00 GiB
  Current LE             17920
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto

Because of last command end with error: "/dev/mapper/unix-work: open failed: No such file or directory" Then I have to run vgmknodes to manual create /dev/ nodes as below

# vgmknodes 
  The link /dev/unix/work should had been created by udev but it was not found. Falling back to direct link creation.

Now it look like better with status "suspended"

# lvdisplay 
  --- Logical volume ---
  LV Name                /dev/unix/work
  VG Name                unix
  LV UUID                HzzTTr-rX2d-w1dP-NEQL-QksJ-rmHW-jMTxO7
  LV Write Access        read/write
  LV Status              suspended
  # open                 0
  LV Size                70.00 GiB
  Current LE             17920
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:1

Attempt to mount LV:

# mount /dev/unix/work /mnt/
mount: /dev/mapper/unix-work already mounted or /mnt/ busy

Message from dmesg:

[ 1527.566964] device-mapper: table: 254:1: sda3 too small for target: start=94372224, len=136306688, dev_size=224606491

So, my question is: how can I wake up LV to mount it or use dd command to get data from LVM partition?

Thanks in advanced!

uocnb
  • 383
  • 1
  • 4
  • 12
  • try update the follwing packges kernel , device-mapper, lvm2 .
  • deactivate with vgchange -an , then activate with vgchange -ay.
  • – Hanan Nov 28 '11 at 06:00
  • Already read on LVM FAQ but not tried yet, I'm using live cd of Arch Bang so can not make a kernel update. I think it is not related to kernel since I use live cd before & after this problem happen. FYI: uname -a Linux archbang 3.0-ARCH #1 SMP PREEMPT Wed Oct 19 10:27:51 CEST 2011 x86_64 Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz GenuineIntel GNU/Linux – uocnb Nov 28 '11 at 08:44
  • The output from pvdisplay and fdisk -lu /dev/sda would be helpful. This part makes it sound like your partition holding the PV has shrunk, which is a big problem: sda3 too small for target: start=94372224, len=136306688, dev_size=224606491 – psusi Nov 28 '11 at 15:45
  • @Hannan: I have installed Arch Linux to another partition and using latest linux kernel: Linux hydrogen 3.1.2-1-ARCH #1 SMP PREEMPT Tue Nov 22 09:17:56 CET 2011 x86_64 Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz GenuineIntel GNU/Linux but still get the same result as last time I did.

    @psusi: My hdd is in GPT, so fdisk will not work. I use gdisk (AKA gpt fdisk).

    – uocnb Nov 29 '11 at 02:02
  • @UocNguyen, then whatever the equivalent for gfdisk is. The point is to verify that the partition is as large as LVM expects it to be. – psusi Nov 29 '11 at 02:17
  • @psusi: the size of PV even larger then VG, I tried to extend it to resolve 'too small for target' problem but no luck.
    I tried to use dd to dump that partition but failed because of /dev/mapper/unix-work have 0 bytes of size :(
    Any suggest?
    – uocnb Nov 29 '11 at 10:34
  • @UocNguyen, only what I already asked for. You need to figure out why LVM is trying to use more space than exists on that partition. – psusi Nov 29 '11 at 14:50
  • @psusi: forgot to mention that I was have problem with it in the past, I used ArchBang Live CD to boot up and manipulate data from LVM, after I remove 2 LV from VG unix, create, delete some partition. After that I invoke sync, partprobe but they all freeze, later I was reboot my machine then problem with LVM come. – uocnb Nov 30 '11 at 02:13
  • Ever find a solution for this? I'm having the same issue. – Tim S. Aug 20 '17 at 22:28