Koozali.org: home of the SME Server

Replacing a Damaged Scsi Software Raid 1 With a Larger Ide

Offline ldkeen

  • *
  • 405
  • +0/-0
Replacing a Damaged Scsi Software Raid 1 With a Larger Ide
« on: December 01, 2004, 01:51:50 AM »
Replacing a Damaged Scsi Software Raid 1 With a Larger Ide Raid 1 on E-Smith

Note: To get the best performance from raided ide drives they should be set as masters on the primary and secondary channels.
ie. hda and hdc

Step-1 - boot knoppix from CD and image good scsi drive to new ide drives

Pull up terminal as root
$ su

Image drives, where sdx is the remaining good drive either sda or sdb
# dd if=/dev/sdx of=/dev/hda
# dd if=/dev/sdx of=/dev/hdc

This step take quite some time (in the order of hours) so be patient

Step-2 - move and resize partitions to use larger hard drive space

Reboot knoppix with no swap device
# knoppix noswap

Pull up terminal as root
$ su

Use graphical interface to move swap partition to end of the drives
# qtparted
select hda
right click on the swap partition and select move
type 0 in the "Free space after" box and press tab.
click OK
click Device and select commit

repeat for hdc

Resize root partition to take up remaining free space (qtparted doesn't support ext3 so must use parted)
# parted /dev/hda
(parted) print

write down the size of the starting positions of the root (Minor 2) and swap (Minor 3) partitions and call them r & s
(parted) resize 2 r s
(parted) quit

repeat for hdc


Step-3 - edit raidtab file and copy to knoppix file system

Mount root partition of new ide drive
right click hda2 icon on desktop
click mount
right click hda2 icon again
click Actions, Change read write mode
click ok to change to write

# mcedit /mnt/hda2/etc/raidtab
Change all sda to hda and all sdb to hdc and save

Now copy the raidtab file from your real root filesystem to the current root filesystem.
# cp /mnt/hda2/etc/raidtab /etc/raidtab


Step-4 - unmount filesystems

In order to start the raid devices, and sync the drives, it is necessary to unmount all the temporary filesystems.

# umount /mnt/hd*


Step-5 - start raid devices

Because there are filesystems on /dev/hda1, /dev/hda2 and /dev/hda3 it is necessary to force the start of the raid device.
# mkraid --really-force /dev/md2

You can check the completion progress by cat'ing the /proc/mdstat file. It shows you status of the raid device and percentage left to sync.
Again this step can take quite some time (in the order of hours) so be patient.

Continue with / and /boot

# mkraid --really-force /dev/md1
# mkraid --really-force /dev/md0

The md driver syncs one device at a time.


Step-6 - resize filesystem

When we created the raid device, the physical partion became slightly smaller because a second superblock is stored at the end of the partition.
If you reboot the system now, the reboot will fail with an error indicating the superblock is corrupt.

Resize them prior to the reboot

You will be required to fsck each of the md devices except the swap device. The -f flag is required to force fsck to check a clean filesystem.
This will generate the same error about inconsistent sizes and possibly corrupted superblock.Say N to 'Abort?'.
# e2fsck -f /dev/md0
# e2fsck -f /dev/md1

# resize2fs /dev/md0
# resize2fs /dev/md1

Check again to be sure. Should be no errors now.
# e2fsck -f /dev/md0
# e2fsck -f /dev/md1

Remake swap space
# mkswap -c /dev/md2

Step-7 - Reboot and viola.

# reboot

steriz

New install using raid
« Reply #1 on: December 03, 2004, 09:44:37 PM »
Hi folks need some help!

Trying to install sme 6 beta3 using raid card with x2 80gb hardisks they are both set to masters primary & secondary. when card boots up it sees the drives no problem. when installing sme it comes up with no hardisks detected. I set up sme 6 about 10 months ago with the same setup and had no trouble, have i missed something out somewhere its been along time just getting back into it.

Regards Steve :hammer:

Offline ldkeen

  • *
  • 405
  • +0/-0
New install using raid
« Reply #2 on: December 03, 2004, 11:26:49 PM »
Steve,
The raid card can see the drives because that's what it was designed to do, however in order for SME 6 to see the drives you will need to install the drivers at installation time which can be a bit complex. My suggestion - seeing as you only have the 2 drives rip the raid card out and go with software raid 1 (which in some cases may even outperform your hardware raid card, at the very least you wouldn't detect the difference).
Regards Lloyd

Offline MSmith

  • *
  • 675
  • +0/-0
ldkeen: THANKS!
« Reply #3 on: December 05, 2004, 04:46:48 AM »
That's one I cut & pasted for the SME file ... brilliant!
...

Offline Boris

  • *
  • 783
  • +0/-0
Re: New install using raid
« Reply #4 on: December 05, 2004, 05:12:14 AM »
Quote from: "steriz"
Trying to install sme 6 beta3

In case you didn't notice: where is final version 6.0 and contribs branded 6.01 and 6.01.01 vesrions available for almost a year instead of old beta.
...