Robert Hanson
2005-Mar-21 22:04 UTC
[Centos] raid mirroring on existing CentOS 4 installation?
Greetings I have a simple Intel 865PERL motherboard and 1.8GHz processor test server w/ CentOS 4 on it. It was upgraded from 3.3 to 3.4 then "linux upgradeany" to 4.0. Ok, I started with one 40G PATA WD hard drive (/dev/hda) and just added a second identical drive on the slave controller and it is (/dev/hdc) I think /dev/hdb is the DVD/CDROM Here is the first drive /dev/hda on my test box. Filesystem 1K-blocks Used Available Use% Mounted on /dev/hda1 1004024 361112 591908 38% / /dev/hda6 5036284 35016 4745436 1% /home /dev/hda7 5036284 34920 4745532 1% /home/vpopmail none 517520 0 517520 0% /dev/shm /dev/hda5 5218040 32924 4920048 1% /tmp /dev/hda2 10080520 4143052 5425400 44% /usr /dev/hda3 10080520 280508 9287944 3% /var Disk /dev/hda: 40.0 GB, 40020664320 bytes 255 heads, 63 sectors/track, 4865 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 127 1020096 83 Linux /dev/hda2 128 1402 10241437+ 83 Linux /dev/hda3 1403 2677 10241437+ 83 Linux /dev/hda4 2678 4865 17575110 f W95 Ext''d (LBA) /dev/hda5 2678 3337 5301418+ 83 Linux /dev/hda6 3338 3974 5116671 83 Linux /dev/hda7 3975 4611 5116671 83 Linux /dev/hda8 4612 4865 2040223+ 82 Linux swap Ok, so... can I upgrade to mirroring on the fly? Is there a specific URL I should be learning from on this? When I get tired of this playpen and go to a fresh "test" install, what mirroring install facts and knowledge should I be following at that time please? In the very near future, I want to go to a large spin fast read/write hot swap RAID architecture. Sooooooooooo... Do you folks have any recommendations as to what URL''s I should be looking at in the future for going to my long term goal of SATA RAID5 with an aftermarket controller like 3ware or other CentOS happy hardware RAID controllers? Thank you in advance for your time. - rh
Michael Weisman
2005-Mar-21 22:20 UTC
[Centos] raid mirroring on existing CentOS 4 installation?
Before you buy anything, be aware of the fact that CentOS4 does not have "built-in" support for either 3ware or adaptec SATA RAID cards, In fact, it doesn''t support many raid cards, at all. Your best best will be the LSI or MegaRaid cards. Also, if you read the digest version of this list, since the beginning of the month, there were quite a number of posts regarding Raid and CentOS4, including a few from me. Good Luck. Michael Weisman The Ad Doctors mike@theaddoctors.com On Monday 21 March 2005 17:03, Robert Hanson wrote:> Greetings > > I have a simple Intel 865PERL motherboard and 1.8GHz processor test server > w/ CentOS 4 on it. It was upgraded from 3.3 to 3.4 then "linux upgradeany" > to 4.0. > > Ok, I started with one 40G PATA WD hard drive (/dev/hda) and just added a > second identical drive on the slave controller and it is (/dev/hdc) > > I think /dev/hdb is the DVD/CDROM > > Here is the first drive /dev/hda on my test box. > > Filesystem 1K-blocks Used Available Use% Mounted on > /dev/hda1 1004024 361112 591908 38% / > /dev/hda6 5036284 35016 4745436 1% /home > /dev/hda7 5036284 34920 4745532 1% /home/vpopmail > none 517520 0 517520 0% /dev/shm > /dev/hda5 5218040 32924 4920048 1% /tmp > /dev/hda2 10080520 4143052 5425400 44% /usr > /dev/hda3 10080520 280508 9287944 3% /var > > Disk /dev/hda: 40.0 GB, 40020664320 bytes > 255 heads, 63 sectors/track, 4865 cylinders > Units = cylinders of 16065 * 512 = 8225280 bytes > > Device Boot Start End Blocks Id System > /dev/hda1 * 1 127 1020096 83 Linux > /dev/hda2 128 1402 10241437+ 83 Linux > /dev/hda3 1403 2677 10241437+ 83 Linux > /dev/hda4 2678 4865 17575110 f W95 Ext''d (LBA) > /dev/hda5 2678 3337 5301418+ 83 Linux > /dev/hda6 3338 3974 5116671 83 Linux > /dev/hda7 3975 4611 5116671 83 Linux > /dev/hda8 4612 4865 2040223+ 82 Linux swap > > Ok, so... can I upgrade to mirroring on the fly? Is there a specific URL I > should be learning from on this? > > When I get tired of this playpen and go to a fresh "test" install, what > mirroring install facts and knowledge should I be following at that time > please? > > In the very near future, I want to go to a large spin fast read/write hot > swap RAID architecture. Sooooooooooo... > > Do you folks have any recommendations as to what URL''s I should be looking > at in the future for going to my long term goal of SATA RAID5 with an > aftermarket controller like 3ware or other CentOS happy hardware RAID > controllers? > > Thank you in advance for your time. > > - rh > > > > _______________________________________________ > CentOS mailing list > CentOS@caosity.org > http://lists.caosity.org/mailman/listinfo/centos
Matt Dainty
2005-Mar-21 22:37 UTC
[Centos] raid mirroring on existing CentOS 4 installation?
On Mon, 2005-03-21 at 22:20, Michael Weisman wrote:> Before you buy anything, be aware of the fact that CentOS4 does not have > "built-in" support for either 3ware or adaptec SATA RAID cards, In fact, it > doesn''t support many raid cards, at all.Do the 3w-9xxx and 3w-xxxx drivers not cover any of the SATA variants?> Your best best will be the LSI or MegaRaid cards. > > Also, if you read the digest version of this list, since the beginning of the > month, there were quite a number of posts regarding Raid and CentOS4, > including a few from me.The Areca SATA RAID cards are not supported out of the box on CentOS 4.0, but I''m providing drivers built for the CentOS kernels, which seem to work fine on the card I have here. Matt -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.caosity.org/pipermail/centos/attachments/20050321/56256ae7/attachment.bin
Joe Pruett
2005-Mar-21 22:38 UTC
[Centos] raid mirroring on existing CentOS 4 installation?
> Before you buy anything, be aware of the fact that CentOS4 does not have > "built-in" support for either 3ware or adaptec SATA RAID cards, In fact, it > doesn''t support many raid cards, at all. > > Your best best will be the LSI or MegaRaid cards. > > Also, if you read the digest version of this list, since the beginning of the > month, there were quite a number of posts regarding Raid and CentOS4, > including a few from me.the 3ware 9xxx cards are directly supported by centos4. i have a box running centos4 with sata drives on the 9500S-4LP with no extra drivers required.
Eric Berggren
2005-Mar-22 01:35 UTC
[Centos] raid mirroring on existing CentOS 4 installation?
> Before you buy anything, be aware of the fact that CentOS4 does not > have "built-in" support for either 3ware or adaptec SATA RAID cards, > In fact, it doesn''t support many raid cards, at all.> Your best best will be the LSI or MegaRaid cards.> Also, if you read the digest version of this list, since the beginning > of the month, there were quite a number of posts regarding Raid and > CentOS4, including a few from me.There is a 3ware module(s): /lib/modules/`uname -r`/kernel/drivers/scsi/3w-xxxx.ko /lib/modules/`uname -r`/kernel/drivers/scsi/3w-9xxx.ko Meanwhile... I wrote up the following procedure to setup LVM/mdadm RAID1 migrating from a single disk to 2 NEW identical drives to become the mirror - you can probably just retag the original drive as "Linux auto detect" and skip the copying/cpio everything to a 2nd staging drive if you''re feeling brave - otherwise, current hdc will become hda and current hda will become the mirrored hdc. This is cnp''d from HTML document - plaintext formatting may vary. Have NOT tested this against 4.0 (works in 3.x) : It is assumed that system is booted off of /dev/hda where /dev/hdc is an identical drive upon which a new boot disk will be constructed. In addition; example layout : Partition Filesystem Metadevice /dev/hda1 /boot /dev/md1 /dev/hda2 / /dev/md2 /dev/hda3 swap /dev/md3 /dev/hda5 /export/home /dev/md5 * If you''re adding a new disk that has a set of filesystems (and e2fs labels) on it, you will need to clear the partition table before installing it into a system, as the LABEL=/filesystem model gets easily confused; e2label can be used to just erase labels. Remember if you erase the labels, change /etc/grub/grub.conf and /etc/fstab to use partition names, or you won''t be able to reboot! 1. Ensure the disks are of the same type/size; Note: identical disks may have different geometry settings which must be resolved * sfdisk -sg /dev/hda; sfdisk -sg /dev/hdc 2. Copy the partition table (and geometry) from current to new disk * sfdisk -d /dev/hda | sfdisk /dev/hdc or * sfdisk -d /dev/hda | sfdisk -C <cyl> -H <head> -S <sec> /dev/hdc 3. Set the partition label on the new mirror drive to "Linux raid autodetect" : * sfdisk -c /dev/hdc 1 fd * sfdisk -c /dev/hdc 2 fd * sfdisk -c /dev/hdc 3 fd * sfdisk -c /dev/hdc 5 fd 4. Construct the RAID1 metadisk devices on each partition : * mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/hdc1 missing * mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/hdc2 missing * mdadm --create /dev/md3 --level=1 --raid-devices=2 /dev/hdc3 missing * mdadm --create /dev/md5 --level=1 --raid-devices=2 /dev/hdc5 missing 5. Construct filesystems on metadisk devices : * mkfs -t ext3 /dev/md1 * mkfs -t ext3 /dev/md2 * mkfs -t ext3 /dev/md5 * mkswap /dev/md3 6. Copy filesystems from original to new mirror drive : * mkdir /mnt/new * mount /dev/md2 /mnt/new * cd /; find . -xdev | cpio -pmd /mnt/new * mount /dev/md1 /mnt/new/boot * cd /boot; find . -xdev | cpio -pmd /mnt/new/boot * mount /dev/md5 /mnt/new/export/home * cd /export/home; find . -xdev | cpio -pmd /mnt/new/export/home 7. Update /etc/fstab file on new drive (/mnt/new/etc/fstab); replace all LABEL=/ tags with /dev/md# 8. Construct new initrd image which preloads the raid1 kernel module * RH73/9 env startraid=1 mkinitrd -f --preload=raid1 /mnt/new/boot/initrd-`uname -r`.img `uname -r` o RHEL/CentOS: can leave off the env startraid=1 part o repeat for any other bootable kernels on the system 9. Update grub.conf file on new disk; remove all (hdX,0) references and set the kernel root= option to the appropriate /dev/md device that''s the root filesystem : default=0 timeout=10 splashimage=/grub/splash.xpm.gz title Red Hat Linux (2.4.20-28.7smp) kernel /vmlinuz-2.4.20-28.7smp ro root=/dev/md1 initrd /initrd-2.4.20-28.7smp.img 10. Unmount the new disk: umount /mnt/md3; umount /mnt/md0; umount /mnt/md1 11. Run GRUB to setup bootloader : root (hd1,0); setup (hd1) 12. Shutdown system, make new disk primary and check if it boots (verify all root disk filesystems are mounted on /dev/mdX devices) If all goes well, setup 2nd mirror disk (can recycle old boot disk) : 1. Reset partition table (types and layout) : * sfdisk -d /dev/hda | sfdisk /dev/hdc 2. Add the new mirror devices; monitor through /proc/mdstat : * mdadm --add /dev/md0 /dev/hdc1 * mdadm --add /dev/md1 /dev/hdc2 * mdadm --add /dev/md2 /dev/hdc3 * mdadm --add /dev/md3 /dev/hdc5 3. Setup GRUB loader on 2nd drive (can do this once /boot on /dev/md0 is finished) : root (hd1,0); setup (hd1) * Once all the mirrors are finished syncing up, you should be able to swap drives and have the system reboot. Should a disk fail, you will likely still have to physically remove it from the system (esp if IDE), but the other drive should be intact. Use the last procedure above to setup and reattach new mirror disk. -ericb