• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

“device-mapper: resume ioctl failed: Invalid argument” – error on running lvcreate/lvresize/lvextend

by admin

The Problem

Unable to perform lvresize, lvextend or lvcreate on logical volumes and the below error is received after executing any LVM command:

device-mapper: resume ioctl on (major:minor) failed: Invalid argument
Unable to resume vgname-lvname (major:minor)
Failed to activate new LV

The Solution

The above error gets triggered if some misconfiguration has been done with LVM. This issue is caused when the PSize (Physical Size) is set greater than the DevSize (Device Size). It can be verified by the output of the below command:

# pvs -v
Scanning for physical volume names
PV        VG      Fmt   Attr  PSize    PFree   DevSize  PV  UUID
/dev/xvdc testvg1 lvm2  a-    10.00G   5.00G   5.00G        2XEI4w-LmJi-iR3B-xXVU-XxK3-dfTf-WPZXF6

Here you can notice that the PSize is set to 10G but actual Device size is only 5G and hence the PSize should be smaller or equal to DevSize. Also you can see the changes made by taking a look at the lvm archive files.

# cd /etc/lvm/archive
# less testvg1_00000-320386444.vg
description = "Created *before* executing 'pvresize --setphysicalvolumesize 10G /dev/xvdc'"

Above, the physical volume size for the archive file is set to 10G which resulted in corruption or locking of LVM functionality.

Action Plan

NOTE: As you are going to reduce the size so please first off all take the complete backup to prevent loosing your data in worst case as it is a very risky method and also you have setup your /root on the same volgroup.

1. Revert back all changes made to your logical volumes and make it to the original size.
2. Then use pvresize -v /dev/xxxxx/xxxxx — based on your naming convention.
3. Now check the pvs -v output and make sure the PVSize and DEVSize matches.
4. Finally run lvresize, it should work.

If you want to increase the physical volume size then first create a new partition and then initialize with pvcreate and add this partition to the existing volgroup with vgextend and start the normal procedure for lv extend.

Example

Below is an example to the above Action Plan:

1. Reverting back the changes made on LV and make sure that LVSize is within the Devsize limit.

# lvresize -L 4G /dev/testvg1/test_lv
WARNING: Reducing active logical volume to 4.00 GB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce test_lv? [y/n]: y
Reducing logical volume test_lv to 4.00 GB
Logical volume test_lv successfully resized

2. Now will use pvresize -v /dev/xxxx/xxxx

# pvresize -v /dev/xvdc
Using physical volume(s) on command line
Archiving volume group "testvg1" metadata (seqno 9).
Resizing physical volume /dev/xvdc from 2559 to 1279 extents.
Resizing volume "/dev/xvdc" to 10485376 sectors.
Updating physical volume "/dev/xvdc"
Creating volume group backup "/etc/lvm/backup/testvg1" (seqno 10).
Physical volume "/dev/xvdc" changed
1 physical volume(s) resized / 0 physical volume(s) not resized

3. Verifying by pvs -v command:

# pvs -v
Scanning for physical volume names
PV         VG      Fmt    Attr  PSize  PFree      DevSize  PV  UUID
/dev/xvdc  testvg1 lvm2   a-    5.00G  1020.00M   5.00G        2XEI4w-LmJi-iR3B-xXVU-XxK3-dfTf-WPZXF6

Now it is possible to see the PSize is equal to DevSize.

4. Now please perform any other normal operation with your LVM.

Filed Under: CentOS/RHEL, Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL : How to Set up SFTP to Chroot Jail only for Specific Group
  2. umask: command not found
  3. netselect-apt: command not found
  4. What are the Types of DNS Servers
  5. mountstats Command Examples in Linux
  6. i3lock: command not found
  7. Linux OS Service ‘sysstat’
  8. How to move /tmp on a separate disk as a separate mount point (Online)
  9. findmnt: command not found
  10. awk: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • pw-cat Command Examples in Linux
  • pvs: command not found
  • pulseaudio: command not found
  • pulseaudio Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright