• 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. Linux / UNIX : Examples of find command to find files with specific sets of permissions
  2. How to Compress and Extract Files and Directories in Linux Using gzip and bzip2
  3. Linux OS Service ‘irqbalance’
  4. Unable To Join Linux Samba Server To Windows Active Directory Domain
  5. How to prevent non-root user from creating crontab entry
  6. CentOS / RHEL : How to identify/match LUN presented from SAN with underlying OS disk
  7. “su: Authentication failure” – in Docker
  8. How to disable firewalld and and switch to iptables in CentOS / RHEL 7
  9. How to extend an LVM swap partition in Linux
  10. CentOS / RHEL 6 : How to extract initramfs image and edit/view it

You May Also Like

Primary Sidebar

Recent Posts

  • How to disable ACPI in CentOS/RHEL 7
  • How to Use real-time query to access data on a physical standby database
  • CentOS/RHEL 8: “ACPI MEMORY OR I/O RESET_REG” Server Hung after reboot
  • How to Create a Physical Standby Database by Using SQL and RMAN Commands
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary