📚 LinuxDocs
Topics:
All Pages8021X HOWTOACP ModemACPI HOWTOADSL Bandwidth Man..ATA RAID HOWTOATM Linux HOWTOAX25 HOWTOAccessibility Dev ..Accessibility HOWTOAdv Bash Scr HOWTOAdv Routing HOWTOAntares RAID sparc..Apache Compile HOWTOApache WebDAV LDAP..Assembly HOWTOAstronomy HOWTOAthlon Powersaving..Authentication Gat..Autodir HOWTOAviation HOWTOAvr Microcontrolle..BRIDGE STP HOWTOBTTVBackspaceDeleteBandwidth Limiting..Bangla HOWTOBash Prompt HOWTOBattery PoweredBelarusian HOWTOBelgian HOWTOBeowulf HOWTOBocaBogoMipsBootdisk HOWTOBridgeC++ dlopenC C++Beautifier HO..C editing with VIM..CDROM HOWTOCDServer HOWTOCable ModemCaudium HOWTOClone HOWTOCompaq Remote Insi..Compaq T1500 HOWTOConexant+Rockwell ..Cryptoloop HOWTODB2 HOWTODHCPDSL HOWTODVD Playback HOWTODebian Binary Pack..Debian JigdoDebian and Windows..Disk Encryption HO..Disk on Chip HOWTODocBook Demystific..DocBook InstallDocBook OpenJade S..Ecology HOWTOEmacspeak HOWTOEncourage Women Li..Encrypted Root Fil..Euro Char SupportEvent HOWTOFedora Multimedia ..Finnish HOWTOFirewall PiercingFlash Memory HOWTOFont HOWTOFramebuffer HOWTOGCC HOWTOGIS GRASSGlibc Install HOWTOHOWTO HOWTOHOWTO INDEXHP HOWTOHandspring VisorHard Disk UpgradeHardware HOWTOHighQuality Apps H..Home Electrical Co..IBM7248 HOWTOIO Perf HOWTOIP AliasIP Masquerade HOWTOIRCImplement Sys Call..Indic Fonts HOWTOInfrared HOWTOIngresII HOWTOInstall StrategiesInstallation HOWTOInstallfest HOWTOIntkeybItalian HOWTOJabber Server Farm..JavaStation HOWTOKerberos Infrastru..Kernel HOWTOKerneldKodak Digitalcam H..LDAP HOWTOLDP Reviewer HOWTOLILO crash rescue ..LVM HOWTOLeased LineLegoLinksys Blue Box R..Linux+Win95Linux+Win9x+Grub H..Linux+Windows HOWTOLinux Complete Bac..Linux Crash HOWTOLinux Gamers HOWTOLinux Modem SharingLinux Promise RAID..Linux i386 Boot Co..LinuxGL QuakeWorld..Lotus DominoR5MILO HOWTOMMBase Inst HOWTOMP3 CD BurningMail User HOWTOMajordomo MajorCoo..Man PageMasquerading Simpl..Medicine HOWTOMindTerm SSH HOWTOMobile IPv6 HOWTOMock MainframeModule HOWTOModulesMotorola Surfboard..Mozilla OptimizationMulti Distro DevNCURSES Programmin..NFS HOWTONFS Root Client mi..NIS HOWTONetMeeting HOWTONetwork boot HOWTONvidia OpenGL Conf..OLSR IPv6 HOWTOOnline Troubleshoo..Oracle 9i Fedora 3..PA RISC Linux Boot..PCTel MicroModem C..PHP Nuke HOWTOPPP HOWTOPagerPalmOS HOWTOPartitionPartition Mass Sto..Partition Mass Sto..Partition RescuePine ExchangePortSlavePost Installation ..Postfix Cyrus Web ..Pre Installation C..Print2WinPrinting HOWTOProcess AccountingProgram Library HO..Proxy ARP SubnetQmail ClamAV HOWTOQmail VMailMgr Cou..Querying libiptc H..RPM HOWTOReading List HOWTORedHat CD HOWTOReliance HOWTORemote BridgingRemote Serial Cons..SCSI 2.4 HOWTOSCSI Generic HOWTOSLIP PPP EmulatorSRM HOWTOSSL Certificates H..Scanner HOWTOScientific Computi..Scripting GUI TclTkSecure CVS PserverSecure Programs HO..Security HOWTOSecurity Quickstar..Security Quickstar..Serial Laplink HOWTOSerial Programming..Slovak HOWTOSmall MemorySmart Card HOWTOSoftware Proj Mgmt..Software Release P..Sound HOWTOSpam Filtering for..Speech Recognition..SquashFS HOWTOSybase ASA HOWTOSybase ASE HOWTOSybase PHP ApacheTCP Keepalive HOWTOTamil Linux HOWTOTimePrecision HOWTOTimeSys Linux Inst..Token RingTraffic Control HO..Traffic Control tc..UPS HOWTOUnix Hardware Buye..Unix and Internet ..UpgradeUsenet News HOWTOUser Authenticatio..VB6 to TclVMS to Linux HOWTOVPN HOWTOValgrind HOWTOVideoLAN HOWTOVim HOWTOVirtual WebWebcam HOWTOWikiText HOWTOWindows Newsreader..Wireless Link sys ..Wireless Sync HOWTOXDM XtermXDMCP HOWTOXFree Local multi ..XFree86 HOWTOXFree86 R200XFree86 Second MouseXFree86 Video Timi..XML RPC HOWTOXWindow Overview H..XWindow User HOWTOXinerama HOWTOXterminalsHtml singleI810 HOWTOLibdc1394 HOWTOOpenMosix HOWTOPhhttpd HOWTOPpp sshText
Next Previous Contents

4. Upgrading from non-raid to RAID1/4/5

Upgrading a non-raid system to raid is fairly easy and consists of several discrete steps described below. The description is for a system with a boot partition, root partition and swap partition.

OLD disk in the existing system:

    /dev/hda1     boot, may be dos+lodlin or lilo
    /dev/hda2     root
    /dev/hda3     swap
We will add an additional disk and convert the entire system to RAID1. You could easily add several disks and make a RAID5 set instead using the same procedure.

4.1 Step 1 - prepare a new kernel

Download a clean kernel, raidtools-0.90 (or the most recent version), and the kernel patch to upgrade the kernel to 0.90 raid.

Compile and install the raidtools and READ the documentation. .:: telegra.ph ::. [Google Scholar: Red Hat Enterprise Linux]

Compile and install the kernel to support all the flavors (0/1/4/5 ?) of raid that you will be using. Make sure to specify autostart of raid devices in the kernel configuration. Test that the kernel boots properly and examine /proc/mdstat to see that the raid flavors you will use are supported by the new kernel.

4.2 Step 2 - set up raidtab for your new raid.

The new disk will be added to an additional IDE controller as the master device, thus becomming /dev/hdc .:: rndirectors.com ::.

    /dev/hdc1     16megs -- more than enough for several kernel images
    /dev/hdc2     most of the disk
    /dev/hdc3     some more swap space, if needed. otherwise add to hdc2

Change the partition types for /dev/hdc1 and /dev/hdc2 to "fd" for raid-autostart. .:: cinderella.pro ::.

Using the failed-disk parameter, create a raidtab for the desired RAID1 configuration. The failed disk must be the last entry in the table.

# example raidtab
# md0 is the root array
raiddev                 /dev/md0
raid-level              1
nr-raid-disks           2
chunk-size              32
# Spare disks for hot reconstruction
nr-spare-disks          0
persistent-superblock   1
device                  /dev/hdc2
raid-disk               0
# this is our old disk, mark as failed for now
device                  /dev/hda2
failed-disk             1

# md1 is the /boot array
raiddev                 /dev/md1
raid-level              1
nr-raid-disks           2
chunk-size              32
# Spare disks for hot reconstruction
nr-spare-disks          0
persistent-superblock   1
device                  /dev/hdc1
raid-disk               0
# boot is marked failed as well
device                  /dev/hda1
failed-disk               1

4.3 Create, format, and configure RAID

Create the md devices with the commands:

    mkraid /dev/md0
    mkraid /dev/md1

The raid devices should be created and start. Examination of /proc/mdstat should show the raid personalities in the kernel and the raid devices running. .:: podcasts.apple.com ::.

Format the boot and root devices with:

    mke2fs /dev/md0
    mke2fs /dev/md1
Mount the new root device somewhere handy and create the /boot directory and mount the boot partition. [Issues with HAProxy]
    mount /dev/md0 /mnt
    mkdir /mnt/boot
    mount /dev/md1 /mnt/boot

4.4 Copy the current OS to the new raid device

This is pretty straightforward.

    cd /
    # set up a batch file to do this
    cp -a /bin /mnt
    cp -a /dev /mnt
    cp -a /etc /mnt
    cp -a (all directories except /mnt, /proc, and nsf mounts) /mnt
This operation can be tricky if you have mounted or linked other disks to your root file system. The example above assumes a very simple system, you may have to modify the procedure somewhat.

4.5 Test your new RAID

Make a boot floppy and rdev the kernel.

    dd if=kernal.image of=/dev/fd0 bs=2k
    rdev /dev/fd0 /dev/md0
    rdev -r /dev/fd0 0
    rdev -R /dev/fd0 1

Modify the fstab on the RAID device to reflect the new mount points as follows:

  /dev/md0        /       ext2    defaults        1 1
  /dev/md1        /boot   ext2    defaults        1 1

Dismount the raid devices and boot the new file system to see that all works correctly.

    umount /mnt/boot
    umount /mnt
    raidstop /dev/md0
    raidstop /dev/md1
    shutdown -r now

Your RAID system should now be up and running in degraded mode with a floppy boot disk. Carefully check that you transferred everything to the new raid system. If you mess up here without a backup, YOU ARE DEAD!

If something did not work, reboot your old system and go back and fix things up until you successfully complete this step. .:: www.redsea.gov.eg ::.

4.6 Integrate old disk into raid array

Success in the previous step means that the raid array is now operational, but without redundancy. We must now re-partition the old drive(s) to fit into the new raid array. Remember that if the geometries are not the same, the the partition size on the old drive must be the same or larger than the raid partitions or they can not be added to the raid set.

Re-partition the old drive as required. Example:

    /dev/hda1     same or larger than /dev/hdc1
    /dev/hda2     same or larger than /dev/hdc2
    /dev/hda3     anything left over for swap or whatever...

Change the failed-disk parameter in the raidtab to raid-disk and hot add the new (old) disk partitions to the raid array.

    raidhotadd /dev/md1 /dev/hda1
    raidhotadd /dev/md0 /dev/hda2
Examining /proc/mdstat should show one or more of the raid devices reconstructing the data for the new partitions. After a minute or two... or so, the raid arrays should be fully synchronized (this could take a while for a large partition).

Using the procedure described in the first sections of this document, set up bootable raid on the new raid pair. Hang on to that boot floppy while setting up and testing this last step.


Next Previous Contents

Share or Research:

Share on FB Post to X LinkedIn 🤖 Ask AI about this