linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Stopping and starting a RAID1 :Invalid argument
@ 2006-10-08 10:05 Ian Brown
  2006-10-08 10:46 ` Gordon Henderson
  0 siblings, 1 reply; 7+ messages in thread
From: Ian Brown @ 2006-10-08 10:05 UTC (permalink / raw)
  To: linux-raid

Hello,

I am trying to understand and practice RAID1 functionality: for that
purpose I created two partitions on the same device (yes,
I know that it is recommended that the partitions are
better to be on differrent devices when using RAID1, but this
is for testing purposes only ).
My device is a 64 K USB Disk On Key. (on /dev/sdb)

Than I ran:
dd if=/dev/zero of=/dev/sdb bs=1M count=64

then I created 2 primary partitions for RAID1 with fdisk:
/dev/sdb1 and /dev/sdb2.

fdisk -l /dev/sdb shows :

Disk /dev/sdb: 65 MB, 65470464 bytes
3 heads, 42 sectors/track, 1014 cylinders
Units = cylinders of 126 * 512 = 64512 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         256       16107   fd  Linux raid autodetect
/dev/sdb2             257         513       16191   fd  Linux raid autodetect

Both Partitions are of type  Linux raid autodetect ("fd").
The partitions are equal in size (256 cylinders each)
Then I created a RAID1 by running:

mdadm --create /dev/md0 --level=raid1 --raid-devices=2 /dev/sdb1 /dev/sdb2

I got : mdadm: array /dev/md0 started

cat /proc/mdstat shows:

Personalities : [raid1]
md0 : active raid1 sdb2[1] sdb1[0]
      16000 blocks [2/2] [UU]
      [==>..................]  resync = 12.5% (2112/16000)
finish=0.7min speed=301K/sec
unused devices: <none>

I created ext3 fs on /dev/md0 and /dev/sdb1 and /dev/sdb2.

I found out that I can mount /dev/md0 , but I cannot
mount /dev/sdb1 or /dev/sdb2.

when I try : mount /dev/sdb1 /mnt/sdb1/
I get mount: /dev/sdb1 already mounted or /mnt/sdb1/ busy


I found out that if I stop the RAID (and unmount /dev/md0),
I am able to mount /dev/sdb1 and /dev/sdb2. I also found
out that a file I created (on the path where /mnt/md0
was mounted) was mirrored to /dev/sdb1 and /dev/sdb2, as it should
in RAID1.

The problem is that I cannot run again the RAID
after stopping it.

I stopped it by:
mdadm --stop /dev/md0
cat /proc/mdstat
Personalities : [raid1]
unused devices: <none>

I tried to run it again by:
mdadm --run /dev/md0
mdadm: failed to run array /dev/md0: Invalid argument

Why is it so ?

what is the way to stop and than run again a RAID ?
Am I doing something wrong ? any idea?

Regards,

Ian

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

end of thread, other threads:[~2006-10-11 13:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-08 10:05 Stopping and starting a RAID1 :Invalid argument Ian Brown
2006-10-08 10:46 ` Gordon Henderson
2006-10-08 13:08   ` Ian Brown
2006-10-08 13:27     ` Jim Buttafuoco
2006-10-09  7:40       ` Ian Brown
2006-10-10  2:01         ` Neil Brown
2006-10-11 13:00           ` Ian Brown

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