Checking if RAID does work?
A message that is not in the archive (sent off-list or not yet received): [email protected]
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
Quoted 5 lines · Poonam Dalya
I mounted my
/dev/md1on/mnt/raid. and then wrote a file on it. Then I tried to mount the raid disks/dev/hda10on 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?
Quoted 1 line
Sir I tried the same steps with a RAID1 array
Don't.
Quoted 1 line
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
Quoted 6 lines · Peter T. Breuer
Quoted 5 lines · Poonam Dalya
I mounted my
/dev/md1on/mnt/raid. and then wrote a file on it. Then I tried to mount the raid disks/dev/hda10on 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 ?
Quoted 4 lines
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.
Quoted 3 lines
Quoted 1 line
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
Quoted 5 lines · maarten
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.
Signature · 7 lines
Måns Rullgård [email protected] - To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 10 lines · Måns Rullgård
Quoted 5 lines · maarten
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
Signature · 4 lines
- To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 12 lines · maarten
Quoted 10 lines · Måns Rullgård
Quoted 5 lines · maarten
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.
Quoted 7 lines
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.
Signature · 7 lines
Måns Rullgård [email protected] - To unsubscribe from this list: send the line "unsubscribe linux-raid" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 5 lines · On Wednesday January 19, [email protected] 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
Quoted 8 lines · maarten
Quoted 6 lines · Peter T. Breuer
Quoted 5 lines · Poonam Dalya
I mounted my
/dev/md1on/mnt/raid. and then wrote a file on it. Then I tried to mount the raid disks/dev/hda10on 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.
Quoted 8 lines
You did not forget to format / mkfs it I suppose ?
Quoted 4 lines
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
Quoted 8 lines · Peter T. Breuer
Quoted 4 lines · maarten
Quoted 1 line · Peter T. Breuer
Poonam Dalya <[email protected]> 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.
Quoted 5 lines
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_buffersor 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
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: [email protected] [mailto:[email protected]] On Behalf Of Poonam Dalya
Sent: Wednesday, January 19, 2005 2:52 PM
To: [email protected]
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html