Differences between version 6 and predecessor to the previous major change of RaidNotes.
Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 6 | Last edited on Tuesday, May 5, 2009 9:38:31 pm | by JohnMcPherson | Revert |
Older page: | version 5 | Last edited on Tuesday, October 18, 2005 10:45:17 pm | by CraigBox | Revert |
@@ -1,12 +1,37 @@
-Yeah, well, it was easy enough to get RAID working. Sort of. Here's the compressed notes; they'll be opaquish if you don't have some experience with Linux, but these are the 350 words I wish I'd read before starting. It might have taken me a minute to read and saved me about an hour.
+!! mdadm: _device_ is too small: 0K
+<verbatim>
+mdadm: /dev/sda3 is too small: 0K
+mdadm: create aborted
+</verbatim>
-http://www.linuxhomenetworking.com/linux-adv/raid.htm gave me
the basics: cfdisk
/dev/hdb and
/dev/hde to one big partition of type 'FD', copy a sample config from /usr/share/doc/raidtools* into /etc/raidtab and edit it, mkraid /dev/md0, look at /proc/mdstat to make sure RAID was active, mkfs /dev/md0, go eat dinner, remember raidstart and raidstop commands for future reference, put /dev/md0 in /etc/fstab, and mount -a. Now I had RAID. But it was resyncing very slowly! After bringing up the RAID for
the first time
, it
will spend a few hours resyncing, which will throw off disk transfer rate measurements; you can umount
/dev/md0 and use raidstop to stop it and look at /proc/mdstat.
+Check that
the /dev/sda3 special file is actually correct. If you inadvertantly screw up your mdadm command (eg giving
/dev/sda3 as
the first non-option argument)
, then mdadm
will quite happily replace your
/dev/sda3 special with an md special:
-hdparm
-i showed me that one of the disks was in mdma2 mode
, which was painfully slow (as shown by hdparm
-t after a raidstop.) Also a little inspection showed that I did actually have a third IDE channel (praise be unto server
-class motherboards). hdparm
-d
1 -X udma2
/dev/hdc
(it was hdc after I moved it to the new channel
) helped a lot.
+<verbatim>
+# ls
-ld /dev/sda*
+brw-rw---- 1 root disk 8
, 0 2009-05-05 18:20 /dev/sda
+brw-rw-
--- 1 root disk 8, 1 2009-05
-05 19:14
/dev/sda1
+brw-rw---- 1 root disk 8, 2 2009-05-05 19:19 /dev/sda2
+brw-r--r-- 1 root root 9, 0 2009-05-05 20:06 /dev/sda3
+</verbatim>
+To fix
(obviously replacing "sda3" with whatever device you are actually having problems with
):
+<verbatim>
+# rm /dev/sda3
+# mknod /dev/sda3 b 8 3
+</verbatim>
-''Very painful lesson'': make sure
you set AUTOSTART="true" in /etc/default/raid2 on Debian-like systems
, at least if
you want your RAID
to be mounted at boot time. (Otherwise maybe use noauto in /etc/fstab.) Also you might want to make sure /etc/init.d/raid2 is linked into
the appropriate S28 slot in /etc/rcS.d (
and maybe K51
in /etc/rc6.d and /etc/rc0.d? Dunno if that matters
.)
+!!Migrating an existing partition to raid1
+You can create a raid1 that is initially degraded; once all the data is on it and
you are running from that
, then
you can add more devices
to the raid1
and it will "rebuild" it
in the background
.
-80
-pin IDE cables have smaller wires than floppy
-disk cables, and are less prone to noise; they should be used with higher UDMA modes to reduce the risk of data corruption. udma2 is 30MB
/sec and is all I can get safely on my machine; higher rates lose data.
+Eg:
+<verbatim>
+# mdadm
--create
/dev/md0 --raid-devices=2 --level=raid1 /dev/sdb1 missing
+ size=296696452K mtime=Tue May 5 19:29:00 2009
+ mdadm: array /dev/md0 started.
+# (mkfs.xxx /dev/md0)
+# (mount and cp stuff from sda1 to /dev/md0)
+# ... (once sda1 is no longer in use, and the same size)
+# mdadm --add /dev/md0 /dev/sda1
+</verbatim>
----
CategoryDiskNotes