linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Checking if RAID does work?
       [not found] <20050117010355.GH347@unthought.net>
@ 2005-01-19 19:51 ` Poonam Dalya
  2005-01-19 20:19   ` Peter T. Breuer
  2005-01-19 20:59   ` Guy
  0 siblings, 2 replies; 10+ messages in thread
From: Poonam Dalya @ 2005-01-19 19:51 UTC (permalink / raw)
  To: linux-raid


Respected Sir,
              Sir, I would like to check if my data is
actually being written on the RAID disks of RAID0
array. I tried to check by doing the following
steps...
I mounted my /dev/md1 on /mnt/raid. and then wrote a
file on it. Then I tried to mount the raid disks
/dev/hda10 on some other mount point and checked that
mount point. But there was nothing in that mount
point. Please could you please help me with this.
       Sir I tried the same steps with a RAID1 array
and showed the files which I wrote on the md mount
point.
        Hoping for your reply.Thanking you in
anticipation.

Regards,
Poonam



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Checking if RAID does work?
  2005-01-19 19:51 ` Checking if RAID does work? Poonam Dalya
@ 2005-01-19 20:19   ` Peter T. Breuer
  2005-01-19 21:17     ` maarten
  2005-01-19 20:59   ` Guy
  1 sibling, 1 reply; 10+ messages in thread
From: Peter T. Breuer @ 2005-01-19 20:19 UTC (permalink / raw)
  To: linux-raid

Poonam Dalya <poonamsbox@yahoo.com> wrote:
> I mounted my /dev/md1 on /mnt/raid. and then wrote a
> file on it. Then I tried to mount the raid disks
> /dev/hda10 on some other mount point and checked that
> mount point. But there was nothing in that mount
> point. Please could you please help me with this.

Don't do that then. Do you have any reason to suppose that buffers were
already written to the top level system yet, or that mounting the same
device twice will caus eanything but pain and confusion and much
wailing and gnashing of teeth?

>        Sir I tried the same steps with a RAID1 array

Don't.

>         Hoping for your reply.Thanking you in

Try a test that has actually got some sense to it and will not destroy
your data! Such as faulting one device out of the raid. Then you have
to be reading from the other one, no?

Peter


^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Checking if RAID does work?
  2005-01-19 19:51 ` Checking if RAID does work? Poonam Dalya
  2005-01-19 20:19   ` Peter T. Breuer
@ 2005-01-19 20:59   ` Guy
  1 sibling, 0 replies; 10+ messages in thread
From: Guy @ 2005-01-19 20:59 UTC (permalink / raw)
  To: poonamsbox, linux-raid

You need to go to RAID school!  :)
No problem, so did everyone else at one time.

RAID0 does not create a backup copy of your data.  It just uses 2 or more
disks, giving you 2 or more times the space of a single disk.  If any 1 disk
were to fail in a RAID0 array, your data would be virtually gone.  RAID0
tends to also improve read and write performance.

RAID1 makes copies of your data on each disk.  Normally 2 disks are used,
both would have a full copy of your data.  The usable space would be the
same as a single disk regardless of the number of disks used.  But each
would have a full copy.  RAID1 tends to also improve read performance in a
multi tasking environment.  But write performance stays about the same,
unless you have a data bottleneck somewhere.

With RAID0, mounting a single disk is useless.  Don't waste your time.

With RAID1, you should not attempt to mount a disk directly, unless you are
recovering from an abnormal failure.  Doing so could cause your array to be
out of sync, and md would not know it has occurred.  A normal failure would
allow you to have normal access to your data, just using 1 less disk,
without user intervention.

I hope this helps!

Guy

-----Original Message-----
From: linux-raid-owner@vger.kernel.org
[mailto:linux-raid-owner@vger.kernel.org] On Behalf Of Poonam Dalya
Sent: Wednesday, January 19, 2005 2:52 PM
To: linux-raid@vger.kernel.org
Subject: Checking if RAID does work?


