[Sussex] Retrieving data from mirrored disks

Fay Zee sussex at eglug.org.uk
Tue Dec 31 06:08:44 UTC 2013


Quoting Dave Garry <daveg at firsdown.dyndns.org>:

> HI Fay,
>
> Glad to help. So you have now identified two disks with the  
> partition scheme that
> you show below - good news.

^^ :-)

> The fdisk output shows an "id" column (which is what
> I meant by "type"). Most of your partitions are id=fd (0xfd), and  
> these are the
> mdraid partitions. The swap partition has "82" for its "id". Normal  
> linux partitions
> show "83" here. I doubt your previous attempt to mount the  
> filesystems via the
> usual /dev/sdxx devices would have caused harm, perhaps just a "no  
> filesystem found"
> error or similar.
>
> I've never done a RAID install of Debian - in fact it looks  
> complicated from what I've
> googled - how did you do that ? (openSUSE is easier in this respect)

I bribed Steve Dobson ... ! I took photos of the screen during  
installation so that I could replicate it for myself.

> Anyway, you seem to have SIX raid partitions (1, 5, 6, 7, 8, 10) on  
> this disk. I'd guess
> these are for:
>
> =======================================================
> Device      Boot  Start           End Blocks         Id  System *My guess*
> /dev/sdc1           2048          976895           487424 fd  Linux  
> raid autodetect */boot*
> /dev/sdc2           978942      976771071     487896065   5 Extended
> /dev/sdc5           978944      20508671       9764864      fd Linux  
> raid autodetect */*
> /dev/sdc6          20510720    59570175      19529728    fd  Linux  
> raid autodetect */usr*
> /dev/sdc7          59572224   157227007     48827392    fd  Linux  
> raid autodetect */var*
> /dev/sdc8         157229056   166991871    4881408      fd  Linux  
> raid autodetect */tmp*
> /dev/sdc9         166993920   176756735    4881408      82  Linux  
> swap / Solaris
> /dev/sdc10        176758784   976771071   400006144  fd  Linux raid  
> autodetect */home*
> =======================================================
>
> I'd boot a live CD again, with ONE of these raid drives in the caddy  
> and do this to
> read-only mount /home so you can take a backup of it:
>
> 1) detect / assemble the raid volumes
>
> mdadm --assemble --scan
>
> 2) verify this worked, study output and study /proc/mdstat
>
> cat /proc/mdstat
>
> 3) determine which meta device was just created for each raid volume  
> - the above
> command show this, but also do:
>
> ls -l /dev/md
>
> You should see devices under there.
>
> This may also be useful:
>
> cat /proc/partitions
> dmesg
>
> 4) I found your mdadm output confusing - I'd normally expect to only  
> see one set
> of output from it, yours contains two.

I ran the same command for each of thetwo mirrors ansd pasted both  
outputs. I should have made that clear, sorry.

> The first showed this:
>
> mdadm: /dev/md/jill:5 has been started with 1 drive (out of 2).
> mdadm: /dev/md/jill:4 has been started with 1 drive (out of 2).
> mdadm: /dev/md/jill:3 has been started with 1 drive (out of 2).
> mdadm: /dev/md/jill:2 has been started with 1 drive (out of 2).
> mdadm: /dev/md/jill:1 has been started with 1 drive (out of 2).
> mdadm: /dev/md/jill:0 has been started with 1 drive (out of 2).
>
> 5) In the above it looks like /dev/md/jii:5 is associated with raid  
> volume on sdc10, this
> should be your /home partition.
>
> On openSUSE, which is where I've done all my soft raid, devices are  
> typically /dev/md0
> and /dev/md1... Sometimes I've seen /dev/md127 and /dev/md127. Your  
> names look
> different - if anybody knows how those names are allocated I'd be  
> interested to here it.
>
> Assuming /dev/md/jill:5 is the one you can mount it read-only using:
>
> mount -o ro /dev/md/jill:5 /mnt/somewhere
>
> NOTE: read-only == damage limitation - don't be tempted to omit "-o ro"

Since you have brought me up to this point, I shall be very careful.

