Gentoo Archives: gentoo-user

From: Jeff Cranmer <jeff@××××××××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] How to get raid
Date: Sun, 08 Jan 2012 20:03:54
Message-Id: 1326053001.4443.19.camel@laptop.limeyworld
In Reply to: Re: [gentoo-user] How to get raid by Paul Hartman
1 On Sun, 2012-01-08 at 12:31 -0600, Paul Hartman wrote:
2 > >
3 > > What is going on here?
4 >
5 > (I didn't read this whole thread, sorry if I'm repeating someone else's
6 > advice)
7 >
8 > kernel autodetection only works on old superblock version 0.90, you're
9 > using 1.2. Not a big deal, we use mdadm to do it.
10 >
11 > Define your arrays in /etc/mdadm.conf and start /etc/init.d/mdadm in
12 > your boot runscripts with "rc-update add mdadm boot", it will bring up
13 > the array at boot time.
14 >
15 > In my mdadm.conf i have a line like this:
16 >
17 > ARRAY /dev/md1 metadata=1.01 name=black:1
18 > UUID=8e653e72:9d5df6ba:bb66ea8b:02f1c317
19 >
20 > (might be word-wrapped, should be all one line)
21 >
22 > That's all that was needed to bring it up automatically at boot time.
23 >
24 > Also AFAIR there was a "gotcha" about the hostname stored in the array's
25 > metadata must match your machine's hostname or else mdadm auto-assemble
26 > won't accept it (to protect you in case you're plugging disks from
27 > another machine for recovery, you don't want it to use them as your main
28 > drives), so in that case you must specify it explicitly or set the AUTO
29 > parameter in mdadm.conf to accept this condition. If you created the
30 > array from within a LiveCD or on another machine, the hostname might not
31 > match your system.
32 >
33 > See the mdadm manpage for more info.
34
35 mdadm was added to the default level, not boot.
36 My /etc/mdadm.conf file has two active lines
37 DEVICE /dev/sd[bcd]1
38 ARRAY dev/md0 metadata=1.2 spares=1 name=office-desktop:0
39 devices=/dev/sdb1,dev/sdc1,/dev/sdd1
40
41 It looks like I'm having trouble with a faulty /dev/sdc1, so what I'd
42 like to do is wipe out the existing array and try starting a RAID1 array
43 just with sdb1 and sdd1.
44
45 I got rid of the old array by using the commands
46 mdadm --manage --fail /dev/md0
47 mdadm --manage --stop /dev/md0
48
49 I then used mdadm --verbose --create /dev/md0 --level=1
50 --raid-devices=2 /dev/sdb1 /dev/sdd1
51
52 The result of this command was
53 dadm: /dev/sdb1 appears to be part of a raid array:
54 level=raid5 devices=3 ctime=Sat Jan 7 08:16:00 2012
55 mdadm: partition table exists on /dev/sdb1 but will be lost or
56 meaningless after creating array
57 mdadm: Note: this array has metadata at the start and
58 may not be suitable as a boot device. If you plan to
59 store '/boot' on this device please ensure that
60 your boot-loader understands md/v1.x metadata, or use
61 --metadata=0.90
62 mdadm: /dev/sdd1 appears to be part of a raid array:
63 level=raid5 devices=3 ctime=Sat Jan 7 08:16:00 2012
64 mdadm: size set to 1465136400K
65 Continue creating array? y
66 mdadm: Defaulting to version 1.2 metadata
67 mdadm: array /dev/md0 started.
68
69 The results of cat /proc/mdstat are
70 Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5]
71 [raid4] [multipath]
72 md0 : active raid1 sdd1[1] sdb1[0]
73 1465136400 blocks super 1.2 [2/2] [UU]
74 [>....................] resync = 2.1% (31838144/1465136400)
75 finish=269.7min speed=88551K/sec
76
77 unused devices: <none>
78
79 Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5]
80 [raid4] [multipath]
81 md0 : active raid1 sdd1[1] sdb1[0]
82 1465136400 blocks super 1.2 [2/2] [UU]
83 [>....................] resync = 2.1% (31838144/1465136400)
84 finish=269.7min speed=88551K/sec
85
86 unused devices: <none>
87
88 The results of mdadm --detail /dev/md0 are
89 /dev/md0:
90 Version : 1.2
91 Creation Time : Sun Jan 8 14:47:43 2012
92 Raid Level : raid1
93 Array Size : 1465136400 (1397.26 GiB 1500.30 GB)
94 Used Dev Size : 1465136400 (1397.26 GiB 1500.30 GB)
95 Raid Devices : 2
96 Total Devices : 2
97 Persistence : Superblock is persistent
98
99 Update Time : Sun Jan 8 14:48:54 2012
100 State : active, resyncing
101 Active Devices : 2
102 Working Devices : 2
103 Failed Devices : 0
104 Spare Devices : 0
105
106 Rebuild Status : 2% complete
107
108 Name : office-desktop:0 (local to host office-desktop)
109 UUID : bfc16c6e:4e8cb910:96ff7ed2:6fec32bc
110 Events : 1
111
112 Number Major Minor RaidDevice State
113 0 8 17 0 active sync /dev/sdb1
114 1 8 49 1 active sync /dev/sdd1
115
116 When I try to mount this drive, however, I get
117 mount: /dev/md0: can't read superblock
118
119 What do I need to do to complete the process?
120
121 Thanks
122
123 Jeff

Replies

Subject Author
Re: [gentoo-user] How to get raid Jeff Cranmer <jeff@××××××××××××××.com>