• 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. Firewalld Command line Reference (Cheat Sheet)
  2. Understanding DM-multipath deamon (multipathd)
  3. less: command not found
  4. Xen Hypervisor (xm) command Cheat Sheet
  5. bluetoothctl: command not found
  6. FATAL: Error inserting rds_rdma
  7. RHEL 7 – RHCSA Notes – Set enforcing and permissive modes for SELinux
  8. What are Reserved User Accounts in MySQL
  9. arpspoof: command not found
  10. tail command examples in UNIX/Linux

You May Also Like

Primary Sidebar

Recent Posts

  • qsub Command Examples in Linux
  • qsub: command not found
  • qrcp Command Examples in Linux
  • qmrestore Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright