SME 6.0 server RAID 1 install and restore

Change CHS info

Many thanks to http://willert.dk/geek/raid.html for help on this.

Install as RAID 1

#mount

/dev/md1 on / type ext3 (rw,usrquota,grpquota)
none on /proc type proc (rw)
usbdevfs on /proc/bus/usb type usbdevfs (rw)
/dev/md0 on /boot type ext3 (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /dev/shm type tmpfs (rw)
/dev/fd0 on /mnt/floppy type vfat (rw)
___________________________________________________
#fdisk -l (This was for a pair of 20 gig WD HDs)

Disk /dev/hdc: 255 heads, 63 sectors, 2434 cylinders
Units = cylinders of 16065 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hdc1   *         1        13    104391   fd  Linux raid autodetect
/dev/hdc2            14      2401  19181610   fd  Linux raid autodetect
/dev/hdc3          2402      2434    265072+  fd  Linux raid autodetect

Disk /dev/hda: 255 heads, 63 sectors, 2434 cylinders
Units = cylinders of 16065 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1        13    104391   fd  Linux raid autodetect
/dev/hda2            14      2401  19181610   fd  Linux raid autodetect
/dev/hda3          2402      2434    265072+  fd  Linux raid autodetect 

______________________________________________
#cat /etc/fstab

LABEL=/ / ext3 usrquota,grpquota 1 1
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,owner,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
none /proc proc defaults 0 0
none /dev/shm tmpfs defaults 0 0
/dev/md2 swap swap defaults 0 0

__________________________________________________

#cat /proc/mdstat

Personalities : [raid1]
read_ahead 1024 sectors
md2 : active raid1 hdc3[1] hda3[0]
264960 blocks [2/2] [UU]

md1 : active raid1 hdc2[1] hda2[0]
19181504 blocks [2/2] [UU]

md0 : active raid1 hdc1[1] hda1[0]
104320 blocks [2/2] [UU]

unused devices: <none>

___________________________________________________
#cat /etc/raidtab


raiddev /dev/md1
raid-level 1
nr-raid-disks 2
chunk-size 64k
persistent-superblock 1
nr-spare-disks 0
device /dev/hda2
raid-disk 0
device /dev/hdc2
raid-disk 1
raiddev /dev/md0
raid-level 1
nr-raid-disks 2
chunk-size 64k
persistent-superblock 1
nr-spare-disks 0
device /dev/hda1
raid-disk 0
device /dev/hdc1
raid-disk 1
raiddev /dev/md2
raid-level 1
nr-raid-disks 2
chunk-size 64k
persistent-superblock 1
nr-spare-disks 0
device /dev/hda3
raid-disk 0
device /dev/hdc3
raid-disk 1

_________________________________________________________

________________________________________________________

#cat /proc/mdstat

Personalities : [raid1]
read_ahead 1024 sectors
md2 : active raid1 hda3[0]
264960 blocks [2/1] [U_]

md1 : active raid1 hda2[0]
19181504 blocks [2/1] [U_]

md0 : active raid1 hda1[0]
104320 blocks [2/1] [U_]

unused devices: <none>

__________________________________________

_________________________________________________

#fdisk -l

Disk /dev/hdc: 255 heads, 63 sectors, 2434 cylinders
Units = cylinders of 16065 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hdc1   *         1        13    104391   fd  Linux raid autodetect
/dev/hdc2            14      2401  19181610   fd  Linux raid autodetect
/dev/hdc3          2402      2434    265072+  fd  Linux raid autodetect

Disk /dev/hda: 255 heads, 63 sectors, 2434 cylinders
Units = cylinders of 16065 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1        13    104391   fd  Linux raid autodetect
/dev/hda2            14      2401  19181610   fd  Linux raid autodetect
/dev/hda3          2402      2434    265072+  fd  Linux raid autodetect 

fdisk /dev/hdxx will make a new partition for you. Set ID to fd.
mke2fs /dev/hdxx will format it in ext2.
tune2fs -j /dev/hdxx will format it as ext3.

_____________________________________________________

# raidhotadd -a /dev/md0 /dev/hdc1
# raidhotadd -a /dev/md1 /dev/hdc2
# raidhotadd -a /dev/md2 /dev/hdc3

_____________________________________________________

Personalities : [raid1]
read_ahead 1024 sectors
md2 : active raid1 hdc3[2] hda3[0]
264960 blocks [2/1] [U_]

md1 : active raid1 hdc2[2] hda2[0]
19181504 blocks [2/1] [U_]
[====>................] recovery = 24.3% (4670212/19181504) finish=23.4min speed=10303K/sec
md0 : active raid1 hdc1[1] hda1[0]
104320 blocks [2/2] [UU]

unused devices: <none>

_________________________________________________

Change back Windows CHS change

In August 2006 I had a RAID with mismatched CHS information. I found that this is caused by using Windows' Disk Management program. Disk Management will change the number of heads from 255 to 16. To change it back:

1. fdisk –l shows:

Disk /dev/hdc: 16 heads, 63 sectors, 38792 cylinders
Units = cylinders of 1008 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hdc1   *         1       224    112864+  fd  Linux raid autodetect
/dev/hdc2           225     38331  19205928   fd  Linux raid autodetect
/dev/hdc3         38332     38792    232344   fd  Linux raid autodetect


Disk /dev/hda: 255 heads, 63 sectors, 2434 cylinders
Units = cylinders of 16065 * 512 bytes

   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1        14    112423+  fd  Linux raid autodetect
/dev/hda2            15      2405  19205707+  fd  Linux raid autodetect
/dev/hda3          2406      2434    232942+  fd  Linux raid autodetect

2. Break RAID:
     fdisk /dev/hdc Press t and set each partition to 83. Reboot.
3. Delete partitions
4. Press X for more functionality and do S (add correct info) H (add correct info) C (add correct info) Then CHS was OK.
5. Recreate partitions (n)
6. After partitions are created and look the same as the above, change the Id to fd. Press t, then partition number, fd, <enter>
7. Make /dev/hdc1 bootable. Press a, then 1 <enter>
8. Now the partition table should look the same for both disks.
9. raidhotadd –a /dev/md0 /dev/hdc1
raidhotadd –a /dev/md1 /dev/hdc2
raidhotadd –a /dev/md2 /dev/hdc3
10. /sbin/lilo -v

You can check with cat /proc/mdstat that they are syncing up.