> If /mnt/somewhere contains your user profile then copy it to some other media
> using cp/rsync or similar.
>
> If /mnt/somewhere looks like /, /usr, /var, /boot or /tmp then  
> umount it and try another.
>
> Repeat for any other partitions you want to backup. Perhaps you had a /www
> or other partition and my guess above isn't 100% ?

No, you are right.

> If you had another motherboard you may be able to resurrect this  
> system and boot
> it but I'd backup data first. (boot rescue, mount raid, chroot, mkinitrd)

I aim to overwrite Debian Squeeze with Debian Wheezy once I have got  
the hardware working again. It might be the processor or it might be  
something else on the motherboard. I don't know how to find out.

> Hope that helps.

Thank you, Dave, you have helped enormously. I will post my successful  
commands in due course.

> Regards.
>
> --
> Dave Garry
>
> On 30/12/13 08:18, Fay Zee wrote:
>> Quoting Dave Garry <daveg at firsdown.dyndns.org> on Sun, 29 Dec 2013 11:46:14:
>> Thanks a lot, Dave, I'm grateful for your help.
>>
>>> Hi Fay,
>>>
>>> If the disks were using Linux soft RAID (mdadm) then this site  
>>> should be helpful:
>>
>> Thanks for the link, I read through most of the sections.
>>
>>> https://raid.wiki.kernel.org/index.php/Linux_Raid
>>>
>>> First you need to identify which of two of the three disks were  
>>> being used as the
>>> RAID mirrors. Booting a live disk with one disk in a caddy is the  
>>> way to start.
>>>
>>> The output from "fdisk -l" should be all you need to identify the  
>>> disks - look at the
>>> "partition type" field - those that are "0xfd" are software RAID.
>>
>> fdisk -l was a great help and showed me which two were the mirrors.
>> I didn't see a "partition type" field and there was no mention of "0xfd".
>>
>> This is my output from fdisk -l. It was identical for both disks:
>>
>> Disk /dev/sdc: 500.1 GB, 500107862016 bytes
>> 255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
>> Units = sectors of 1 * 512 = 512 bytes
>> Sector size (logical/physical): 512 bytes / 512 bytes
>> I/O size (minimum/optimal): 512 bytes / 512 bytes
>> Disk identifier: 0x000cd29d
>>
>>   Device Boot      Start         End      Blocks   Id  System
>> /dev/sdc1            2048      976895      487424   fd  Linux raid  
>> autodetect
>> /dev/sdc2          978942   976771071   487896065    5  Extended
>> /dev/sdc5          978944    20508671     9764864   fd  Linux raid  
>> autodetect
>> /dev/sdc6        20510720    59570175    19529728   fd  Linux raid  
>> autodetect
>> /dev/sdc7        59572224   157227007    48827392   fd  Linux raid  
>> autodetect
>> /dev/sdc8       157229056   166991871     4881408   fd  Linux raid  
>> autodetect
>> /dev/sdc9       166993920   176756735     4881408   82  Linux swap / Solaris
>> /dev/sdc10      176758784   976771071   400006144   fd  Linux raid  
>> autodetect
>>
>>> Commands such as "mdadm --assemble --scan" will probe the disk for RAID
>>> volumes, these will then be accessible via /dev/mdxx where xx will  
>>> be unique for
>>> each volume.
>>
>> "mdadm --assemble --scan" worked for me and I saw the unique  
>> reference, but am still not sure what to type to get access.
>>
>> These are the two outputs from mdadm --assemble --scan:
>>
>> mdadm: /dev/md/jill:5 has been started with 1 drive (out of 2).
>> mdadm: /dev/md/jill:4 has been started with 1 drive (out of 2).
>> mdadm: /dev/md/jill:3 has been started with 1 drive (out of 2).
>> mdadm: /dev/md/jill:2 has been started with 1 drive (out of 2).
>> mdadm: /dev/md/jill:1 has been started with 1 drive (out of 2).
>> mdadm: /dev/md/jill:0 has been started with 1 drive (out of 2).
>>
>> mdadm: /dev/md/jill:5_0 has been started with 1 drive (out of 2).
>> mdadm: /dev/md/jill:4_0 has been started with 1 drive (out of 2).
>> mdadm: /dev/md/jill:3_0 has been started with 1 drive (out of 2).
>> mdadm: /dev/md/jill:2_0 has been started with 1 drive (out of 2).
>> mdadm: /dev/md/jill:1_0 has been started with 1 drive (out of 2).
>> mdadm: /dev/md/jill:0_0 has been started with 1 drive (out of 2).
>>
>> What should my mount command be to access each disk?
>>
>>
>>> You cannot / should not mount the volume via /dev/sdxx, always
>>> use the /dev/mdxx device as found by mdadm.
>>
>> Might I have damaged the data by trying to mount the disks by that  
>> method last week?
>>
>>> The command "cat /proc/mdstat" will show stats on each RAID volume.
>>>
>>> When only using one disk from a mirrored pair the volumes will be  
>>> in degraded
>>> mode - "cat /proc/mdstat" will show this. You should be able to  
>>> mount the volumes
>>> read-only to get to your data...
>>>
>>> If hardware RAID was being used then the above may not be of use, and you
>>> may need another motherboard with the same RAID chipset to be able to read
>>> them.
>>>
>>> I hope this helps.
>>>
>>> Regards.
>>>
>>> -- 
>>> Dave Garry
>>
>>>
>>> On 29/12/13 04:53, Fay Zee wrote:
>>>> Hi, Can anyone advise me how to retrieve data from a mirrored  
>>>> disk, please?
>>>>
>>>> I tried putting each disk into an external HDD caddy on two other  
>>>> Linux machines but could not read them, and did not get any  
>>>> meaningful information when running a live gparted disk.
>>>>
>>>> The mirrored disks are 500GB SATA but there is also an additional  
>>>> 500GB SATA disk in the machine, which I wasn't using. I don't  
>>>> know which two are the mirrors.
>>>>
>>>> My (desktop) motherboard has developed a fault. The machine boots  
>>>> up and the disks spin, and there are beeps which we've compared  
>>>> to the manual, but I am not getting graphics. There are no  
>>>> graphics with a live CD or DVD either.
>>>>
>>>> Ten minutes and two start-ups prior to this fault, the boot up  
>>>> message reported that it started up with only one of the mirrored  
>>>> disks.
>>>>
>>>> The operating system is Debian Squeeze, installed in mirror mode.
>>>>
>>>> The motherboard actually supports mirroring but I believe the  
>>>> mirroring is entirely software driven.
>>>>
>>>> I had intended to upgrade to Debian Wheezy at the beginning of  
>>>> December, so skipped a back-up.
>>>>
>>>> I had a friend round who repairs hardware for a living. We tried  
>>>> removing the battery, shorting out the bios, swapping out the  
>>>> monitor, the graphics card, the power unit and took out the  
>>>> memory sticks in turn, as well as testing all the connections.
>>>>
>>>> It is a Gigabyte GA M720 US3 nVidia chipset dual bios with extra  
>>>> thick copper.
>>>> The processor is AMD Phenom II AM2+ quad core 940.
>>>> The graphics card is 512MB DDR3 nVidia Geforce 9600GT PCI express  
>>>> - there is no onboard graphics.
>>>> There are four 2GB dual channel DDR2 800 PC2 6400 RAM memory sticks.
>>>>
>>>> The machine was built for me in 2009.
>>>>
>>>>
>>>> Best regards,
>>>> Fay
>>>> -- 
>>>> East Grinstead Linux User Group
>>>> www.eglug.org.uk
>>>>
>>>>
>>>
>>>
>>> -- 
>>> Sussex mailing list
>>> Sussex at mailman.lug.org.uk
>>> E-mail Address: sussex at mailman.lug.org.uk
>>> Sussex LUG Website: http://www.sussex.lug.org.uk/
>>> https://mailman.lug.org.uk/mailman/listinfo/sussex
>>>
>>
>>
>>
>> Best regards,
>> Fay
>> -- 
>> East Grinstead Linux User Group
>> www.eglug.org.uk
>>
>>
>
>



Best regards,
Fay
--
East Grinstead Linux User Group
www.eglug.org.uk




More information about the Sussex mailing list