Subject: How to turn off raid?
To: None <current-users@netbsd.org>
From: Neil Booth <neil@daikokuya.co.uk>
List: current-users
Date: 11/23/2005 19:37:29
I have a failed experiment with raid 1 left on my wd0 disk.  Raidframe
is not working reliably; I presume it is a driver issue; my machine
frequently locks up.  Without RAID the system has historically been
rock solid.  The instability was apparent in both 2.0.2 and current.

I have left wd1 in failed state:

# raidctl -s -v raid0
Components:
           /dev/wd0a: optimal
           /dev/wd1a: failed
No spares.
Component label for /dev/wd0a:
   Row: 0, Column: 0, Num Rows: 1, Num Columns: 2
   Version: 2, Serial Number: 2005102901, Mod Counter: 299
   Clean: No, Status: 0
   sectPerSU: 128, SUsPerPU: 1, SUsPerRU: 1
   Queue size: 100, blocksize: 512, numBlocks: 156301312
   RAID Level: 1
   Autoconfig: Yes
   Root partition: Yes
   Last configured as: raid0
/dev/wd1a status is: failed.  Skipping label.
Parity status: DIRTY
Reconstruction is 100% complete.
Parity Re-write is 100% complete.
Copyback is 100% complete.

I hoped this would be enough to restore my system to stability,
but alas it is not.  Doing an "svn up" in my GCC repository freezes
the system after a few seconds.  (As I mentioned, before I played
with raid my system never froze under NetBSD).  So I would like to
turn off raid altogether, in the sense of having no raid kernel threads
running at all.

Questions:

a) Will "raidctl -A no raid0" do that?  I'm concerned about rendering
   my system unbootable doing this.  With auto-configure off, will
   my system boot with my filesystems still on raid0a etc?  At
   present raid0 is my boot device; raid0a is root.  The manual
   page is not clear about exactly what the effects of the raid
   device being auto-configured or not are.

b) Will updating wd0's disklabel to point to the file systems currently
   in raid0a-h so they become normal FFS filesystems for wd0-h work?  I
   suspect the only change I would need would be to add the offset of
   raid0 in wd0a to the offsets currently given for raid0a-h?  (this is
   63).  Or is there some additional reserved area in raid0a that RAID
   uses that would make it unusable as wd0a?

c) Anything I need to be careful about?

Help appreciated, thanks.  I give my two disklabels, fstab and dmesg
below.

Neil.

# disklabel /dev/raid0
# /dev/raid0d:
type: RAID
disk: raid
label: fictitious
flags:
bytes/sector: 512
sectors/track: 128
tracks/cylinder: 8
sectors/cylinder: 1024
cylinders: 152638
total sectors: 156301312
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0 

8 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a:   2000000         0     4.2BSD   1024  8192 45456  # (Cyl.      0 -
1953*)
 b:   2000000   2000000       swap                     # (Cyl.   1953*-
3906*)
 d: 156301312         0     unused      0     0        # (Cyl.      0 -
152637)
 e:   1000000   4000000     4.2BSD   1024  8192 45456  # (Cyl.   3906*-
4882*)
 f:   4000000   5000000     4.2BSD   2048 16384 25376  # (Cyl.   4882*-
8789*)
 g:  40000000   9000000     4.2BSD   2048 16384 28808  # (Cyl.   8789*-
47851*)
 h: 107301312  49000000     4.2BSD   2048 16384 28592  # (Cyl.  47851*-
152637)

# disklabel /dev/wd0
# /dev/wd0d:
type: ESDI
disk: ST380011A       
label: fictitious
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 155061
total sectors: 156301488
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0 

5 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 a: 156301425        63       RAID                     # (Cyl.      0*-
155060)
 b:   1000000   2000127       swap                     # (Cyl.   1984*-
2976*)
 c: 156301425        63     unused      0     0        # (Cyl.      0*-
155060)
 d: 156301488         0     unused      0     0        # (Cyl.      0 -
155060)
disklabel: partitions a and b overlap

# cat /etc/fstab
/dev/raid0a / ffs rw,noatime 1 1
/dev/wd0b none swap sw 0 0
/dev/raid0e /tmp ffs rw,noatime,nodev,nosuid 1 1
/dev/raid0f /var ffs rw,noatime,nodev 1 1
/dev/raid0g /home ffs rw,noatime,nodev,nosuid 1 1
/dev/raid0h /usr ffs rw,noatime,nodev 1 1
kernfs /kern kernfs rw
procfs /proc procfs rw,noauto

# dmesg

Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 3.99.11 (GENERIC) #1: Mon Nov 21 23:08:55 JST 2005
	neil@duron.akihabara.co.uk:/usr/obj/usr/src/sys/arch/i386/compile/GENERIC
