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.
root@bew:~# uname -a
Linux bew 3.5.0-23-generic #35~precise1-Ubuntu SMP Fri Jan 25 17:15:33 UTC 2013 i686 i686 i386 GNU/Linux

root@bew:~# fdisk -l

Disk /dev/sda: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders, total 398297088 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: 0x000a6462

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   389302271   194650112   fd  Linux raid autodetect
/dev/sda2       389304318   398295039     4495361    5  Extended
/dev/sda5       389304320   398295039     4495360   fd  Linux raid autodetect

Disk /dev/sdb: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders, total 398297088 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: 0x000cd49d

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048   389302271   194650112   fd  Linux raid autodetect
/dev/sdb2       389304318   398295039     4495361    5  Extended
/dev/sdb5       389304320   398295039     4495360   fd  Linux raid autodetect

Disk /dev/md127: 199.3 GB, 199321649152 bytes
255 heads, 63 sectors/track, 24232 cylinders, total 389300096 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: 0x000048ac

      Device Boot      Start         End      Blocks   Id  System
/dev/md127p1              63   385110179   192555058+  83  Linux
/dev/md127p2       385110180   389287079     2088450    5  Extended
/dev/md127p5       385110243   389287079     2088418+  82  Linux swap / Solaris


root@bew:~# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md127 : active raid1 sdb1[1]
      194650048 blocks [2/1] [_U]

No Array listed in /etc/mdadm/mdadm.conf
 automatically tag new arrays as belonging to the local system
HOMEHOST <system>

I deleted it hoping to rebuild.

root@bew:~# dmraid -dtay
DEBUG: not isw at 2064645120
DEBUG: isw trying hard coded -2115 offset.
DEBUG: not isw at 2063563264
DEBUG: not isw at 2064645120
DEBUG: isw trying hard coded -2115 offset.
DEBUG: not isw at 2063563264
no raid disks

root@bew:~# mdadm --create /dev/md0 --name=0 --chunk=256 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1
mdadm: /dev/sda1 appears to be part of a raid array:
    level=raid0 devices=0 ctime=Wed Dec 31 16:00:00 1969
mdadm: partition table exists on /dev/sda1 but will be lost or
       meaningless after creating array
mdadm: Note: this array has metadata at the start and
    may not be suitable as a boot device.  If you plan to
    store '/boot' on this device please ensure that
    your boot-loader understands md/v1.x metadata, or use
    --metadata=0.90
mdadm: super1.x cannot open /dev/sdb1: Device or resource busy
mdadm: /dev/sdb1 is not suitable for this array.
mdadm: create aborted


root@bew:~# mdadm -Evvvvs
mdadm: No md superblock detected on /dev/md127p5.
/dev/md127p2:
   MBR Magic : aa55
Partition[0] :      4176837 sectors at           63 (type 82)
mdadm: No md superblock detected on /dev/md127p1.
/dev/md127:
   MBR Magic : aa55
Partition[0] :    385110117 sectors at           63 (type 83)
Partition[1] :      4176900 sectors at    385110180 (type 05)
mdadm: No md superblock detected on /dev/sdb5.
/dev/sdb2:
   MBR Magic : aa55
Partition[0] :      8990720 sectors at            2 (type fd)
/dev/sdb1:
          Magic : a92b4efc
        Version : 0.90.00
           UUID : 63621c2f:6fa023e2:e368bf24:bd0fce41
  Creation Time : Mon Jan 23 14:19:49 2012
     Raid Level : raid1
  Used Dev Size : 194650048 (185.63 GiB 199.32 GB)
     Array Size : 194650048 (185.63 GiB 199.32 GB)
   Raid Devices : 2
  Total Devices : 1
Preferred Minor : 127

    Update Time : Mon Mar 24 13:11:57 2014
          State : clean
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0
       Checksum : cac6a6e5 - correct
         Events : 1834362


      Number   Major   Minor   RaidDevice State
this     1       8       17        1      active sync   /dev/sdb1

   0     0       0        0        0      removed
   1     1       8       17        1      active sync   /dev/sdb1
/dev/sdb:
   MBR Magic : aa55
Partition[0] :    389300224 sectors at         2048 (type fd)
Partition[1] :      8990722 sectors at    389304318 (type 05)
mdadm: No md superblock detected on /dev/sda5.
/dev/sda2:
   MBR Magic : aa55
Partition[0] :      8990720 sectors at            2 (type fd)
/dev/sda1:
   MBR Magic : aa55
Partition[0] :    385110117 sectors at           63 (type 83)
Partition[1] :      4176900 sectors at    385110180 (type 05)
/dev/sda:
   MBR Magic : aa55
Partition[0] :    389300224 sectors at         2048 (type fd)
Partition[1] :      8990722 sectors at    389304318 (type 05)


root@bew:~# mdadm --examine /dev/sdb
/dev/sdb:
   MBR Magic : aa55
Partition[0] :    389300224 sectors at         2048 (type fd)
Partition[1] :      8990722 sectors at    389304318 (type 05)
root@bew:~#

root@bew:~# mdadm --examine /dev/sda
/dev/sda:
   MBR Magic : aa55
Partition[0] :    389300224 sectors at         2048 (type fd)
Partition[1] :      8990722 sectors at    389304318 (type 05)

