At 14:58 15.06.99 -0400, Aaron Bush wrote:
>0) Make a complete backup in case I fry the thing.!
>1) halt the box and disconnect power from sdb.
>2) boot the box and modify /etc/fstab to use /dev/md[x] where needed.
>3) halt the box and re-connect the power to sdb.
>4) boot the box again, this time it will use the new /etc/fstab to mount
>/dev/md[x].

Yep this would work.

>What will prevent the /dev/sdb from being used in the RAID reconstruction
>after this reboot?  Will the superblocks be different and cause the RAID to
>stay in degraded mode?

Exactly, you'll have different event counters in the raid superblock and so
raid will stay in degraded mode.

>5) use raidhotadd (where is a man page for this found??) to add my sdb to
>the raid.
>6) All should be ok now?

IF you had set up your filesystems correctly in the first place, yes. As
you didn't - No.

>> Another question: after you created your raid devices, did you create new
>> ext2 filesystems on /dev/mdx?
>
>No.

The raid device is a bit smaller that the raw partitions since the last few
k of the raw partition are used to hold the raid superblock. Since you're
using a filesystem created on the raw device, the raid superblock is INSIDE
the data aerea. This means, that during normal use sooner or later the raid
superblock on the disks will be destroyed (happens when file data is placed
in the area used by the raid superblock).

You must either shrink the ext2fs to exclude the area used by the raid
superblock (I believe partitionmagic can do this - haven't done it myself
though) or create a new ext2fs on the raid device (wich will erase all the
data on the raid device!).

Converting existing filesystems to raid is made easier by the failed-disk
patch to raidtools+kernel, you can get it from 

ftp://ftp.sime.com/pub/linux/raid-failed-disk.tar.gz

micro-howto:

for raid levels 1/4/5 you can replace one of the "raid-disk" entries in
/etc/raidtab with "failed-disk". The device specified for failed-disk is
not touched when creating the raid device; in fact, it doesn't have to
exist at all - you could use /dev/foobar.

* create raid device in degraded mode using mkraid, set your sda partitions
to be failed-disk. This lets you have the original partitions on sda at the
same time as the raid devices using sdb.

* mke2fs on the raid devices

* copy your existing files over to the new raid device (cp -a works for me,
see list archives for other methods using tar/cpio)

* modify the new fstab, reboot mounting the /dev/mdx devices

* after you're using the new raid device, raidhotadd the original disk to
the array. raidhotadd isn't yet in the man pages, syntax is easy:
raidhotadd /dev/mdx /dev/sdax. 

* things to remember after you've finished moving to the new raid device:
Update your raidtab file (replace failed-disk with raid-disk) and change
partition type of original partition to fd.

Yet another question: are you trying to put your root filesystem on raid as
well? if yes: you're in for yet more problems:

Lilo can't use boot files (kernel image, boot message file, map file..) on
a raid device - you must have these file in a non-raid partition. Possibly
you can instead use another bootloader (grub) - it's been said that this
program can deal with bootfiles on raid, I've not yet seen a success report
on this however.

Finally, I think it would be a good idea for you to have a look at the list
archives, for example at http://www.kernelnotes.org/lnxlists/linux-raid/

Bye, Martin

"you have moved your mouse, please reboot to make this change take effect"
--------------------------------------------------
 Martin Bene               vox: +43-664-3251047
 simon media               fax: +43-316-813824-6
 Andreas-Hofer-Platz 9     e-mail: [EMAIL PROTECTED]
 8010 Graz, Austria        
--------------------------------------------------
finger [EMAIL PROTECTED] for PGP public key

Reply via email to