• 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

“Logical volume vg/lv contains a filesystem in use” – while removing LVM filesystem

by admin

The Problem

How to remove an LVM volume which returns “filesystem in use” error.

# lvchange -an /dev/mapper/vg-lv
Logical volume vg/lv contains a filesystem in use

The Solution

Step 1: Try to identify if this particular LVM is mounted in your server.

# mount -a | grep /path-to-LV-volume

If mounted, unmount it.

Step 2: Check for open file desriptors or active processes running on this LV:

# lsof | grep /path-to-LV-volume

If above command doesn’t return any output, try to ‘grep’ using just LV name. If you see any open processes or file descriptors, kill them using ‘pkill’ or ‘kill -9’ [ ‘man’ command for options]

Step 3: Deactivate and remove the LV.

# lvchange -an -v /path-to-LV-volume
# lvremove -vf /path-to-LV-volume
Note: Replace /path-to-LV-volume with actual path in the above commands.

Filed Under: CentOS/RHEL, CentOS/RHEL 7, Linux

Some more articles you might also be interested in …

  1. Shell Script to Find Network Interface Link Status and Speed (CentOS/RHEL)
  2. 10 useful cron examples to schedule jobs in Linux
  3. How to Disable or set SELinux to Permissive mode
  4. How to Configure Network Teaming in CentOS/RHEL 7
  5. lvremove failing to remove volume after using ‘shred’ command
  6. manpath Command Examples in Linux
  7. What are SELinux Users and how to Map Linux Users to SELinux Users
  8. IBM DB2 Installation on Red Hat Enterprise Linux
  9. What does refid value “.LOCL.” mean in NTP
  10. CentOS / RHEL 7 : Configuring an NFS server and NFS client

You May Also Like

Primary Sidebar

Recent Posts

  • grpck command – Remove corrupt or duplicate entries in the /etc/group and /etc/gshadow files.
  • xxd command – Expressed in hexadecimal form
  • sesearch: command not found
  • macof: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright