Koozali.org: home of the SME Server

sme 7.1 raid rebuild

Offline tariqf

  • ****
  • 179
  • +0/-0
sme 7.1 raid rebuild
« on: January 04, 2007, 06:25:17 PM »
I installed a fresh sme 7.1 with a single 200gb sata hard disk. After this has been working a few days I decided to upgrade to a raid mirror so I added a brand new identical hard disk.

SME does not appear to have done anything - I though it was supposed to create rebuild the array automatically? I have tried all sorts of things from this forum but I cannot get my new blank hard disk to be rebuilt.

Please can someone help? output of /proc/mdstat is

Personalities : [raid1]
md1 : active raid1 sda[1] sdb1[0]
      104320 blocks [2/2] [UU]
     
md2 : active raid1 sdb2[0]
      199037248 blocks [2/1] [U_]
     
unused devices: <none>

Offline cool34000

  • *
  • 339
  • +0/-0
sme 7.1 raid rebuild
« Reply #1 on: January 04, 2007, 07:44:26 PM »
Hi,

Have you tried to connect directly to your server with admin user (not root). You should be able to manage your raid from here.

Offline tariqf

  • ****
  • 179
  • +0/-0
sme 7.1 raid rebuild
« Reply #2 on: January 04, 2007, 07:46:11 PM »
yes I tried that it just says:

Current RAID status:                                                     │
  │                                                                          │
  │ Personalities : [raid1]                                                  │
  │ md1 : active raid1 sdb1[0] sda[1]                                        │
  │       104320 blocks [2/2] [UU]                                           │
  │ md2 : active raid1 sdb2[0]                                               │
  │       199037248 blocks [2/1] [U_]                                        │
  │ unused devices: <none>                                                   │
  │                                                                          │
  │                                                                          │
  │ Only some of the RAID devices are unclean.                               │
  │                                                                          │
  │ Manual intervention may be required.

Offline cool34000

  • *
  • 339
  • +0/-0
sme 7.1 raid rebuild
« Reply #3 on: January 04, 2007, 08:40:47 PM »
Try this post

Maybe this should help you.

Offline tariqf

  • ****
  • 179
  • +0/-0
sme 7.1 raid rebuild
« Reply #4 on: January 04, 2007, 08:48:50 PM »
hi yes I read that but none of the commands in that thread (like raidhotadd on my server (7.1).

/dev/sda is a clean zero's out disk
/dev/sdb is my original hard disk that the server is curently running from

I seem to have /dev/sda as part of my md1 but not md2. If I

fdisk /dev/sda

and view partitions there are none, but there are 2 partitions on /dev/sdb.

Please can anyone help? I'm sure I missed something so simple here all I want to do is build up my new hard disk to mirror the first.

Offline Gaston94

  • ****
  • 184
  • +0/-0
Re: sme 7.1 raid rebuild
« Reply #5 on: January 04, 2007, 11:31:49 PM »
Hi,
your output is quite strange, you should not have this one :
Quote from: "tariqf"

Personalities : [raid1]
md1 : active raid1 sda[1] sdb1[0]
      104320 blocks [2/2] [UU]
:shock:
Nevertheless , let's go we'll deal with.
Whatever I will write, you should have a good backup of your data before acting !! ;)

To join your new disk to you existing raid device, you have to recreate the identical layout, then add the partition to the raid, and voilĂ  8)

In the folowing commands : sdb is the live disk and sda is your new clean disk :!:

First, we have to get rid of your spurious disk, may be just rebooting your server might do the same job ...
Code: [Select]
[root@ixus ~]# mdadm -f /dev/md1 /dev/sda1 -r /dev/sda1
mdadm: set /dev/sda1 faulty in /dev/md1
mdadm: hot removed /dev/sda1
[root@ixus ~]#

Now the normal stuff

Dump the partition layout from one disk and apply it to the other one
Code: [Select]
[root@ixus ~]# sfdisk -d /dev/sdb > sfdisk_sdb.out
[root@ixus ~]# sfdisk /dev/sda < sfdisk_sdb.out

(this will DESTROY any data you might have on sda  !)

Add the new partitions to your raid device
Code: [Select]
[root@ixus ~]# mdadm -a /dev/md1 /dev/sda1
mdadm: hot added /dev/sda1
[root@ixus ~]# mdadm -a /dev/md2 /dev/sda2
mdadm: hot added /dev/sda2

Now you can see the raid array being rebuilt
Code: [Select]

[root@ixus ~]# cat /proc/mdstat
Personalities : [raid1]
md1 : active raid1 sda1[2] sdb1[0]
      104320 blocks [2/1] [U_]
      [===================>.]  recovery = 98.0% (102528/104320) finish=0.0min speed=9320K/sec
md2 : active raid1 sda2[2] sdb2[0]
      1991936 blocks [2/1] [U_]
        resync=DELAYED
unused devices: <none>
[root@ixus ~]#


I guess you understood the touchy part in all of this is getting out from your current situation : sda1 more or less part of the raid ...

Hope this helps

Gaston

Offline tariqf

  • ****
  • 179
  • +0/-0
sme 7.1 raid rebuild
« Reply #6 on: January 04, 2007, 11:38:14 PM »
Hi Gaston94 I'm very grateful for your post which fixed my problem perfectly!

Thanks

Tariq

Mike

sme 7.1 raid rebuild
« Reply #7 on: January 05, 2007, 12:45:48 PM »
Just my 2 cents worth ...

I've done what Gaston outlined many times on my sandbox SME server here while I've been playing around with different arrangements of RAIDs etc ... in my experience I've found that there's one last step required that doesn't become apparent until after disaster has struck.

I'm pretty convinced (but am prepared to be corrected) that the new disk that's just been created (sda in this case) has to be made bootable ... with SME 6.x I seem to remember doing this with LILO but my more recent experiences with 7.0 needed me to use GRUB.

If you don't do this last step you can end up with a disk whose contents are a mirrored copy of the failed disk but there's nothing in the master boot record to kick start the system ... ie you'll need a recovery disk/system to get up and running again.

As I say, I'm happy to be corrected if I've got the story wrong ...

Offline Gaston94

  • ****
  • 184
  • +0/-0
sme 7.1 raid rebuild
« Reply #8 on: January 05, 2007, 10:48:57 PM »
Hello,
Quote from: "Mike"
If you don't do this last step you can end up with a disk whose contents are a mirrored copy of the failed disk but there's nothing in the master boot record to kick start the system ... ie you'll need a recovery disk/system to get up and running again.

you are right, this step is missing.

@tariqf, the following code should be applied to your system : !to anyone else be carrefull the above line are specific to tariqf's configuration : it's sda and sdb drive are inverted from usual case !
Code: [Select]
# grub
grub> root (hd0,0)
 Filesystem type is ext2fs, partition type 0xfd

grub> setup (hd0)

Alternatively, you can just have a floppy boot on side of your systeM

G.

Offline surfetish

  • 5
  • +0/-0
Re: sme 7.1 raid rebuild
« Reply #9 on: August 20, 2007, 09:44:43 PM »
# grub
grub> root (hd0,0)
 Filesystem type is ext2fs, partition type 0xfd

grub> setup (hd0)

Since his was reversed situation would this line be changed somehow in grub ?
Thanks for this post it helped alot!  :-D

Offline Gaston94

  • ****
  • 184
  • +0/-0
Re: sme 7.1 raid rebuild
« Reply #10 on: August 20, 2007, 10:00:56 PM »
Hi,
hd0 is usually referring to the first disk on the controller. WIthout any other mention, it would have linked to sda in this topic

Nevertheless, you can bypass grub disk notation specifiing explicitely which disk you want to work on for instance, you can say that you want grub thinking hd0 is /dev/sdb that way :
Code: [Select]
grub> device (hd0) /dev/sdb
grub> root (hd0,0)
grub> setup (hd0)
This notation is similar (in my mind at least) to
Code: [Select]
grub> root (hd1,0)
grub> setup (hd1)
the digit after hd represent the disk order in the chain, the second digit represent the partition number (starting from zero) for the boot one.
I guess you should find complete answer through search engine.
G.