1823077 Members
3411 Online
109645 Solutions
New Discussion юеВ

Software Raid in Linux

 
Admin32
Advisor

Software Raid in Linux

Greetings everyone,

I would like to implement a raid system on one of my Linux servers and would like to clarify a few things.

I read a few manuals online about software raid and they have left me with the impression that in order to create a raid 1 (mirror or duplex) you are required to erase the data on the partition you wish to include in the raid, setup the raid system and then restore the data.

Is this true ?

I am using Redhat v8 and if you happen to have some tips or any great website that I can read through, it would be appreciated.

Thanking you all in advanced.
10 REPLIES 10
Christoph Rothe_3
Frequent Advisor

Re: Software Raid in Linux

Hi,

yes thats true. You have to change the partition type and if you initialize the raid a header will be written onto the partition which erases a part of the data.

You will have to format (mkreiserfs, mkext2 or whatever) and restore your data.

Christoph
Christoph Rothe_3
Frequent Advisor

Re: Software Raid in Linux

Kjartan Maraas
Valued Contributor

Re: Software Raid in Linux

I think you are right that creating a raid set is a destructive action. The filesystem is created after the raid set is initialised so you can't "transfer" an existing filesystem onto the RAID-set. I guess the same is true for a first time setup with LVM, but there are advantages with LVM that makes it easier the next time you need to shuffle partitions around. Read more at http://tldp.org/HOWTO/LVM-HOWTO/index.html

HTH.
Jarle Bjorgeengen
Trusted Contributor

Re: Software Raid in Linux

although Linux LVM doesn't contain mirroring yet. (As it does in hp-ux if you pay for it)

Use md devices (linux software raid) to build up the LVM volumegroups in order to get both.

Yes, it is a destructive action to make a raid . All data (or at least metadata) will be lost on partitions you use with raid devices. Make a backup before restore on the filesystem you craete on top of the md devices.

Rgds Jarle

Jarle Bjorgeengen
Trusted Contributor

Re: Software Raid in Linux

Sorry , small typo.

=======
Make a backup before restore on the filesystem you craete on top of the md devices.
=======

should be
=======
Make a backup before creation of raid device. Restore on the filesystem you create on top of the md devices.
=======
Admin32
Advisor

Re: Software Raid in Linux

So from what I understand, there is no way of creating a RAID 1 for the system partition of a server after you have installed it - which is a bummer, cause on a live production server, this means you can't do much without reinstalling the whole darn thing !

Jerome Henry
Honored Contributor

Re: Software Raid in Linux

Yes,
you got it. Linux is still not HP-UX as far as efficiency is concerned. System is considered to be installed with or without raid, 'cause if you have 2 HD, then you put raid, and if you re-install andother hd thenafter, then you'll have to turn the thing off anyway (so it's not your production server anymore !)...
I'm dreaming of a partition magic like tool that would allow to resize partitions like fsadm, but it doesn't exist yet...
What you have to o now is turn it off, of forget about raid... :-((
J
You can lean only on what resists you...
Jarle Bjorgeengen
Trusted Contributor

Re: Software Raid in Linux

Well,

all you need is to buy some new disks to put your raid on, make the raid, and copy across your operating system files.

You probably have to fiddle around a bit with modules.conf/initrd(md driver...) , disk device names, grub/lilo, but you then you can do all this while still being able to fall back on your old working boot disk.

I think your favorite Linux consultant would be happy to do it for you.

I have done it with ordinary harddisks, wgen transitioning from ext2 to reiserfs on my OS-filesystems. Just need to get the MBR , bootloader and fstab right. (Tip: use chroot to work on your mounted environment after copying across all files)

Rgds Jarle

Gianluca Cecchi
Advisor

Re: Software Raid in Linux

You can also check at

http://www.tldp.org/HOWTO/mini/Boot+Root+Raid+LILO.html

especially at chapter 4 for a possible implementation, also mantaining old disk and trying the new configuration, before wiping it out.
HIH

Gianluca Cecchi
The Penguin is one step ahead...
Ralf Puchner
Honored Contributor

Re: Software Raid in Linux

There is no automation tool to convert a non-raid to a raid partition. But you can install Linux on a raid partition (see Suse or Redhat).
Using softraid on boot and data partitions works like a charme if using the install option.

Btw. if installing a production machine requires a "plan" and not to install what you see along the road. ;-)
Help() { FirstReadManual(urgently); Go_to_it;; }