1

Here is my situation:

After a sudden shutdown due to a power outage, the CentOS 5 server in my workplace will not boot.

My co-worker and I need to get an important file from the hard drive on this server before re-installing the OS.

However, when we connect the hard drive to another Linux PC and try to mount it, we get an error.

Output from fdisk -1:

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          13      104391   83  Linux
/dev/sda2              14       60801   488279610   8e  Linux LVM

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       25496   204796588+  83  Linux
/dev/sdb2           25497       60801   283587412+  8e  Linux LVM

The file I want to get is at /dev/sdb1 and /dev/sdb2.

However, when I type mount /dev/sdb1 /haccan

I get this error:

mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
       missing codepage or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

What do we have to do to access to the file on this hard disk?

2

3 Answers 3

1

Connect your hard drive to a machine with Windows OS and Try this program: ext2explore-2.2.71

It can explore ext2/ext3/ext4 and supports supports LVM2 and EXT4. you can Save files from explorer window. I hope it works for you.

1
  • Sorry for late reply. This solution works perfectly.
    – Vu Ngo
    Sep 28, 2012 at 6:48
3

The problem is you're trying to mount the an LVM volume directly, you need to mount the LVM device, rather than the partition on the disk directly.

On a working system with the disk connected use pvscan or pvs to see the physical volumes detected by LVM.

Use vgs to see the volume groups found on the PVs and lvs to see the logical volumes contained in the VGs.

You might need to activate the volume group if it isn't done on boot with vgchange -a n [vgname] then you can mount by looking for your LV in /dev/mapper, eg:

mount /dev/mapper/[vgname]-[lvname] /mountpoint

Lots more proper documentation on LVM here: http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html-single/Logical_Volume_Manager_Administration/index.html#VG_activate

2

A working OS should do, just make sure you mount the disk prior to power-on, if needed - allocate the disk in your BIOS, and let your OS take care of the rest. Your disk should appear with the rest of the drives on the machine. If no harm was done to the logical/physical partitions, then you should be able to recover data from it.

It is advised you recover your data prior to any installations just to make sure you are not losing important data. Then you could try running tests on that drive. It seems like your boot record was damaged. Windows has some tools for accessing Linux filesystems
Nucleaus is one of them

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .