Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved]Reading a raided disc in another system?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1344
Location: Sweden

PostPosted: Mon Sep 06, 2010 9:18 am    Post subject: [Solved]Reading a raided disc in another system? Reply with quote

A server caught a hardware problem a few days ago.
The server had two 1.5TiB drive in software raid 1, and the guy who set that up isn't around anymore.
Now I have one of those drives in my system and have been asked to read the data from it.
I don't have much experience with raid-systems, so I'm not sure what I need to be able to read it,
I assume that on the "system" disc the server kept some sort of record that would be useful/necessary?

fdisk reports "Disk /dev/sdb doesn't contain a valid partition table".

I found some information here: http://superuser.com/questions/83923/can-a-mirrored-raid-1-disk-be-plugged-into-another-system-to-be-read that basically says I should be able to plug it in and read it.
"in the case of software raid in Linux (md+raid1) then yes, there's no disk header or secret block-level optimization going on there"
But then the gentoo wiki says:
"do not try to mount elements of the RAID 1 separately...can make the RAID 1 as a whole unmountable."

So, where do I start? :)


Last edited by Letharion on Tue Oct 26, 2010 2:56 pm; edited 1 time in total
Back to top
View user's profile Send private message
richard.scott
Veteran
Veteran


Joined: 19 May 2003
Posts: 1497
Location: Oxfordshire, UK

PostPosted: Mon Sep 06, 2010 9:51 am    Post subject: Reply with quote

It could be that he didn't create any partitions on the two disks, and just raid-1'd the whole thing.

plug in the disk to a new system and try this:

Code:
mdadm --examine --scan /dev/sda


where /dev/sda is the device name of the disk you want to check.

You should see something like this:

Code:
# mdadm --examine --scan /dev/sda
ARRAY /dev/md0 UUID=13d3ce8c:2544d8de:577b071e:1687b53f


This is good, as it means the device has a RAID superblock.

If this is the same for both devices, you can use this to re-assemble the raid:

Code:
mdadm --assemble /dev/md3 /dev/sda /dev/sdb


Now, the /dev/md3 device needs to be the next number device available. To check use this command:

Code:
# cat /proc/mdstat
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] [linear]
md0 : active raid1 hdb1[0] hda1[1]
      96256 blocks [2/2] [UU]

md1 : active raid1 hdb2[0] hda2[1]
      2000000 blocks [2/2] [UU]

md2 : active raid1 hdb3[0] hda3[1]
      486287424 blocks [2/2] [UU]

unused devices: <none>


As you can see, from my system md3 is the next available device so I will need to use /dev/md3 when assembling it.
This will then create a /dev/md3 device that you can then mount:

Code:
# mkdir /mnt/raid
# mount /dev/md3 /mnt/raid


Once you have that, you should be able to see your data.

Hope this helps.

Rich
Back to top
View user's profile Send private message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1344
Location: Sweden

PostPosted: Mon Sep 06, 2010 9:59 am    Post subject: Reply with quote

Code:
# mdadm --examine --scan /dev/sdb
ARRAY /dev/md0 UUID=87f422b7:49a82cf4:d24c74ac:60e22e5f


Looks good :)

So I can't read the data without the other disc then? It's in another facility unfortunately, so I can't try it right now.

Thanks a lot for helping me out :)
Back to top
View user's profile Send private message
richard.scott
Veteran
Veteran


Joined: 19 May 2003
Posts: 1497
Location: Oxfordshire, UK

PostPosted: Mon Sep 06, 2010 10:39 am    Post subject: Reply with quote

Letharion wrote:
So I can't read the data without the other disc then?


You could try this:

Code:
# mdadm --assemble /dev/md3 --run /dev/sdb


That may force it to start with only one disk.

Rich
Back to top
View user's profile Send private message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1344
Location: Sweden

PostPosted: Mon Sep 06, 2010 12:10 pm    Post subject: Reply with quote

The wording "may", and "force" combined with my in-experience makes me wanna be careful ;)
No ones gonna be breathing down my neck over this for quite a while, so I'll wait til I get hold of the other harddrive.
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 3526

PostPosted: Mon Sep 06, 2010 1:29 pm    Post subject: Reply with quote

I believe you can use the keyword "missing" when you assemble a RAID:
Code:
mdadm --assemble /dev/md3 /dev/sda missing

Then later you can add an extra drive, if that's what you're doing. I run a RAID-1 on 2 channels of a Promise card, and a few years back I lost one channel. A few days gyration and I was back running, with the second drive replacing the cdrom on the 2nd channel on the motherboard.
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
Uli Sing
Apprentice
Apprentice


Joined: 03 May 2010
Posts: 197
Location: MUC

PostPosted: Mon Sep 06, 2010 2:51 pm    Post subject: Reply with quote

In some cases
Code:
mount -t auto -o ro /dev/sdb /mountpoint


might work and could be done without causing damages. :D :D :D
Probably you have to test some possible types of file systems to succeed.

e. g.
Code:
mount -t ext3 -o ro /dev/sdb /mountpoint
Back to top
View user's profile Send private message
Letharion
Veteran
Veteran


Joined: 13 Jun 2005
Posts: 1344
Location: Sweden

PostPosted: Tue Oct 26, 2010 2:56 pm    Post subject: Reply with quote

Got the other drive, their UUIDs matched, they are assembled and mounted. Worked great. Thank you so much. :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum