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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • 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. ubuntu-drivers: command not found
  2. mknod: command not found
  3. All Linux Compress/Decompress Commands
  4. Beginners guide to Kernel Module Configuration in Linux
  5. pdbedit: command not found
  6. How to Create logical networks to segregate traffic in a data center in RedHat Virtualization (RHV)
  7. mkfs.hfsplus: command not found
  8. “docker system” Command Examples
  9. behat Command Examples (A PHP framework for Behaviour-Driven Development)
  10. ntpdate Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • gml2gv Command Examples
  • glow Command Examples
  • glib-compile-resources Command Examples
  • glances Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright