• 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

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. fcrackzip: command not found
  2. “docker save” Command Examples
  3. df: command not found
  4. readpe Command Examples in Linux
  5. Nginx load balancing
  6. colrm Command Examples in Linux
  7. cewl: command not found
  8. How to add Swap Space on Linux Servers (CentOS/RHEL) On the Fly
  9. blender Command Examples (Command-line interface to the Blender 3D computer graphics application)
  10. rofi Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • glab Command Examples
  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright