At 10:34 04.08.99 -0400, you wrote:
>I'd like to know for my own selfish reasons, as I'd love to mirror
>working filesystems (some even on s/w raid already) with raid1 when
>the drives finally ship to me, but I can't wait for that to use them,
>and doing the necessary backup/restore when the drives come in would be
>a painful (and long) procedure at best.
Well... There are a few things to consider:
Main problem is the raid superblock; it occupies the last 4k(?) of the
partition; it MUST NOT be within the space used by the ext2fs file system.
So, if you want to convert an existing filesystem to raid you somehow have
to get the ext2fs off these last few sectors. Currently I know of two ways
to do this:
a) shrink the ext2fs; see http://www.dsv.nl/~buytenh/ext2resize/ on how to
do that. WARNING: risky business, backup his highly recommended..
b) create raid device on new disk and create a new ext2fs on the raid
device, then copy your data to the new filesystem.
Both solutions require the use of the failed-disk statement in your raidtab
file, which allows you to specify which disk in a mirror to actually use
and which to leave out as "failed".
For a): you'll need to unmount the filesystem to convert, so it's rescue
floppy time if you want to convert root.
1) shrink ext2fs
2) create raidtab with the NEW disk as FAILED and the ORIGINAL disk
containing the data as active.
3) mkraid. this will write a raid superblock into the space freed by
shrinking the ext2fs. it won't change anything but the raid superblock.
4) now you can mount and access the raid device containing your original data
5) raidhotadd the new disk. Don't forget to update your fstab to mount the
raid device instead of the original partition.
For b)
1) Create raidtab with NEW disk as active and ORIGINAL disk as FAILED
2) mkraid. this writes the superblock to the NEW disk; it leaves the
original one completely untouched.
3) mke2fs /dev/mdxx. Create new ext2fs on the raid device
4) mount the new raid on /mnt/whatnot, copy the contents of the old
partition to the new one. I generally use cp -a, there's lots of other
solutions using tar, cpio and other programs around.
5) change fstab; either just unmount/remount or reboot to get the raid
devices mounted instead of the original disks
6) check if everything works OK on the new raid device - your original
partition shouldn't be used anywhere now. in case of problems, you can
still revert to your original config.
7) raidhotadd the original disk to theraid array.
Hope this helps,
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