📄 raidreconf-howto
字号:
Raidreconf HOWTOBy Daniel S. Cox dcox at connex.comVersion 0.1 11-Apr-2001This HOWTO provides a concrete example of converting a Software RAID-5three disk array to a four disk array.------------------------------------------------------------------------Table of Contents1. Introduction 1.1 What is this HOWTO? 1.2 What are we trying to do? 1.3 Who should be reading this document?2. Requirements 2.1 Minimum System Requirements 2.2 Hardware configuration 2.2 Obtaining the Raidreconf package 2.3 Backup is a must3. Running Raidreconf 3.1 Create the new raidtab 3.2 Stop the RAID array! 3.3 Run raidreconf 3.4 Copy the new raidtab to /etc4. Ending 4.1 Copyright 4.2 Feedback 4.3 Disclaimer------------------------------------------------------------------------1. Introduction1.1. What is this HOWTO?This HOWTO describes the detailed steps needed to convert a Software RAID-5array consisting of three IDE disks to one consisting of four IDE disks.1.2. What are we trying to do?Most likely, the current three disk system has run out of space, and wewish to add more. We will accomplish this without a protracted copy-out,convert, and copy-in sequence. Raidreconf can convert in-place.1.3. Who should be reading this document?The system administrator for the system in question. If you are the soleuser of the system, that means you! There is a minimum level of expertiserequired, such as adding the physical hard drive, connecting itproperly, issuing commands from the shell, and editing text files.------------------------------------------------------------------------2. Requirements2.1. Minimum System RequirementsSince we're talking about raidREconf, you must already be running SoftwareRAID, and it therefore must already be configured into the kernel, sothat's not a concern. If you're using an IDE system, adding a forth drivewill leave no open slot for the CDROM, unless a new IDE interface card ispurchased, or the CDROM is SCSI.2.2. Hardware configurationShutdown the computer, and power it off. Install the new hard drive,button it up, and power it on. Review the boot messages (perhaps in/var/log/boot.log), and make sure the kernel recognizes the new drive.I'll assume here that there are already three IDE drives present, "hda","hdb", and "hdc". I'll further assume that the new drive is "hdd", for simplicity. As a final assumption, each drive has four partitions, andpartition 4 of each drive is comprises the RAID array.2.2. Obtaining the Raidreconf packageThe raidreconf software is available from http://oss.connex.com. Followthe instructions found there to download the package.2.3. Backup is a mustUnless you don't consider the data important, you should make a backup ofyour current RAID array now.------------------------------------------------------------------------3. Running Raidreconf3.1. Create the new raidtabCreate a working directory, and 'cd' to it: mkdir work; cd workCopy "/etc/raidtab" to oldraidtab: cp /etc/raidtab oldraidtabCopy "oldraidtab" to "newraidtab", and edit it: cp oldraidtab newraidtab vi newraidtabAn example "oldraidtab" looks like this:===============================================raiddev /dev/md0 raid-level 5 nr-raid-disks 3 nr-spare-disks 0 persistent-superblock 1 parity-algorithm left-symmetric chunk-size 128 device /dev/hda4 raid-disk 0 device /dev/hdb4 raid-disk 1 device /dev/hdc4 raid-disk 2===============================================An example "newraidtab" looks like this:===============================================raiddev /dev/md0 raid-level 5 nr-raid-disks 4 nr-spare-disks 0 persistent-superblock 1 parity-algorithm left-symmetric chunk-size 128 device /dev/hda4 raid-disk 0 device /dev/hdb4 raid-disk 1 device /dev/hdc4 raid-disk 2 device /dev/hdd4 raid-disk 3===============================================Where there may be many "stanzas" in /etc/raidtab, describing multiplearrays, both old and new raidtabs need only contain the array we'rechanging. It doesn't hurt to have others listed, but I prefer the falsesecurity of only mentioning the array I'm working with.In particular, note the "nr-raid-disks" in each.3.2. Stop the RAID array!To stop the RAID array, run the command (as root): raidstop /dev/md0If you don't do this, raidreconf will refuse to run.3.3. Run raidreconfRaidreconf is invoked by root as: raidreconf -o oldraidtab -n newraidtab -m /dev/md0The arguments are what you expect: "-o oldraidtab", the "current"configuration; "-n newraidtab", the new configuration; and "-m /dev/md0",the device that matches the "raiddev" parameter in both raidtab files.Raidreconf will display an ASCII art "progress bar", and attempt toestimate how much longer the conversion will take. As a ball-park figure,converting a 80 GB three disk array to a 120 GB array using Western DigitalIDE drives, and a Celeron 560 MHz processor with 64MB of RAM took aboutfive hours, not counting the time the kernel took to recompute the parityblocks.When raidreconf finishes, it will restart the array itself. The kernelwill begin the parity block reconstruction. You can "cat /etc/mdstat" tosee it's progress. However, you can immediately begin using the array.3.4. Copy the new raidtab to /etcUpdate "/etc/raidtab" with the new configuration for this array.4. Ending4.1. CopyrightCopyright 2001 Daniel S. Cox4.2. FeedbackIf you have comments or need further information, please contact the authordcox at connex.com.4.3. DisclaimerThis information is provided "as is". The author believes this document to be correct, but assumes no responsibility for any damage resulting from it's use.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -