Koozali.org: home of the SME Server
Legacy Forums => General Discussion (Legacy) => Topic started by: nald on January 19, 2005, 11:10:30 AM
-
I installed SME 6.0.1 as a file server and i installed it as a single hard drive. I want to add a new HD for software mirroring.
I made research and it stated that i need to back-up all the existing data and reinstall SME again using software mirroring.
Does anyone knows how to add a new HD for software mirroring without backing up the data?
Is it possible that i will just install the new HD and SME will just automatically create a mirror of the existing SME including all the data?
Please help me if you have any tools to this one. Thanks...
Nald
-
Nald,
Most of this howto will help you to add a new HDD and setup a software raid:
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
Regards Lloyd
-
Idkeen,
Thanks very much... I will try to test if it will work.
I still have one last question. I do have 2 computers, pc1 and pc2 which has a software raid1 mirroring. I tried to check pc1 if my mirroring is working. I run cat /proc/mdstat and this was the result.
md2: active raid1 hda3[0]
264960 blocks [2/1] [U_]
md1: active raid1 hda2[0]
38708544 blocks [2/1] [U_]
md0: active raid1 hda1[0]
104320 blocks [2/1] [U_]
I had researched that this kind of result means that one of the RAID sets has a missing disk.
I tried to view var/log/messages if there is any disk failure. I didn't find anything.
My pc2 has this kind of result.
md2: active raid1 hda3[0] hdc3[1]
264960 blocks [2/2] [UU]
md1: active raid1 hda2[0] hdc2[1]
38708544 blocks [2/2] [UU]
md0: active raid1 hda1[0] hdc1[1]
104320 blocks [2/2] [UU]
I think pc2 software mirroring is working fine.
Do you have any idea on how to fix software mirroring in pc1 or the steps you had given me is the only way to fix pc1?
Thanks...
Nald
-
Idkeen,
Hi... what do u mean by the image drives?
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
I tried to run this command and the result is "no such device or address"
Is there something wrong with my SME?
Nald
-
Hi Nald,
Yes you have a problem with pc1. pc2 appears to be fine. Basically you will have to pull hdc out of pc1 and replace it with an identical size HD. After installing and partitioning the drive, the command to image the new drive would be:
#dd if=/dev/hda of=/dev/hdc
If you don't have any SCSI devices in your system you would replace sdx with hdx throughout the procedure. HTH
Regards Lloyd