Skip to contentSkip to conversation

O'Reilly RAID Book

DISCUSSION Ninti Systems 4 participants 7 messages Mar 30, 2004 MD RAID

lore
Share & tools
lore
#0 lore raw

I'm interested in list members opinion on the O'Reilly book 'Managing RAID on Linux' by Derek Vadala published in December 2002.

I'm wondering how up to date the book remains, and if a new edition is perhaps just around the corner (I hate buying a book two weeks before an updated edition is released!).

I'm almost exclusively interested in RAID1. Would that render 80% of the text irrelevant?

I've moved to Slackware 9.1 from RedHat 9. Slackware doesn't have any nifty tools to set up RAID during install, so I presume I need to do lots of command line work after install. Does the book mainly take a basic tools approach (mkraid, mdadm) that would allow me to build RAID1 arrays out of "thin air" on the command line, or are there a lot of vendor-specific GUI screenshots (I know O'Reilly tends to avoid that sort of thing).

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.

If I can collect the info I need, assimilate it, and make it work, I am more than happy to write up a Slackware RAID1 mini-Howto. I think such a document is sorely needed for Slackers.

Thanks for any advice.
Mick

#1 lore raw
Quoted 2 lines · Ninti Systems

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...

[...]

Quoted 2 lines

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.

[...]

Quoted 4 lines

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

Signature · 3 lines
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
#2 lore raw
Quoted 6 lines · Daniel Pittman

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:

you can do it the other way around with less copying -- using resize2fs to shrink your main filesystem enough to fit the raid superblock at the end of the partition. then use mdadm to create a degraded array containing your main partition ... then futz partition tables/etc. on the second disk, and hotadd it.

i'm being deliberately vague because it's the sort of thing you want to understand well enough that this vague description is all the hints you need :)

the main difficulty is knowing how much to shrink... this would actually be a useful addition to mdadm. but you can't go wrong just shrinking by 128MB or such then grow after turning it into a raid.

-dean

#3 lore raw
In reply to Daniel Pittman

Daniel, fantastic post-install RAID1 summary, great basis for a mini HOW-TO.
When I get it done, can I credit you with getting me started (along with the SOFTWARE RAID HOWTO and mdadm docs)? Also, would this list be a suitable place to post a URL to a draft of the mini HOWTO for comment/correction?

#4 lore raw
Quoted 3 lines · Ninti Systems

Daniel, fantastic post-install RAID1 summary, great basis for a mini HOW-TO. When I get it done, can I credit you with getting me started (along with the SOFTWARE RAID HOWTO and mdadm docs)?

Thanks. I am happy to have credit given; this address is suitable for listing. :)

Quoted 2 lines

Also, would this list be a suitable place to post a URL to a draft of the mini HOWTO for comment/correction?

Probably; the Linux Documentation project may also want to know about it after you have it ready.

Daniel

Signature · 3 lines
Television is the ideal propaganda medium, a mendacious monster, not primarily
out of malice but from its amoral nature.
        -- Paul Johnson
#5 lore raw
In reply to Ninti Systems
Quoted 3 lines

I'm wondering how up to date the book remains, and if a new edition is perhaps just around the corner (I hate buying a book two weeks before an updated edition is released!).

The book was released in December of 2002. It's relevance really depends on what you're looking for. It covers RAID-1, obviously, but the book is RedHat-centric, especially on this topic (installation to RAID), and so your Slackware 9.1 question isn't addressed in it.

I'm surprised to learn that Slackware 9.1 doesn't have decent install-time support for RAID-1.

As far as updated editions: Unfortunately it is extremely unlikely that O'Reilly will do a second edition of MROL. This is too bad as I personally feel there is a much room for updates, improvement and expanded material, possibily including LVM and EVMS coverage. However, sales figures just don't warrant a new edition, and I doubt very much that they will be compelled to move forward with this title.

At the end of this year (once the book has been out for two years), I'll ask them to consider licensing the material so that groups like LDP can create deriviate works. I've already pledged it to the Creative Commons, Founder's Copyright
(http://creativecommons.org/projects/founderscopyright/oreilly), so it will eventually be available, regardless.

Derek

#6 lore raw
Quoted 3 lines · Derek Vadala

I'm surprised to learn that Slackware 9.1 doesn't have decent install-time support for RAID-1.

I'm no Slackware expert, but there are certainly no options to set up RAID during install that I can see. I believe I have seen this confirmed elsewhere. There could easily be support in some form or other that I don't know about, however.

OTOH, I'm now forced to learn how to use the Linux tools (raidtools, mdadm) which is what I really want, and which Slackware is supposedly all about.

That's good (going public domain) and bad (no edition 2) news about 'Managing RAID on Linux'. I don't know about sales, but the topic itself seems pretty important to me.