Linux LVM users
 help / color / mirror / Atom feed
From: Graham Wood <clvm@spam.dragonhold.org>
To: ashwin chaugule <ashwin.chaugule@gmail.com>,
	LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] Re: raid 1 on a single disk
Date: Sat, 13 Nov 2004 21:13:24 +0000	[thread overview]
Message-ID: <20041113211324.GA13108@dragonhold.org> (raw)
In-Reply-To: <89af10f90411130241e20e2c2@mail.gmail.com>

On Sat, Nov 13, 2004 at 04:11:08PM +0530, ashwin chaugule wrote:
> yes i know its silly ... im doing what im told to do :p
>
> ok so, i also do know, its performance is going to suck !
> but i was under the impression that RAID 1 works on more that one disks only.
>
> so you mean to say that, the linux RAID / md tools support raid 1 on
> multiple partitiions of the same disk ?
>
> Regards,
> Ashwin
>
>

As people have already said, the software really doesn't care.

Here's a really sick/pointless example to prove it:

dd if=/dev/zero of=/var/tmp/fake1 bs=1M count=16
dd if=/dev/zero of=/var/tmp/fake2 bs=1M count=16
dd if=/dev/zero of=/var/tmp/fake3 bs=1M count=16
dd if=/dev/zero of=/var/tmp/fake4 bs=1M count=16

losetup /dev/loop1 /var/tmp/fake1
losetup /dev/loop2 /var/tmp/fake2
losetup /dev/loop3 /var/tmp/fake3
losetup /dev/loop4 /var/tmp/fake4

mdadm --create -l 5 /dev/md10 -n 4 /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4

cat /proc/mdstat

md10 : active raid5 loop4[4] loop3[2] loop2[1] loop1[0]
      48960 blocks level 5, 64k chunk, algorithm 2 [4/3] [UUU_]
      [================>....]  recovery = 81.2% (14080/16320) finish=0.0min speed=1083K/sec

raidstop -c /dev/null /dev/md10

mdadm --create -l mirror  /dev/md10 -n 4 /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4

cat /proc/mdstat

md10 : active raid1 loop4[3] loop3[2] loop2[1] loop1[0]
      16320 blocks [4/4] [UUUU]
      [=============>.......]  resync = 68.7% (12160/16320) finish=0.0min speed=1105K/sec


What this has done is created a 48MB (roughly) raid5 set based on 4 16MB files in /var/tmp.  Obviously this won't be recreated automatically on a reboot (since it's done using files), but it's to show what you can do if you are feeling sick enough.  I've then created it as a mirror to show that works too.

Your command (to setup the mirror) will be something like:

mdadm --create -l mirror -n 4 /dev/hdd1 /dev/hdd2 /dev/hdd3 /dev/hdd4

And since thoswe are real disk partitions, if you set them to type "fd" in fdisk, they will be re-attached on a reboot.

Graham

P.S. I'd be really tempted to talk to the person asking you to do this, and ask them what they hope to achieve...

  parent reply	other threads:[~2004-11-13 21:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-13 10:17 [linux-lvm] raid 1 on a single disk ashwin chaugule
2004-11-13 10:33 ` [linux-lvm] " Peter T. Breuer
2004-11-13 10:41   ` ashwin chaugule
2004-11-13 11:03     ` Piete Brooks
2004-11-13 12:59     ` Peter T. Breuer
2004-11-13 13:38       ` Piete Brooks
2004-11-13 15:04         ` Peter T. Breuer
2004-11-13 13:38       ` ashwin chaugule
2004-11-13 21:13     ` Graham Wood [this message]
2004-11-13 22:00       ` Greg Freemyer
2004-11-14  0:41         ` Måns Rullgård
2004-11-14  5:44         ` ashwin chaugule
2004-11-14 11:28           ` Peter T. Breuer
2004-11-14 17:41             ` ashwin chaugule
2004-11-14 18:04               ` Peter T. Breuer
2004-11-14 19:02                 ` ashwin chaugule
2004-11-14 21:01                   ` Peter T. Breuer
2004-11-15  6:09                     ` ashwin chaugule

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=20041113211324.GA13108@dragonhold.org \
    --to=clvm@spam.dragonhold.org \
    --cc=ashwin.chaugule@gmail.com \
    --cc=linux-lvm@redhat.com \
    /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