5

I received an incident when I was trying to do mount -a . I was getting the below error. So how to fix this issue?

mount: /dev/vgname/lvname: can't read superblock

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255

3 Answers3

11

In my case I received this error due to an read-only abstraction mount below it. I was using vmfs6-fuse in combination with an qemu-nbd read-only mount for a VMWARE recovery.

In this case, mounting the LVM with the option ro,noload solved the issue:

mount -o ro,noload /dev/vg/lv /mnt
AdminBee
  • 22,803
2

If the logical volume exists and is active, it may be that the superblock is somehow corrupted. If the filesystem is an ext2, ext3 or ext4, there are backup superblocks available. To find them:

dumpe2fs /dev/vgname/lvname | grep superblock

You will get some output like:

$ sudo dumpe2fs /dev/sdb1 | grep uperb | more
dumpe2fs 1.45.4 (23-Sep-2019)
  Primary superblock at 0, Group descriptors at 1-25
  Backup superblock at 32768, Group descriptors at 32769-32793
  Backup superblock at 98304, Group descriptors at 98305-98329
  Backup superblock at 163840, Group descriptors at 163841-163865
  Backup superblock at 229376, Group descriptors at 229377-229401
  Backup superblock at 294912, Group descriptors at 294913-294937
  Backup superblock at 819200, Group descriptors at 819201-819225
  Backup superblock at 884736, Group descripmount sb=32768 /dev/sda2 /mnttors at 884737-884761

You can probably mount the filesystem with:

mount sb=32768 /dev/vgname/lvname /mnt

(the 32768 being the first backup superblock from the previous output)

If that works, you can backup some important files and/or start a repair:

fsck -b 32768 /dev/vgname/lvname

You could try fsck -y if you don't want to acknowledge all repair.

If none of the backup superblocks work, you must hope that your last backup is valid, or try recovery tools like ext4magic, PhotoRec or scalpel.

If everything fails, re-initialise with mkfs.ext4. Make sure that you do bad block checking.

Ljm Dullaart
  • 4,643
  • Your answer is nice and logically perfect, but the truth is that sometimes lvm gets confused about external drives. See my comment to the question. – teika kazura Sep 26 '23 at 05:14
0

So, a filesystem located on a LVM logical volume does not have its superblock readable. First, make sure all the LVs in the volume group have been activated: vgchange -ay vgname.

If that does not help, run lvs to verify that the named LV actually exists.

telcoM
  • 96,466