• 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

How to recreate LVM device files under /dev directory using vgmknodes

By admin

After a server crash or due to a human error, volume group device files are not seen under /dev directory. The device files were removed from the filesystem after the system crash, probably due to a filesystem corruption.

# cd /dev
# ls vg01
ls: cannot access vg01: No such file or directory

If you check the output of lvdisplay command you would see the vg intact and without any error.

# lvdisplay
  --- Logical volume ---
  LV Path                /dev/vg01/lv01
  LV Name                lv01
  VG Name                vg01
  LV UUID                iP1MbY-LPMY-nmym-iY2B-CCRJ-ElVY-5L1mql
  LV Write Access        read/write
  LV Creation host, time localhost.localdomain, 2017-10-11 21:39:45 +0530
  LV Status              not available
  # open                 1
  LV Size                10.00 GiB
  Current LE             2560
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:3

Creating LVM devices

1. The command vgcfgrestore would fail if you try to recover the volume group using the backup.

# vgcfgrestore -f /etc/lvm/backup/vg01 /dev/sdc

2ba3ce899000-2ba3ce89a000 rw-p 2ba3ce899000 00:00 0
2ba3ce8a5000-2ba3ce8aa000 rw-p 2ba3ce8a5000 00:00 0
2ba3ce8aa000-2ba3d1e83000 r--p 00000000 fd:00 77807        /usr/lib/locale/locale-archive
7fff26a43000-7fff26a58000 rw-p 7ffffffea000 00:00 0        [stack]
ffffffffff600000-ffffffffffe00000 ---p 00000000 00:00 0    [vdso]
Aborted

2. In order to recreate the LVM devices under /dev/ you will have to use the vgmknodes command. Use the vgmknodes command with verbose options :

# vgmknodes -vv

Filed Under: Linux

Some more articles you might also be interested in …

  1. Understanding MySQL Pluggable Authentication
  2. How to Disable user list on GNOME login screen in CentOS/RHEL 8
  3. CentOS / RHEL 5 : How to password-protect single user mode
  4. Linux OS Service ‘sshd’
  5. CentOS / RHEL : How to install Open Virtual Machine Tools for Virtual machines Hosted on VMWare
  6. How to manage File and Directory Permissions/Ownerships in Linux
  7. Active Directory Users Unable to Login via SSH using SSSD and Getting “Permission Denied, Please Try Again” [CentOS/RHEL]
  8. What are Bash Exit Codes in Linux
  9. How to allow or deny telnet login to specific users only in CentOS/RHEL
  10. How to disable IPv6 on CentOS / RHEL 5

You May Also Like

Primary Sidebar

Recent Posts

  • What are different Oracle Database Vault Roles
  • Unable to export realm protected table using data pump
  • Beginners Guide to Oracle Database Vault
  • How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary