Click to See Complete Forum and Search --> : Using RAID 0 and RAID 1


phil_r
09-05-2003, 02:26 PM
Hi guys.
Is it possible, using either RAID 0 or RAID 1, to only stripe/mirror an individual partition rather than an entire disc?

For example, my HDA is an 80Gb. But some of that space is taken up with XP, /boot and / . /Usr and /home use about a 60Gb partition. I've got a spare 60Gb drive and I'd like to strip /usr and /home, but everything I've read indicates you can only do the complete disc.

Can anyone clear this up?

Thanks!
Phil.

freakmn
09-05-2003, 02:40 PM
It is possible, but I have never done it, nor do I know how. However, I know that someone, using the distro I use (www.sourcemage.org) has done it. His method is explained here (http://wiki.sourcemage.org/index.php?page=HOWTO-Software+RAID). Some or all of this may not apply, but it may be a step in the right direction.

EDIT: This is software RAID, which is slower than hardware RAID, but more flexible in that it doesn't require 2 complete hard drives. It also does not require a RAID controller. For info pertaining to your distro, search for "software RAID in (insert distro name and version here)."

tecknophreak
09-05-2003, 02:40 PM
Sure enough. I've heard people actually striping to two different partitions on the same disk. :)

Just tell Linux where you want. Actually, from the howto, they show it using partitions from two different scsi disks for raid1. Software Raid howto (http://www.tldp.org/HOWTO/Software-RAID-HOWTO-4.html#ss4.4)

raiddev /dev/md0
raid-level 1
nr-raid-disks 2
nr-spare-disks 0
chunk-size 4
persistent-superblock 1
device /dev/sdb6
raid-disk 0
device /dev/sdc5
raid-disk 1

There ya go, you can do the same for raid0 I believe.

Modorf
09-05-2003, 02:54 PM
I'm assuming your wanting to setup a software RAID.
To configure a software RAID you configure it with device partions. So in theory you can set up the system with multiple partions on the same drive.

/dev/hda - 80gig
/dev/hab - 60gig

/dev/hda1 - / - 20gig
/dev/hda2 } /home/ - 60gig - RAID 0+1
/dev/hdb1 }

you would want something like this for your /etc/raidtab

raiddev /dev/md0
raid-level 10
nr-raid-disks 2
# persistent-superblock 0
persistent-superblock 1
chunk-size 4

device /dev/hda2
raid-disk 0
device /dev/hdb1
raid-disk 1

Modorf
09-05-2003, 03:01 PM
http://www.fokus.gmd.de/linux/dlhp/aktuell/DE-Software-RAID-HOWTO-8.html#ss8.8

result from babelfish.altavista.com -- sorry about the formatting.

8,8 Raid-10 (Mirroring & Striping) the combination of Raid-1 and Raid-0 group can be very flexibly used, is however with caution to be enjoyed. One must pay attention here exactly to it, which RA ID partitions into which RA ID group to be built to be supposed. In order to be able to ensure however the necessary redundancy, for this at least four RA ID partitions on different non removable disks are necessary. As example we provide two Raid-0 of groups over in each case two different RA ID partitions, which are to be reflected afterwards by Raid-1. A suitable/etc/raidtab without saving disks would look then in such a way: raiddev/dev/md0 raid level 0 NR-raid-disks 2 NR saving disks 0 persistent superblock 1 chunk size 4 DEVICE/dev/sda6 raid disk 0 DEVICES/dev/sdb6 raid disk 1 raiddev/dev/md1 raid level 0 NR-raid-disks 2 NR saving disks 0 persistent superblock 1 chunk size 4 DEVICE/dev/sdc6 raid disk 0 DEVICES/dev/sdd6 raid disk 1 raiddev/dev/md2 raid level 1 NR-raid-disks 2 NR saving disks 0 persistent superblock 1 chunk size 4 DEVICE/dev/md0 raid disk 0 DEVICES/dev/md1 raid disk 1 Now it applies to consider however a few little things, because differently than at the other RA ID groups we provided here equivalent three RA ID arrays, whereby one must consider oneself, which is to be gemountet now afterwards at all and described with data. The sequence results from the file/etc/raidtab./dev/md0 more nacher on/dev/md1 is reflected. Each DEVICE must be provided for itself: mkraid f/dev/mdx A file system by mke2fs is provided to dev/md1 only on/dev/md0 and/. The best sequence is to provide only the DEVICE/dev/md0 to format and to mounten. Then/dev/md1 is provided and formatted. This please did not mounten, since no data are to be written here drauf. Becomes last now by means of mkraid f/dev/md2 the Raid-1 array provides, however one should really provide no file system here. From now on one can by means of cat/proc/mdstat the synchronisation of the two Raid-0 of groups/dev/md0 and/dev/md1 pursue. If the synchronisation is final, all data, which are written on/dev/md0, are reflected on/dev/md1. Is activated, gemountet and into the file/etc/fstab registered recently only/dev/md0. Naturally one would know also/dev/md1 mounten, however one should decide for a DEVICE. Impossible is however the Mounten of/dev/md2.

Choozo
09-05-2003, 05:15 PM
Originally posted by tecknophreak
Sure enough. I've heard people actually striping to two different partitions on the same disk. :) Hmmm ... the reasoning behind doing something like that totally escapes me ....
Wouldn't that seriously degrade performance, as the disk read/write heads would have to constantly jump back and forth to read/write the striped chunks of every file on that partition?

Cheers :)

tecknophreak
09-05-2003, 07:33 PM
Yup, some people aren't too bright. :) Of course the best way to set this up is to use two different disks on two different cables.