Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I had a working Ubuntu 11.10 with / on an SSD (/dev/sdc) and /home on a software RAID1 array that resided on two partitions on /dev/sda and /dev/sdb (identical drives), respectively. This was set up as SW RAID. The motherboard's HW RAID is disabled.
Today, I upgraded from 11.10 to 13.04 using a live CD. I chose the option of upgrading the existing 11.10 and retaining user data. At first, I could not boot after the upgrade. I suspected that the install had failed to update grub properly on sdc, so I first attempted to repair it by booting from the live CD and installing and using boot-repair. This was unable to complete for some unclear reason, so I instead reinstalled grub on sdc manually as described here: http://www.howtogeek.com/114884/how-to-repair-grub2-when-ubuntu-wont-boot/. After this, Ubuntu 13.04 booted to a text-based login prompt that would not accept the user name and password that I specified during install.
I then installed 13.04 from the live CD again, this time choosing to the "upgrade" the now existing 13.04 install to 13.04 (again, the option with retaining user files etc.). After this, 13.04 can successfully boot to a graphical login and lets me log in without errors.
Now, the only remaining problem is, that my RAID1 array seems lost :-( On sda, there used to be (in this order):

  1. a 699GB RAID member partition
  2. approx. 200GB of unallocated space
  3. a 109GB (ext3 or ext4 - don't remember) partition holding a backup of a previous Ubuntu install.

On sdb, there used to be:

  1. a 699GB RAID member partition
  2. an about 100GB (ext3 or ext4 - don't remember) partition holding a backup of my most recent Ubuntu install.
  3. an about 150GB (ext3 or ext4 - don't remember) partition holding some files.
  4. an about 50GB (ext3 or ext4 - don't remember) partition holding some files.

Examining the disks now, several of the partitions are gone - basically everything on sdb. fdisk -lu now says (sorry about the Danish - I hope you can guess what it means by comparing to fdisk output in your preferred language):

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 hoveder, 63 sektorer/spor, 121601 cylindre, i alt 1953525168 sektorer
Enheder = sektorer af 1 * 512 = 512 byte
Sektorstørrelse (logisk/fysisk): 512 byte / 512 byte
I/O-størrelse (minimum/optimal): 512 byte / 512 byte
Diskidentifikation: 0x000d9c82

    Enhed Opstart   Start         Slut     Blokke   Id  System
/dev/sda1              63  1364496839   682248388+   0  Tom
/dev/sda2   *  1740050432  1953519615   106734592   83  Linux

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
255 hoveder, 63 sektorer/spor, 121601 cylindre, i alt 1953525168 sektorer
Enheder = sektorer af 1 * 512 = 512 byte
Sektorstørrelse (logisk/fysisk): 512 byte / 512 byte
I/O-størrelse (minimum/optimal): 512 byte / 512 byte
Diskidentifikation: 0x000bf717

    Enhed Opstart   Start         Slut     Blokke   Id  System
/dev/sdb1      1577969664  1869625343   145827840   83  Linux
/dev/sdb2      1869628635  1953520064    41945715   83  Linux
/dev/sdb3      1364494336  1577963519   106734592   83  Linux
/dev/sdb4              63  1364480774   682240356    0  Tom

Partitionstabellens indgange er ikke i diskrækkefølge

Disk /dev/sdc: 120.0 GB, 120034123776 bytes
255 hoveder, 63 sektorer/spor, 14593 cylindre, i alt 234441648 sektorer
Enheder = sektorer af 1 * 512 = 512 byte
Sektorstørrelse (logisk/fysisk): 512 byte / 512 byte
I/O-størrelse (minimum/optimal): 512 byte / 512 byte
Diskidentifikation: 0x0008fd03

    Enhed Opstart   Start         Slut     Blokke   Id  System
/dev/sdc1   *        2048   209295359   104646656   83  Linux
/dev/sdc2       209297406   234440703    12571649    5  Udvidet
/dev/sdc5       209297408   234440703    12571648   82  Linux swap / Solaris

Disk /dev/mapper/ddf1_RAID: 2000.1 GB, 2000131457024 bytes
255 hoveder, 63 sektorer/spor, 243168 cylindre, i alt 3906506752 sektorer
Enheder = sektorer af 1 * 512 = 512 byte
Sektorstørrelse (logisk/fysisk): 512 byte / 512 byte
I/O-størrelse (minimum/optimal): 32768 byte / 65536 byte
Diskidentifikation: 0x000d9c82

                 Enhed Opstart   Start         Slut     Blokke   Id  System
/dev/mapper/ddf1_RAID1              63  1364496839   682248388+   0  Tom
Partition 1 starter ikke på en fysisk sektorgrænse.
/dev/mapper/ddf1_RAID2   *  1740050432  1953519615   106734592   83  Linux

Disk /dev/mapper/ddf1_RAID1: 698.6 GB, 698622349824 bytes
255 hoveder, 63 sektorer/spor, 84935 cylindre, i alt 1364496777 sektorer
Enheder = sektorer af 1 * 512 = 512 byte
Sektorstørrelse (logisk/fysisk): 512 byte / 512 byte
I/O-størrelse (minimum/optimal): 32768 byte / 65536 byte
Justeringsforskydning: 512 byte
Diskidentifikation: 0xbd223da2

Disk /dev/mapper/ddf1_RAID1 indeholder ikke en gyldig partitionstabel

Disk /dev/mapper/ddf1_RAID2: 109.3 GB, 109296222208 bytes
255 hoveder, 63 sektorer/spor, 13287 cylindre, i alt 213469184 sektorer
Enheder = sektorer af 1 * 512 = 512 byte
Sektorstørrelse (logisk/fysisk): 512 byte / 512 byte
I/O-størrelse (minimum/optimal): 32768 byte / 65536 byte
Diskidentifikation: 0x00000000

Disk /dev/mapper/ddf1_RAID2 indeholder ikke en gyldig partitionstabel

Running blkid says:

/dev/sda: UUID="M-,^[eRM-^FM-^@%:M-,^[eRM-D^[eRM-\^[eRM-^?M-^?M-^?M-^?" TYPE="ddf_raid_member" 
/dev/sdb: UUID="M-,^[eRM-^FM-^@%:M-,^[eRM-D^[eRM-\^[eRM-^?M-^?M-^?M-^?" TYPE="ddf_raid_member" 
/dev/sdc1: UUID="32579810-0388-416d-bb49-7031ac2c2975" TYPE="ext4" 
/dev/sdc5: UUID="b7507355-effd-4dbc-9b4e-0546bca036f4" TYPE="swap" 

I tried mdadm --examine /dev/sda and mdadm --examine /dev/sdb which revealed that the first part of sda and all of sdb appeared to contain RAID0 member partitions:

/dev/sda:
          Magic : Intel Raid ISM Cfg Sig.
        Version : 1.0.00
    Orig Family : 43d3cf98
         Family : 43d3cf98
     Generation : 00000003
     Attributes : All supported
           UUID : 6792b89b:e5162c11:b694727d:de71f59c
       Checksum : 7a5f4777 correct
    MPB Sectors : 1
          Disks : 2
   RAID Devices : 1

  Disk00 Serial : WD-WMATV3627263
          State : active
             Id : 00000000
    Usable Size : 1953519880 (931.51 GiB 1000.20 GB)

[Volume0]:
           UUID : 4af84c7c:76a536eb:e16d27fb:1a3a90c3
     RAID Level : 0
        Members : 2
          Slots : [UU]
    Failed disk : none
      This Slot : 0
     Array Size : 3907039232 (1863.02 GiB 2000.40 GB)
   Per Dev Size : 1953519880 (931.51 GiB 1000.20 GB)
  Sector Offset : 0
    Num Stripes : 30523744
     Chunk Size : 32 KiB
       Reserved : 0
  Migrate State : idle
      Map State : normal
    Dirty State : clean

  Disk01 Serial : WD-WMATV3628555
          State : active
             Id : 00010000
    Usable Size : 1953519880 (931.51 GiB 1000.20 GB)

/dev/sdb:
          Magic : Intel Raid ISM Cfg Sig.
        Version : 1.0.00
    Orig Family : 43d3cf98
         Family : 43d3cf98
     Generation : 00000003
     Attributes : All supported
           UUID : 6792b89b:e5162c11:b694727d:de71f59c
       Checksum : 7a5f4777 correct
    MPB Sectors : 1
          Disks : 2
   RAID Devices : 1

  Disk01 Serial : WD-WMATV3628555
          State : active
             Id : 00010000
    Usable Size : 1953519880 (931.51 GiB 1000.20 GB)

[Volume0]:
           UUID : 4af84c7c:76a536eb:e16d27fb:1a3a90c3
     RAID Level : 0
        Members : 2
          Slots : [UU]
    Failed disk : none
      This Slot : 1
     Array Size : 3907039232 (1863.02 GiB 2000.40 GB)
   Per Dev Size : 1953519880 (931.51 GiB 1000.20 GB)
  Sector Offset : 0
    Num Stripes : 30523744
     Chunk Size : 32 KiB
       Reserved : 0
  Migrate State : idle
      Map State : normal
    Dirty State : clean

  Disk00 Serial : WD-WMATV3627263
          State : active
             Id : 00000000
    Usable Size : 1953519880 (931.51 GiB 1000.20 GB)

I then ran mdadm --assemble --scan and now I have a RAID0 array. It contains:

  1. The three parts mentioned under sda above. Unfortunately, neither the 699GB partition here (which I am hoping still holds one of the copies of my original RAID1 array) or the 109GB partition can be mounted.
  2. 1TB of unallocated space which I suppose corresponds to sdb?

Can anyone:

  1. Help me figure out what went wrong?
    • For example, why did the RAID1 members turn into RAID0 members?
    • Where have the partitions on sdb gone?
    • Why is the partition type in the partitions on sda lost?
  2. Tell me how to fix it?
    • I can live without the smaller partitions, but I would really, really like to get my home dir from the RAID1 partition back.
share|improve this question
1  
You need to post the actual partition table ( output of fdisk -lu ) and the output of mdadm --examine. –  psusi Jun 21 '13 at 13:42
    
Can I somehow temporarily change the language in Ubuntu to English, so I do not get Danish output from the fdisk command - see above? –  Thomas Arildsen Jun 25 '13 at 11:22
    
@psusi I have inserted the requested outputs now. –  Thomas Arildsen Jun 25 '13 at 11:23
1  
You can try sudo LANG=en_US fdisk -lu. –  lgarzo Jun 25 '13 at 11:31
    
That shows you are, in fact, using the motherboard fakeraid, not software raid. What does blkid show? –  psusi Jun 25 '13 at 13:49

1 Answer 1

up vote 1 down vote accepted

Just as I was about to give up, I seem to have found a solution now.

  1. I ran parted /dev/sda print to identify the (seemingly empty) disk area where the partition was located.
  2. Then I ran parted /dev/sda rescue 0 699GB which found a partition at offset 1083kB.
  3. parted asked if I wanted to add it to the partition tabel, to which I answered yes.
  4. parted could now see the partition.
  5. I then ran parted /dev/sda unit B print to get the offset of the partition in bytes, which I after some trial-and-error have found that mount needs.
  6. I can now mount the partition: mount -o loop,ro,offset=1082880 -t ext4 /dev/sda /mnt.

Now I will probably copy the data from the recovered RAID1 member, as well as the data from the smaller partitions, to another hard drive; wipe /dev/sda and /dev/sdb completely; create new partiotions on them; assemble the new partitions in a RAID1 array; and finally copy back the data from the backup.

Regarding what went wrong: the sysadmins that helped me investigate this said that their best bet was that the Ubuntu upgrade procedure somehow wrongly detected the meta data from the old (non-existing) HW RAID set-up instead of the actual SW RAID set-up. It may have then mounted the array as RAID0, spanning the entire disks /dev/sda and /dev/sdb, and thereby overwritten meta data about the actual SW RAID1 array that spanned the two ~700GB partitions.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.