• 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

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. CentOS / RHEL : How to prevent disabled repositories from being downloaded into the yum cache
  2. CentOS / RHEL 6 : How to disable Transparent Huge pages (THP)
  3. abbr Command Examples in fish-shell
  4. reportbug Command Examples in Linux
  5. understanding “yum history” command output
  6. Examples of creating command alias in different shells
  7. How to uninstall chromium-browser from Ubuntu
  8. iw: command not found
  9. How to check rpm package integrity in Linux
  10. nixos-rebuild Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • aws ec2: CLI for AWS EC2 (Command Examples)
  • aws cur – Create, query, and delete AWS usage report definitions (Command Examples)
  • aws configure – Manage configuration for the AWS CLI (Command Examples)
  • aws cognito-idp: Manage Amazon Cognito user pool and its users and groups using the CLI

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright