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

The Geek Diary

CONCEPTS | BASICS | HOWTO

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

lvremove failing to remove volume after using ‘shred’ command

By admin

The Problem

When trying to delete volume group by using lvremove, vgremove, pvremove command after executing shred command for physical volume as shown below, fails repeatedly.

# shred -vfz -n 3 /dev/sdd
# sum -r /dev/sdd
28911 1073741824

When the lvremove command is executed, you will get an error saying that the volume group can not be found.

# lvremove /dev/VolGroupOracleArch/lvol0
Volume group "VolGroupOracleArch" not found
Cannot process volume group VolGroupOracleArch

The Solution

Logical Volume /dev/VolGroupOracleArch/lvol0 is not deleted normally.

1. /dev/VolGroupOracleArch/lvol0 can not be seen in command lvscan but device name /dev/VolGroupOracleArch/lvol0 still exists:

# lvscan -v
Using logical volume(s) on command line.
ACTIVE '/dev/VolGroup000/tmp' [8.00 GiB] inherit
ACTIVE '/dev/VolGroup000/LogVol04' [49.79 GiB] inherit
ACTIVE '/dev/VolGroup000/swap' [16.00 GiB] inherit
ACTIVE '/dev/VolGroup000/var' [8.00 GiB] inherit
ACTIVE '/dev/VolGroup000/home' [8.00 GiB] inherit

2. /dev/VolGroupOracleArch/lvol0 is still existing in directory /dev/mapper/

# cd /dev/mapper/
# ll
total 0
crw-rw---- 1 root root 10, 58 Dec 15 10:56 control
lrwxrwxrwx 1 root root      7 Mar 12 16:02 VolGroup000-home -> ../dm-7
lrwxrwxrwx 1 root root      7 Mar 12 16:02 VolGroup000-LogVol04 -> ../dm-0
lrwxrwxrwx 1 root root      7 Mar 12 16:02 VolGroup000-swap -> ../dm-1
lrwxrwxrwx 1 root root      7 Mar 12 16:02 VolGroup000-tmp -> ../dm-5
lrwxrwxrwx 1 root root      7 Mar 12 16:02 VolGroup000-var -> ../dm-6
lrwxrwxrwx 1 root root      7 Mar 12 16:02 VolGroupOracleArch-lvol0 -> ../dm-4      ### /dev/mapper/VolGroupOracleArch-lvol0 is a link of /dev/VolGroupOracleArch/lvol0 which still exist
lrwxrwxrwx 1 root root      7 Mar 12 16:02 VolGroupOracleData-lvol0 -> ../dm-2
lrwxrwxrwx 1 root root      7 Mar 12 16:02 VolGroupOracleRedo-lvol0 -> ../dm-3

3. In order to resolve the issue, delete the low level Logical Volume by using dmsetup command below.

# dmsetup --force --retry --deferred remove VolGroupOracleArch-lvol0
# dmsetup --force --retry --deferred remove VolGroupOracleData-lvol0
# dmsetup --force --retry --deferred remove VolGroupOracleRedo-lvol

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

Some more articles you might also be interested in …

  1. User Unable To Edit crontab, Error: “/tmp/crontab.Lm34gsJV: Permission denied”
  2. How to Tune Btrfs Filesystem for Better Performance
  3. Why CentOS / RHEL 7 have many tmpfs (6 tmpfs filesystem), and what is their purpose
  4. CentOS / RHEL 5 : How to disable device mapper multipath (dm-multipath)
  5. How to disable or enable an HBA without reboot under CentOS/RHEL
  6. How to make alias command work in bash script or bashrc file
  7. How to Recover Corrupted Root Partition from Rescue Mode in CentOS/RHEL 5,6
  8. CentOS / RHEL 7 : Lock User Account After N Number of Incorrect Login Attempts
  9. How to change the default location (/var/cache/yum) of yum cache
  10. How to Mirror Swap, Boot and Root Partions in CentOS/RHEL 7 Using mdadm Utility

You May Also Like

Primary Sidebar

Recent Posts

  • Oracle Database – Configuring Secure Application Roles
  • Extend rule sets by using factors in Oracle Database Vault
  • What are Command Rules in oracle Database
  • Using Rule Sets in Oracle Database Vault
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary