4

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!

  • 1. try update the follwing packges kernel , device-mapper, lvm2 . 2. deactivate with vgchange -an , then activate with vgchange -ay. – Hanan N. Nov 28 '11 at 6: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 – tiger2wander Nov 28 '11 at 8: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). – tiger2wander Nov 29 '11 at 2: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 2:17
0

I think it is related to this post https://superuser.com/questions/1061454/how-to-resize-back-a-logical-volumen-lvm/1061548

As suggested by the psusi comment, the PV on /dev/sda3 seems to be smaller than the VG size (perhaps a pvresize --setphysicalvolumesize somesizeG was done at a time)

2 solutions : - extend the /dev/sda3 - reduce the unix-work LV

But need the pvdisplay and /dev/sda3 infos

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.