root@bew:~# mdadm --examine /dev/md0
mdadm: cannot open /dev/md0: No such file or directory

root@bew:~# mdadm --examine /dev/md127
/dev/md127:
   MBR Magic : aa55
Partition[0] :    385110117 sectors at           63 (type 83)
Partition[1] :      4176900 sectors at    385110180 (type 05)

root@bew:~# mdadm --assemble --run --force /dev/md0 /dev/sda1
mdadm: Cannot assemble mbr metadata on /dev/sda1
mdadm: /dev/sda1 has no superblock - assembly aborted
 as you can see above it says there is a superblock and then here that there isn't.

root@bew:~# cat /proc/mdstat personalities
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md127 : active raid1 sdb1[1]
      194650048 blocks [2/1] [_U]

unused devices: <none>
cat: personalities: No such file or directory

root@bew:~# umount --force /dev/md127p1
umount2: Device or resource busy
umount: /: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
umount2: Device or resource busy

I found the system off, having crashed over night, the only way it boots is if I use the boot in degraded after selecting recovery mode from boot menu. I will not boot into the desktop either. Line command is all we got.

I first only tried to rename the md127 back to md0, but always came back with unable to gain exclusive access, then I tried to add, but always got the busy message. Once I edited the adadm.conf with md0 instead of the md127 and then rebuilt the kernel, no help, still boots into md127 though the conf had md0. at one point I received an error message that states that the magic is different and they are, though I don't know how that happen, one is aa55 and the other is a mixed number and letter, that seems to be common in the forums I have visited.

I have researched for days now with no luck, please I need help with this.. thanks.

share|improve this question
    
Welcome to AskUbuntu. Please have a look at the formatting instructions on the right of your screen while writing questions (or answers) so you can improve the readability on future questions. –  laurent Mar 24 at 21:26

2 Answers 2

mark this fixed. what i did..

first i did alot of research, i done a repair on the superblock, however, i don't think this was needed. I edited /dev/mdadm/mdadm.conf to say md0 instead of md127. I failed the drive that was reporting bad, then ran "update-initramfs -u" then rebooted, be careful not to boot from the drive that failed. the first time i did this it didn't take for some reason, had to repeat the process. maybe i didnt save the conf file or something.. but if after reboot the cat /proc/mdstat reports md0 instead of md127 it worked. after that i just readded the failed drive back to the array with mdadm --manage --add /dev/md0 /dev/sda1 remembering that its the partition that is part of the array not the drive itself. after the add i ran "cat /proc/mdstat" agian to see if it was syncing, it was, i waited for the sync to complete.. hours later i rebooted and all fixed.. the problem i was having was i was rebuilding the kernel instead of just doing an update i think.. also as long as "cat /etc/mdadm/mdadm.conf" is reporting ARRAY /dev/md0 UUID=63621c2f:6fa023e2:e368bf24:bd0fce41 and not ARRAY /dev/md127 UUID=63621c2f:6fa023e2:e368bf24:bd0fce41 ur ready for the "update-initramfs -u" and then the reboot and addition of the failed drive.. this may work without failing the drive, but it was just something that i did trying to fix this problem... the md127 seems to be a default md number now any time that the array goes to degraded mode, but it's easier to deal with than thought. although for me it took day's.. check out the link about, wish i would of found that days ago.

share|improve this answer

First, dmraid is for fakeraid; it has nothing to do with mdadm software raid so you shouldn't even have it installed. Second, you should never try to create an array over top of an existing one; this will destroy the existing array. Fortunately, mdadm didn't let you do this.

The reason it is showing up as md127 instead of md0 is because you don't have the array listed in mdadm.conf. This isn't really a big deal, but if you do fix mdadm.conf, you then have to run update-initramfs to propagate the changes into the initramfs.

Finally, it looks like you just need to re-add the first partition to the array with `sudo mdadm /dev/md127 --add /dev/sda1. Also you seem to have a second partition ( number 5 ) on each disk that is designated for raid, but you aren't using.

share|improve this answer
    
if i do a... /etc/mdadm/mdadm.conf.... i see ....ARRAY /dev/md0 UUID=63621c2f:6fa023e2:e368bf24:bd0fce41... ... but if only... cat /proc/mdstat..... md127 : active raid1 sdb1[1] 194650048 blocks [2/1] [_U].... it says the same after the update... p5 is swap partitions on both drives –  user261678 Mar 24 at 23:30
    
or wait i think p5 was file storage, this server has been maint free for about two years, i forgot.. –  user261678 Mar 24 at 23:42
    
@user261678, and did you reboot after the update? Based on the size of the partition 5 on each of the individual disks, it appears they were intended to be used for swap, but in fact, are now unused and swap is partition 5 inside the raid array. –  psusi Mar 25 at 1:29
    
ok so i forgot to reboot... after rebooting, md0 was inplace, and after mdadm --manage /dev/md0 --add //dev/sda1 mstat showed the system is syncing.... thanks.. do i need to set the swap space back up or it should use it fine ya... thanks again... –  user261678 Mar 25 at 4:59
    
@user261678, it should be fine... the only problem is that you have a 4 GiB partition on each disk that is going to waste. –  psusi Mar 25 at 13:45

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.