LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Tags used in this thread
Popular LQ Tags , ,

Reply
 
Thread Tools
Old 05-02-2009, 09:48 PM   #1
nko
LQ Newbie
 
Registered: Apr 2005
Posts: 15
Thanked: 0
Recovering Data from Remaining RAID 1 Disk


[Log in to get rid of this advertisement]
Hello,

A while back, I had a PC with two hard drives configured in a RAID 1 array with mdadm. I stored a lot of data there, though nothing too important. The OS installation went south at one point and I installed something over it. I left the RAID array untouched but notably didn't backup my mdadm.conf.

A year or so later, I now have a new PC with a new OS installation and only one of the disks remaining :-) I would like to mount the remaining disk, pull the data off and start using the disk for other purposes. Everything I'm reading tells me that I'm fine as long as I either have or recreate mdadm.conf AND as long as I go buy another disk to replace the missing one.

I've also read allusions to the ability to tell mdadm to mount an array with "missing disks" but haven't seen any instructions on how to do so. I've tried just popping the disk in and mounting it like a regular disk but mount refuses to do so, citing that it is of type "Linux RAID" or something thereof.

Is there a way to mount this disk and get the data?
nko is offline  
Tag This Post , ,
Reply With Quote
Old 05-02-2009, 10:28 PM   #2
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Lenny 2.6.28.8 SMP
Posts: 2,717
Thanked: 57
I think that you should be able to just mount it as a normal, non-raid, disk. Have you tried that? Use read only, of course.
Quakeboy02 is offline     Reply With Quote
Old 05-02-2009, 10:32 PM   #3
nko
LQ Newbie
 
Registered: Apr 2005
Posts: 15
Thanked: 0

Original Poster
Yeah, doesn't let me. It isn't EXT3, it's "Linux RAID". That was my first guess :-)
nko is offline     Reply With Quote
Old 05-02-2009, 10:37 PM   #4
tommylovell
Member
 
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 85
Thanked: 14
Do a 'cat /proc/mdstat'. Your system may have recognized the drive when you booted up.
'fdisk -l' might show it as well.

If it is there, you can mount the "md" device shown in the cat (assuming you originally put your filesystem directly on it).
Example: 'mount /dev/md0 /<desiredmountpoint>'

If you put an LVM PV on top of it, it is only slightly more work (unless you have a VG name conflist).
You would 'pvscan', 'vgscan', 'vgchange -ay', 'lvs', then mount the LV.

If this isn't the case, let me know.

Last edited by tommylovell; 05-02-2009 at 10:40 PM.. Reason: typo
tommylovell is offline     Reply With Quote
Old 05-02-2009, 10:56 PM   #5
nko
LQ Newbie
 
Registered: Apr 2005
Posts: 15
Thanked: 0

Original Poster
Thanks for the pointers! It is definitely not LVM- just an FS. I wasn't able to mount. Here's my console output:

Code:
root@localhost:/# cat /proc/mdstat
Personalities : 
md0 : inactive sdc1[1](S)
      78148096 blocks
       
unused devices: <none>
root@localhost:/# fdisk -l

Disk /dev/sda: 4034 MB, 4034838528 bytes
255 heads, 63 sectors/track, 490 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xb698b698

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1         462     3710983+  83  Linux
/dev/sda2             463         490      224910    5  Extended
/dev/sda5             463         490      224878+  82  Linux swap / Solaris

Disk /dev/sdc: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x415a13b8

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        9729    78148161   83  Linux
root@localhost:/# mount /dev/md0 /mnt/md0
mount: you must specify the filesystem type
root@localhost:/# mount /dev/md0 /mnt/md0 -t autofs
mount: wrong fs type, bad option, bad superblock on /dev/md0,
       missing codepage or helper program, or other error
       (could this be the IDE device where you in fact use
       ide-scsi so that sr0 or sda or so is needed?)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

root@localhost:/# mount /dev/md0 /mnt/md0 -t ext3
mount: wrong fs type, bad option, bad superblock on /dev/md0,
       missing codepage or helper program, or other error
       (could this be the IDE device where you in fact use
       ide-scsi so that sr0 or sda or so is needed?)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

root@localhost:/#
nko is offline     Reply With Quote
Old 05-02-2009, 11:51 PM   #6
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Lenny 2.6.28.8 SMP
Posts: 2,717
Thanked: 57
You should be trying to mount /dev/sdc1, not /dev/md0.
Quakeboy02 is offline     Reply With Quote
Old 05-02-2009, 11:57 PM   #7
nko
LQ Newbie
 
Registered: Apr 2005
Posts: 15
Thanked: 0

Original Poster
Code:
root@localhost:/# mount /dev/sdc1 /mnt/md0
mount: unknown filesystem type 'linux_raid_member'
root@localhost:/# mount /dev/sdc1 /mnt/md0 -t ext3
mount: /dev/sdc1 already mounted or /mnt/md0 busy
root@localhost:/#
nko is offline     Reply With Quote
Old 05-02-2009, 11:58 PM   #8
tommylovell
Member
 
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 85
Thanked: 14
Quote:
Originally Posted by nko View Post
Thanks for the pointers! It is definitely not LVM- just an FS. I wasn't able to mount. Here's my console output:

Code:
root@localhost:/# cat /proc/mdstat
Personalities : 
md0 : inactive sdc1[1](S)
      78148096 blocks
       
unused devices: <none>
Try 'mdadm --assemble --scan' and see if that makes md0 active. If it becomes active, then your 'mount /dev/md0 /mnt/md0
' should work.

(--scan says to use /proc/mdstat and /etc/mdadm.conf to look for eligible devices to assemble into a RAID array, and since your /proc/mdstat has your device, you should be good.)

If the md0 device doesn't become active, try 'mdadm --assemble --scan --run'.

Finally, if that doesn't work, you'll need to create an /etc/mdadm.conf file.

Typically you 'mdadm --examine --scan > /etc/mdadm.conf'

The resulting file contains something like this:

ARRAY /dev/md0 level=raid1 num-devices=2 UUID=397c7395:9c3c48fa:68e69357:c9f2169f

(The UUID will of course be different.)

You can edit it so it looks like this:
Code:
DEVICE partitions
MAILADDR root

ARRAY /dev/md0 level=raid1 num-devices=2 UUID=397c7395:9c3c48fa:68e69357:c9f2169f
or this:
Code:
DEVICE partitions
MAILADDR root

ARRAY /dev/md0 level=raid1 num-devices=2 devices=/dev/sdc1,missing
And then try 'mdadm --assemble --run'.

Let us know the results.
tommylovell is offline     Reply With Quote
Thanked by:
Old 05-03-2009, 12:36 AM   #9
nko
LQ Newbie
 
Registered: Apr 2005
Posts: 15
Thanked: 0

Original Poster
Wow. Just had to assemble / scan and mount. That was faster, more concise tech support than any I've received from a lot of expensive vendors. Thanks, Tommy!
nko is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
recovering data from a software raid partition f14f21 Linux - Newbie 3 11-06-2008 07:29 AM
Recovering data on RAID 5 with semi-faulty hdd davidsaxton Linux - Hardware 2 09-16-2006 04:45 PM
LVM - recovering data after a disk failure. bogaurd Linux - Software 2 12-19-2005 12:34 PM
recovering data from hard disk planctus Linux - Hardware 4 10-10-2005 05:02 PM
recovering data from an old RAID -0 dominant Linux - Software 1 01-26-2005 03:42 AM


All times are GMT -5. The time now is 05:31 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration