-   Linux - Server (
-   -   Mount raid device to recover data (

Keldek 08-20-2009 04:16 PM

Mount raid device to recover data
So, we've been undergoing some problems with our server as of late, the most recent being faulty disks...

In a nutshell, our RAID 1 array was rendered broken and we were advised that core lib files were missing and the OS needed to be reloaded... a quote from our server host:

"The OS is not healthy. This server will need a reinstall.
Libs are missing."

This was after having replaced what we though was a faulty /dev/sdb.

So they reloaded the OS (Debian 5.0.2 x86_64) on 2 FRESH drives, and installed the old /dev/sda as /dev/sdc once the reload was completed.

Here's the output of /etc/fstab on the fresh install so we know what we're working with:

debian:/BAK# cat /etc/fstab
# /etc/fstab: static file system information.
# <file system> <mount point>  <type>  <options>      <dump>  <pass>
proc            /proc          proc    defaults        0      0
/dev/md0        /              ext3    errors=remount-ro 0      1
/dev/md2        /home          ext3    defaults        0      2
/dev/md1        /tmp            ext3    defaults        0      2
/dev/sda3      none            swap    sw              0      0
/dev/sdb3      none            swap    sw              0      0
/dev/scd0      /media/cdrom0  udf,iso9660 user,noauto    0      0
/dev/scd0      /media/floppy0  auto    rw,user,noauto  0      0

Now, whether the OS actually needed to be reloaded or not isn't my concern at this stage, so I've skipped past the questioning of that. I do know, however, that /dev/sdc is readable and if I can figure out how, I can recover the needed files from it.

The thing I don't know how to do is mount /dev/sdc{2,3} in order to retrieve the needed files (yes, I have backups but we're talking 200+GB worth of files which would take ages to re-upload)

Here's the output of fdisk -l for /dev/sdc:

Disk /dev/sdc: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0004dd94

  Device Boot      Start        End      Blocks  Id  System
/dev/sdc1  *          1          13      104391  83  Linux
/dev/sdc2              14      117360  942589777+  fd  Linux raid autodetect
/dev/sdc3          117361      181356  514047870  fd  Linux raid autodetect
/dev/sdc4          181357      182401    8393962+  5  Extended

Here's the output of 'mdadm --examine --scan /dev/sdc2'

ARRAY /dev/md2 level=raid1 num-devices=2 UUID=75537f93:26498f83:9866e678:b39dd5a2
and 'mdadm --examine --scan /dev/sdc3'

ARRAY /dev/md1 level=raid1 num-devices=2 UUID=8b08e957:4a1fed49:e9ac3995:dd47625c
Ok, so at least I know the array is still defined, sweet. But, how do I mount it?

The one problem I see myself running into is /dev/md1 and /dev/md2 are currently in use by the new system, so I cannot mount it there.

Thanks for your time and help and please let me know if you need any further info.

I should also note, reloading the OS is a viable option if needed as we haven't started configuring the server yet. So if we need to reinstall the OS and assign the NEW RAID arrays to something other than /dev/md1 and /dev/md2 then we can do that; though I'd rather not have to wait another few hours for them to queue me up and complete this if I don't have to hehehe.

fordeck 08-20-2009 04:51 PM

Have you tried just mounting the partition, for example:

mount /dev/sdc1 /mnt/<mount_point>

where <mount_point> would be a directory under /mnt

Being as this was a RAID1 array you should be able to just mount it. For example if you created a directory under /mnt called old_sdc1 and then used the following command:

mount /dev/sdc1 /mnt/old_sdc1

You should be able to:

cd /mnt/old_sdc1

to see the contents.



Keldek 08-20-2009 04:56 PM

No, when trying to mount /dev/sdc normally I get the following output:

mount: unknown filesystem type 'mdraid'
I think I've solved the problem though with 'mdadm --assemble /dev/md5 /dev/sdc2'.

All times are GMT -5. The time now is 11:52 PM.