total memory = 511 MB
avail memory = 494 MB
BIOS32 rev. 0 found at 0xfb210
mainbus0 (root)
cpu0 at mainbus0: (uniprocessor)
cpu0: AMD Duron (686-class), 799.00 MHz, id 0x631
cpu0: features c1c7f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR>
cpu0: features c1c7f9ff<PGE,MCA,CMOV,PAT,PSE36,PN,MMXX,MMX>
cpu0: features c1c7f9ff<FXSR,3DNOW2,3DNOW>
cpu0: "AMD Duron(tm) Processor"
cpu0: I-cache 64 KB 64B/line 2-way, D-cache 64 KB 64B/line 2-way
cpu0: L2 cache 64 KB 64B/line 16-way
cpu0: ITLB 16 4 KB entries fully associative, 8 4 MB entries fully associative
cpu0: DTLB 24 4 KB entries fully associative, 8 4 MB entries 4-way
cpu0: 8 page colors
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pchb0 at pci0 dev 0 function 0
pchb0: VIA Technologies VT8363 (Apollo KT133) Host Bridge (rev. 0x03)
agp0 at pchb0: aperture at 0xe0000000, size 0x10000000
ppb0 at pci0 dev 1 function 0: VIA Technologies VT8363 (Apollo KT133) PCI to AGP Bridge (rev. 0x00)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
vga1 at pci1 dev 0 function 0: ATI Technologies Radeon 9200 (rev. 0x01)
wsdisplay0 at vga1 kbdmux 1: console (80x25, vt100 emulation)
wsmux1: connecting to wsdisplay0
ATI Technologies product 0x5941 (miscellaneous display, revision 0x01) at pci1 dev 0 function 1 not configured
pcib0 at pci0 dev 7 function 0
pcib0: VIA Technologies VT82C686A PCI-ISA Bridge (rev. 0x40)
viaide0 at pci0 dev 7 function 1
viaide0: VIA Technologies VT82C686A (Apollo KX133) ATA100 controller
viaide0: bus-master DMA support present
viaide0: primary channel configured to compatibility mode
viaide0: primary channel interrupting at irq 14
atabus0 at viaide0 channel 0
viaide0: secondary channel configured to compatibility mode
viaide0: secondary channel interrupting at irq 15
atabus1 at viaide0 channel 1
VIA Technologies VT82C686A SMBus Controller (miscellaneous bridge, revision 0x40) at pci0 dev 7 function 4 not configured
ahc1 at pci0 dev 11 function 0: Adaptec 2940 Ultra SCSI adapter
ahc1: interrupting at irq 10
ahc1: aic7880: Ultra Wide Channel A, SCSI Id=7, 16/253 SCBs
scsibus0 at ahc1: 16 targets, 8 luns per target
tlp0 at pci0 dev 12 function 0: DECchip 21140A Ethernet, pass 2.2
tlp0: interrupting at irq 11
tlp0: Ethernet address 00:90:cc:0f:b4:81
dmphy0 at tlp0 phy 1: DM9101 (AMD Am79C873) 10/100 media interface, rev. 0
dmphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
cmpci0 at pci0 dev 15 function 0: C-Media Electronics CMI8738/C3DX PCI Audio Device (rev. 0x10)
cmpci0: interrupting at irq 10
audio0 at cmpci0: full duplex, mmap, independent
opl at cmpci0 not configured
mpu at cmpci0 not configured
cmdide0 at pci0 dev 16 function 0
cmdide0: CMD Technology PCI0649 (rev. 0x02)
cmdide0: bus-master DMA support present
cmdide0: primary channel configured to native-PCI mode
cmdide0: using irq 11 for native-PCI interrupt
atabus2 at cmdide0 channel 0
cmdide0: secondary channel configured to native-PCI mode
atabus3 at cmdide0 channel 1
isa0 at pcib0
lpt0 at isa0 port 0x378-0x37b irq 7
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com1 at isa0 port 0x2f8-0x2ff irq 3: ns16550a, working fifo
pckbc0 at isa0 port 0x60-0x64
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
attimer0 at isa0 port 0x40-0x43: AT Timer
pcppi0 at isa0 port 0x61
midi0 at pcppi0: PC speaker
sysbeep0 at pcppi0
isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support
npx0 at isa0 port 0xf0-0xff: using exception 16
fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
pcppi0: attached to attimer0
isapnp0: no ISA Plug 'n Play devices found
fd0 at fdc0 drive 0: 1.44MB, 80 cyl, 2 head, 18 sec
Kernelized RAIDframe activated
scsibus0: waiting 2 seconds for devices to settle...
cd0 at scsibus0 target 2 lun 0: <PIONEER, CD-ROM DR-U03S, 1.01> cdrom removable
cd0: sync (100.00ns offset 8), 8-bit (10.000MB/s) transfers
cd1 at scsibus0 target 3 lun 0: <YAMAHA, CRW8824S, 1.00> cdrom removable
cd1: sync (50.00ns offset 15), 8-bit (20.000MB/s) transfers
wd0 at atabus0 drive 0: <ST380011A>
wd0: drive supports 16-sector PIO transfers, LBA48 addressing
wd0: 76319 MB, 155061 cyl, 16 head, 63 sec, 512 bytes/sect x 156301488 sectors
wd0: 32-bit data port
wd0: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
wd0(viaide0:0:0): using PIO mode 4, Ultra-DMA mode 5 (Ultra/100) (using DMA)
wd1 at atabus1 drive 0: <ST380011A>
wd1: drive supports 16-sector PIO transfers, LBA48 addressing
wd1: 76319 MB, 155061 cyl, 16 head, 63 sec, 512 bytes/sect x 156301488 sectors
wd1: 32-bit data port
wd1: drive supports PIO mode 4, DMA mode 2, Ultra-DMA mode 5 (Ultra/100)
wd1(viaide0:1:0): using PIO mode 4, Ultra-DMA mode 5 (Ultra/100) (using DMA)
raid0: RAID Level 1
raid0: Components: /dev/wd0a /dev/wd1a[**FAILED**]
raid0: Total Sectors: 156301312 (76319 MB)
boot device: raid0
root on raid0a dumps on raid0b
root file system type: ffs
wsdisplay0: screen 1 added (80x25, vt100 emulation)
wsdisplay0: screen 2 added (80x25, vt100 emulation)
wsdisplay0: screen 3 added (80x25, vt100 emulation)
wsdisplay0: screen 4 added (80x25, vt100 emulation)
raid0: Error re-writing parity!