View previous topic :: View next topic |
Author |
Message |
Letharion Veteran
Joined: 13 Jun 2005 Posts: 1344 Location: Sweden
|
Posted: Mon Sep 06, 2010 9:18 am Post subject: [Solved]Reading a raided disc in another system? |
|
|
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 |
|
|
richard.scott Veteran
Joined: 19 May 2003 Posts: 1497 Location: Oxfordshire, UK
|
Posted: Mon Sep 06, 2010 9:51 am Post subject: |
|
|
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 |
|
|
Letharion Veteran
Joined: 13 Jun 2005 Posts: 1344 Location: Sweden
|
Posted: Mon Sep 06, 2010 9:59 am Post subject: |
|
|
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 |
|
|
richard.scott Veteran
Joined: 19 May 2003 Posts: 1497 Location: Oxfordshire, UK
|
Posted: Mon Sep 06, 2010 10:39 am Post subject: |
|
|
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 |
|
|
Letharion Veteran
Joined: 13 Jun 2005 Posts: 1344 Location: Sweden
|
Posted: Mon Sep 06, 2010 12:10 pm Post subject: |
|
|
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 |
|
|
depontius Advocate
Joined: 05 May 2004 Posts: 3526
|
Posted: Mon Sep 06, 2010 1:29 pm Post subject: |
|
|
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 |
|
|
Uli Sing Apprentice
Joined: 03 May 2010 Posts: 197 Location: MUC
|
Posted: Mon Sep 06, 2010 2:51 pm Post subject: |
|
|
In some cases
Code: | mount -t auto -o ro /dev/sdb /mountpoint |
might work and could be done without causing damages.
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 |
|
|
Letharion Veteran
Joined: 13 Jun 2005 Posts: 1344 Location: Sweden
|
Posted: Tue Oct 26, 2010 2:56 pm Post subject: |
|
|
Got the other drive, their UUIDs matched, they are assembled and mounted. Worked great. Thank you so much. |
|
Back to top |
|
|
|