From: Daniel Pittman <daniel@rimspace.net>
To: linux-raid@vger.kernel.org
Subject: Re: O'Reilly RAID Book
Date: Tue, 30 Mar 2004 11:20:43 +1000 [thread overview]
Message-ID: <87wu53yvtg.fsf@enki.rimspace.net> (raw)
In-Reply-To: 1080605251.1695.14.camel@localhost
On 30 Mar 2004, Ninti Systems wrote:
> I'm interested in list members opinion on the O'Reilly book 'Managing
> RAID on Linux' by Derek Vadala published in December 2002.
I can't comment on the book, but...
[...]
> I'm almost exclusively interested in RAID1. Would that render 80% of
> the text irrelevant?
...if you are looking at software RAID1, then it probably does.
[...]
> Finally, if anyone could point me to any resources (apart from the
> Software RAID Howto) dealing with building RAID1 arrays on a
> Slackware-type box after the system is already fully installed, that'd
> be great.
I have done this a number of times, and the process of migrating from
single disk to RAID1 (for root) is (presume root on /dev/hda1):
1. Buy and install the second disk.
Make sure you partition it to the desired sizes, and set all
partitions to type 'fd', 'RAID autodiscovery'.
2. Use mdadm to create the RAID1 in "degraded" mode, using only the
second disk. eg:
] mdadm --create --level=1 --raid-devices=2 --spare-devices=0 \
/dev/md1 missing /dev/hdc1
Season that invocation to taste, WRT the number of RAID and spare
devices. The 'missing' statement takes the place of the current
single drive.
3. Make your filesystem on the degraded RAID1. eg:
] mke2fs -j /dev/md1
4. Create some useful mountpoints:
] mkdir /mnt/from /mnt/to
5. Reboot to "running bugger all" mode; add 'init=/bin/sh' to your
kernel command line.
6. Mount your root and the MD device:
] mount /dev/hda1 /mnt/from -o ro
] mount /dev/md1 /mnt/to -o rw
7. Transfer the data across:
] (cd /mnt/from; tar clp .) | (cd /mnt/to; tar xp)
8. Edit /mnt/to/etc/fstab, and /mnt/to/etc/lilo.conf if needed, to
reflect the new 'root on /dev/md1' state. Run lilo if needed...
9. Unmount:
] umount /mnt/from
] umount /mnt/to
10. Sync carefully, since you will be doing an unclean reboot after this:
] sync; sync; sync; sleep 30; sync
11. Power-cycle the machine.
12. Log in, with root now on /dev/md1, and check that it all worked.
13. Once you are happy, add the old drive to the array. This is the
point at which you can no longer back out, so be *sure* you are
ready to do it...
] mdadm /dev/md1 -a /dev/hda1
14. Watch /proc/mdstat to see when your resync is complete.
15. Check that all your partitions are type 'fd', for auto-discovery to
work. Probably you need to change the previous root disk.
For anything that isn't your root partition, you can omit the boot with
'init=/bin/bash' stage, and just unmount the source partition in single
user mode.
Daniel
--
The greatest humiliation in life, is to work hard on something from which you
expect great appreciation, and then fail to get it.
-- Edgar Watson Howe, _Ventures in Common Sense_, 1919
next prev parent reply other threads:[~2004-03-30 1:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-30 0:07 O'Reilly RAID Book Ninti Systems
2004-03-30 1:20 ` Daniel Pittman [this message]
2004-03-30 3:20 ` dean gaudet
2004-03-30 3:32 ` Ninti Systems
2004-03-30 4:28 ` Daniel Pittman
2004-03-30 18:35 ` Derek Vadala
2004-03-30 23:27 ` Ninti Systems
-- strict thread matches above, loose matches on Subject: below --
2004-03-30 0:33 AndyLiebman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wu53yvtg.fsf@enki.rimspace.net \
--to=daniel@rimspace.net \
--cc=linux-raid@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).