Respected Sir,
              Sir, I would like to check if my data is
actually being written on the RAID disks of RAID0
array. I tried to check by doing the following
steps...
I mounted my /dev/md1 on /mnt/raid. and then wrote a
file on it. Then I tried to mount the raid disks
/dev/hda10 on some other mount point and checked that
mount point. But there was nothing in that mount
point. Please could you please help me with this.
       Sir I tried the same steps with a RAID1 array
and showed the files which I wrote on the md mount
point.
        Hoping for your reply.Thanking you in
anticipation.

Regards,
Poonam



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Checking if RAID does work?
  2005-01-19 20:19   ` Peter T. Breuer
@ 2005-01-19 21:17     ` maarten
  2005-01-19 21:22       ` Måns Rullgård
  2005-01-19 21:24       ` Peter T. Breuer
  0 siblings, 2 replies; 10+ messages in thread
From: maarten @ 2005-01-19 21:17 UTC (permalink / raw)
  To: linux-raid

On Wednesday 19 January 2005 21:19, Peter T. Breuer wrote:
> Poonam Dalya <poonamsbox@yahoo.com> wrote:
> > I mounted my /dev/md1 on /mnt/raid. and then wrote a
> > file on it. Then I tried to mount the raid disks
> > /dev/hda10 on some other mount point and checked that
> > mount point. But there was nothing in that mount
> > point. Please could you please help me with this.

You did not forget to format / mkfs it I suppose ?

> Don't do that then. Do you have any reason to suppose that buffers were
> already written to the top level system yet, or that mounting the same
> device twice will caus eanything but pain and confusion and much
> wailing and gnashing of teeth?

Sigh.

> >        Sir I tried the same steps with a RAID1 array
>
> Don't.

Peter, peter peter.  You start again with nonsense and misinformation ?
Of course a disk from a raid-1 volume when mounted alone should have all the 
files accessible that the array has.  If it doesn't, the system is broken.  
Simple as that.

To the OP: Yes, every part of a raid-1 array (but only a raid-1 array) will / 
should be mountable and have the same filesystem as the array has.
HOWEVER you should never ever mount the array AT THE SAME TIME as one of its 
underlying devices!  Always umount first, and only then mount the other.

Maarten

-- 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Checking if RAID does work?
  2005-01-19 21:17     ` maarten
@ 2005-01-19 21:22       ` Måns Rullgård
  2005-01-19 21:59         ` maarten
  2005-01-19 21:24       ` Peter T. Breuer
  1 sibling, 1 reply; 10+ messages in thread
From: Måns Rullgård @ 2005-01-19 21:22 UTC (permalink / raw)
  To: linux-raid

maarten <maarten@ultratux.net> writes:

> To the OP: Yes, every part of a raid-1 array (but only a raid-1
> array) will / should be mountable and have the same filesystem as
> the array has.  HOWEVER you should never ever mount the array AT THE
> SAME TIME as one of its underlying devices!  Always umount first,
> and only then mount the other.

Furthermore, never ever mount a raid-1 component alone in read-write
mode.  Modifying the mirrors individually will almost certainly result
in breakage when the array is activated again.

-- 
Måns Rullgård
mru@inprovide.com

-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Checking if RAID does work?
  2005-01-19 21:17     ` maarten
  2005-01-19 21:22       ` Måns Rullgård
@ 2005-01-19 21:24       ` Peter T. Breuer
  2005-01-19 21:47         ` maarten
  1 sibling, 1 reply; 10+ messages in thread
From: Peter T. Breuer @ 2005-01-19 21:24 UTC (permalink / raw)
  To: linux-raid

maarten <maarten@ultratux.net> wrote:
> On Wednesday 19 January 2005 21:19, Peter T. Breuer wrote:
> > Poonam Dalya <poonamsbox@yahoo.com> wrote:
> > > I mounted my /dev/md1 on /mnt/raid. and then wrote a
> > > file on it. Then I tried to mount the raid disks
> > > /dev/hda10 on some other mount point and checked that
> > > mount point. But there was nothing in that mount
> > > point. Please could you please help me with this.
> 
> You did not forget to format / mkfs it I suppose ?
> 
> > Don't do that then. Do you have any reason to suppose that buffers were
> > already written to the top level system yet, or that mounting the same
> > device twice will caus eanything but pain and confusion and much
> > wailing and gnashing of teeth?
> 
> Sigh.

You don't understand - he mounted the raw partitions that make up the
raid array WHILE THE RAID WAS RUNNING somewhere else.

If the mount had failed he would have said. Therefore it did not fail.
If he had unmounted the raid array first, then the umount would have
flushed buffers to that device (the kernel sends flush_buffers or
whatever it is called nowadays) and the file would have been visible
when he did the later mount.

It was not, therefore he did not.



Peter


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Checking if RAID does work?
  2005-01-19 21:24       ` Peter T. Breuer
@ 2005-01-19 21:47         ` maarten
  0 siblings, 0 replies; 10+ messages in thread
From: maarten @ 2005-01-19 21:47 UTC (permalink / raw)
  To: linux-raid

On Wednesday 19 January 2005 22:24, Peter T. Breuer wrote:
> maarten <maarten@ultratux.net> wrote:
> > On Wednesday 19 January 2005 21:19, Peter T. Breuer wrote:
> > > Poonam Dalya <poonamsbox@yahoo.com> wrote:

> > Sigh.
>
> You don't understand - he mounted the raw partitions that make up the
> raid array WHILE THE RAID WAS RUNNING somewhere else.

In that case, okay.

> If the mount had failed he would have said. Therefore it did not fail.
> If he had unmounted the raid array first, then the umount would have
> flushed buffers to that device (the kernel sends flush_buffers or
> whatever it is called nowadays) and the file would have been visible
> when he did the later mount.

I tried to reproduce it, and it is even more serious than that, upon first 
glance.  So you're right.  Witness below:

dozer:~ # df
/dev/md0               1953344   1758636    194708  91% /

dozer:~ # cat /proc/mdstat
md0 : active raid1 hde1[1]
      1953408 blocks [3/1] [_U_]

dozer:~ # mount -o ro /dev/hde1 /mnt/
dozer:~ # df
/dev/md0               1953344   1758640    194704  91% /
/dev/hde1              1953344   1758636    194708  91% /mnt

dozer:~ # touch /foobar

dozer:~ # ls -l /mnt/foobar
/bin/ls: /mnt/foobar: No such file or directory

dozer:~ # sync

dozer:~ # ls -l /mnt/foobar
/bin/ls: /mnt/foobar: No such file or directory

dozer:~ # umount /mnt/
dozer:~ # mount -o ro /dev/hde1 /mnt/
dozer:~ # ls -l /mnt/foobar
/bin/ls: /mnt/foobar: No such file or directory

dozer:~ # ls -l /foobar
-rw-r--r--    1 root     root            0 Jan 19 22:33 /foobar

Strange, eh ? (obviously I can't umount /dev/md0 to see...)

Maarten

-- 


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Checking if RAID does work?
  2005-01-19 21:22       ` Måns Rullgård
@ 2005-01-19 21:59         ` maarten
  2005-01-19 22:52           ` Måns Rullgård
  0 siblings, 1 reply; 10+ messages in thread
From: maarten @ 2005-01-19 21:59 UTC (permalink / raw)
  To: linux-raid

On Wednesday 19 January 2005 22:22, Måns Rullgård wrote:
> maarten <maarten@ultratux.net> writes:
> > To the OP: Yes, every part of a raid-1 array (but only a raid-1
> > array) will / should be mountable and have the same filesystem as
> > the array has.  HOWEVER you should never ever mount the array AT THE
> > SAME TIME as one of its underlying devices!  Always umount first,
> > and only then mount the other.
>
> Furthermore, never ever mount a raid-1 component alone in read-write
> mode.  Modifying the mirrors individually will almost certainly result
> in breakage when the array is activated again.

Speaking from personal experience, I _think_ that modifying a drive that's 
part of an array gets noticed by md (somehow).  At least it always lead to a 
mirror breakage with me, and thus a re-add and a resync was in order.

I'm not sure if it really does that, and neither how it is done, but I'm led 
to believe it does get noticed. Maybe md (or the kernel?) writes a marker 
just before deactivation which signifies "drive was shutdown @..." ?

OTOH, I've also seen that I just modified /etc/fstab on hda1 to reflect that 
not /de/hda1 was root, but /dev/md0 instead, only to find that after a 
reboot /dev/md0 is _indeed_ now mounted as root, but that those recent 
changes in /fstab are gone.  So... maybe I'm just losing my head. (-:

Maarten

-- 

-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Checking if RAID does work?
  2005-01-19 21:59         ` maarten
@ 2005-01-19 22:52           ` Måns Rullgård
  2005-01-20  0:05             ` Neil Brown
  0 siblings, 1 reply; 10+ messages in thread
From: Måns Rullgård @ 2005-01-19 22:52 UTC (permalink / raw)
  To: linux-raid

maarten <maarten@ultratux.net> writes:

> On Wednesday 19 January 2005 22:22, Måns Rullgård wrote:
>> maarten <maarten@ultratux.net> writes:
>> > To the OP: Yes, every part of a raid-1 array (but only a raid-1
>> > array) will / should be mountable and have the same filesystem as
>> > the array has.  HOWEVER you should never ever mount the array AT THE
>> > SAME TIME as one of its underlying devices!  Always umount first,
>> > and only then mount the other.
>>
>> Furthermore, never ever mount a raid-1 component alone in read-write
>> mode.  Modifying the mirrors individually will almost certainly result
>> in breakage when the array is activated again.
>
> Speaking from personal experience, I _think_ that modifying a drive that's 
> part of an array gets noticed by md (somehow).  At least it always lead to a 
> mirror breakage with me, and thus a re-add and a resync was in order.
>
> I'm not sure if it really does that, and neither how it is done, but I'm led 
> to believe it does get noticed. Maybe md (or the kernel?) writes a marker 
> just before deactivation which signifies "drive was shutdown @..." ?

If the array is stopped, and then the disks tampered with, there is no
way md is noticing it.  It's possible, however, that md will notice if
a disk is accessed directly while the array is active.

-- 
Måns Rullgård
mru@inprovide.com

-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Checking if RAID does work?
  2005-01-19 22:52           ` Måns Rullgård
@ 2005-01-20  0:05             ` Neil Brown
  0 siblings, 0 replies; 10+ messages in thread
From: Neil Brown @ 2005-01-20  0:05 UTC (permalink / raw)
  To: Måns Rullgård; +Cc: linux-raid

On Wednesday January 19, mru@inprovide.com wrote:
> 
> If the array is stopped, and then the disks tampered with, there is no
> way md is noticing it.  It's possible, however, that md will notice if
> a disk is accessed directly while the array is active.
> 

While theoretically possible, md doesn't notice this.
The closest it comes is in 2.6 where a component drive cannot be
mounted while it is active in an md array (EBUSY).

NeilBrown


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-01-20  0:05 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20050117010355.GH347@unthought.net>
2005-01-19 19:51 ` Checking if RAID does work? Poonam Dalya
2005-01-19 20:19   ` Peter T. Breuer
2005-01-19 21:17     ` maarten
2005-01-19 21:22       ` Måns Rullgård
2005-01-19 21:59         ` maarten
2005-01-19 22:52           ` Måns Rullgård
2005-01-20  0:05             ` Neil Brown
2005-01-19 21:24       ` Peter T. Breuer
2005-01-19 21:47         ` maarten
2005-01-19 20:59   ` Guy

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