Help needed. Hard disk broken : how to mount LVM partition in rescue mode ?

pppplus

Verified User
Joined
Dec 19, 2008
Messages
523
Hi

I have a big problem.
Hard disk is broken in one of my server.

This server runs with debian and proxmox2, with 3 openvz containers.
2 containers have distant backups, 1 have not.

I need to save all datas from this container which has not been saved.

My server is in rescue mode.

Code:
# fdisk -l
Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x000d6e00

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        4096    61442048    30718976+  83  Linux
/dev/sda2        61442049    81920000    10238976   82  Linux swap / Solaris
Partition 2 does not start on physical sector boundary.
/dev/sda3        81920001  3907020800  1912550400    f  W95 Ext'd (LBA)
Partition 3 does not start on physical sector boundary.
/dev/sda5        81920002  3907020800  1912550399+  8e  Linux LVM
Partition 5 does not start on physical sector boundary.

Code:
# vgscan
  Reading all physical volumes.  This may take a while...
  /dev/pve/lv1: read failed after 0 of 4096 at 0: Input/output error
  /dev/pve/lv1: read failed after 0 of 4096 at 4096: Input/output error
  Found volume group "pve" using metadata type lvm2

I think I have to mount /dev/pve/lv1, to see my containers.
Code:
# mount /dev/pve/lv1 /mnt/home3
mount: /dev/mapper/pve-lv1: can't read superblock

But I can't.
I hope you can help with some ideas.

Thanks for your help
 
I've that :

Code:
# lvm lvscan
  /dev/pve/lv1: read failed after 0 of 4096 at 0: Input/output error
  /dev/pve/lv1: read failed after 0 of 4096 at 4096: Input/output error
  ACTIVE            '/dev/pve/lv1' [1.72 TiB] inherit

So, /dev/pve/lv1 is "ACTIVE" but I don't see it
 
Someone give me the solution on another forum.
I translate it and post it here, it can maybe help someone

To find superblocks :
Code:
# mke2fs -n /dev/pve/lv1
mke2fs 1.42.5 (29-Jul-2012)
/dev/pve/lv1 alignment is offset by 3072 bytes.
This may result in very poor performance, (re)-partitioning suggested.
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
115204096 inodes, 460798976 blocks
23039948 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
14063 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
        102400000, 214990848

Then try :
Code:
# mount -t ext4 -o ro,noload /dev/pve/lv1 /mnt/home3
mount: wrong fs type, bad option, bad superblock on /dev/mapper/pve-lv1,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

dmesg :
Code:
# dmesg | tail
sd 0:0:0:0: [sda]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
sd 0:0:0:0: [sda]  Sense Key : Medium Error [current] [descriptor]
Descriptor sense data with sense descriptors (in hex):
        72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00
        04 e2 01 84
sd 0:0:0:0: [sda]  Add. Sense: Unrecovered read error - auto reallocate failed
sd 0:0:0:0: [sda] CDB: Read(10): 28 00 04 e2 01 84 00 00 02 00
end_request: I/O error, dev sda, sector 81920388
ata1: EH complete
EXT4-fs (dm-0): unable to read superblock

Try again (sb=131072 for super block 32768*4)):
Code:
# mount -t ext4 -o ro,noload,sb=131072 /dev/pve/lv1 /mnt/home3 (bad command, see below)
mount: wrong fs type, bad option, bad superblock on /dev/mapper/pve-lv1,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

dmsg
Code:
# dmesg | tail
sd 0:0:0:0: [sda]  Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
sd 0:0:0:0: [sda]  Sense Key : Medium Error [current] [descriptor]
Descriptor sense data with sense descriptors (in hex):
        72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00
        04 e2 01 84
sd 0:0:0:0: [sda]  Add. Sense: Unrecovered read error - auto reallocate failed
sd 0:0:0:0: [sda] CDB: Read(10): 28 00 04 e2 01 84 00 00 02 00
end_request: I/O error, dev sda, sector 81920388
ata1: EH complete
EXT4-fs (dm-0): unable to read superblock

And finally the right command (because parameter order is very important) :
Code:
mount -t ext4 -o ro,sb=131072,noload /dev/pve/lv1 /mnt/home3

Disk in mounted, and I can recover my backups.

Conclusion : always do external backups... a hard disk can crash !
 
Thank you for sharing with us.
Conclusion : always do external backups... a hard disk can crash !
Ofcourse, backups are always needed if you are serious in doing business.
Another option is to choose for a server with 2 harddisks and put them in raid 1. This way you always have a mirror when something goes wrong with one harddisk.
 
Of course, backups are always needed if you are serious in doing business.

Yes, but it was my website. (not a good reason, to not backup in external support...). All my customers in the same servers were saved in and outsite this server, and no big problems for them.
And this server run with proxmox, which supports hardly raid soft.
 
Back
Top