| 5 | |
| 6 | = make RAID5 disk 5 -> 7 = |
| 7 | == original devices == |
| 8 | * mitty@raid5:~$ sudo fdisk -lu /dev/sd? |
| 9 | {{{ |
| 10 | (snip) |
| 11 | Device Boot Start End Blocks Id System |
| 12 | /dev/sdb1 63 2097215 1048576+ fd Linux raid autodetect |
| 13 | (snip) |
| 14 | Device Boot Start End Blocks Id System |
| 15 | /dev/sdc1 63 2097215 1048576+ fd Linux raid autodetect |
| 16 | (snip) |
| 17 | Device Boot Start End Blocks Id System |
| 18 | /dev/sdd1 63 2097215 1048576+ fd Linux raid autodetect |
| 19 | (snip) |
| 20 | Device Boot Start End Blocks Id System |
| 21 | /dev/sde1 63 2097215 1048576+ fd Linux raid autodetect |
| 22 | (snip) |
| 23 | Device Boot Start End Blocks Id System |
| 24 | /dev/sdf1 63 2097215 1048576+ fd Linux raid autodetect |
| 25 | }}} |
| 26 | |
| 27 | == create /dev/md0 with 5 disks == |
| 28 | * mitty@raid5:~$ sudo mdadm --create /dev/md0 -n5 -l 5 /dev/sd[bcdef]1 |
| 29 | |
| 30 | * mitty@raid5:~$ cat /proc/mdstat |
| 31 | {{{ |
| 32 | Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] |
| 33 | md0 : active raid5 sdf1[4] sde1[3] sdd1[2] sdc1[1] sdb1[0] |
| 34 | 4194048 blocks level 5, 64k chunk, algorithm 2 [5/5] [UUUUU] |
| 35 | |
| 36 | unused devices: <none> |
| 37 | }}} |
| 38 | * mitty@raid5:~$ sudo mdadm -D /dev/md0 |
| 39 | {{{ |
| 40 | /dev/md0: |
| 41 | Version : 00.90 |
| 42 | Creation Time : Sat Jun 4 20:48:11 2011 |
| 43 | Raid Level : raid5 |
| 44 | Array Size : 4194048 (4.00 GiB 4.29 GB) |
| 45 | Used Dev Size : 1048512 (1024.11 MiB 1073.68 MB) |
| 46 | Raid Devices : 5 |
| 47 | Total Devices : 5 |
| 48 | Preferred Minor : 0 |
| 49 | Persistence : Superblock is persistent |
| 50 | |
| 51 | Update Time : Sat Jun 4 20:48:30 2011 |
| 52 | State : clean |
| 53 | Active Devices : 5 |
| 54 | Working Devices : 5 |
| 55 | Failed Devices : 0 |
| 56 | Spare Devices : 0 |
| 57 | |
| 58 | Layout : left-symmetric |
| 59 | Chunk Size : 64K |
| 60 | |
| 61 | UUID : b49fdd73:9af2093f:0dfb77a3:1c88c57c (local to host raid5) |
| 62 | Events : 0.34 |
| 63 | |
| 64 | Number Major Minor RaidDevice State |
| 65 | 0 8 17 0 active sync /dev/sdb1 |
| 66 | 1 8 33 1 active sync /dev/sdc1 |
| 67 | 2 8 49 2 active sync /dev/sdd1 |
| 68 | 3 8 65 3 active sync /dev/sde1 |
| 69 | 4 8 81 4 active sync /dev/sdf1 |
| 70 | }}} |
| 71 | |
| 72 | == add to mdadm.conf == |
| 73 | * mitty@raid5:~$ sudo mdadm -Ds |
| 74 | {{{ |
| 75 | ARRAY /dev/md0 level=raid5 num-devices=5 metadata=00.90 UUID=b49fdd73:9af2093f:0dfb77a3:1c88c57c |
| 76 | }}} |
| 77 | * mitty@raid5:~$ sudo sh -c "mdadm -Ds >> /etc/mdadm/mdadm.conf" |
| 78 | |
| 79 | == mkfs and mount == |
| 80 | * mitty@raid5:~$ sudo mkfs.xfs /dev/md0 |
| 81 | * mitty@raid5:~$ sudo blkid /dev/md0 |
| 82 | {{{ |
| 83 | /dev/md0: UUID="15329342-a08c-4658-9b9d-53568eef427d" TYPE="xfs" |
| 84 | }}} |
| 85 | |
| 86 | * mitty@raid5:~$ sudo mkdir /var/raid |
| 87 | * mitty@raid5:~$ sudo mount /dev/md0 /var/raid/ |
| 88 | |
| 89 | * データが壊れないことの検証用データ |
| 90 | * mitty@raid5:~$ sudo dd if=/dev/urandom of=/var/raid/1G bs=1024 count=1048576 |
| 91 | * mitty@raid5:~$ sha1sum -b /var/raid/1G | sudo tee /var/raid/1G.sha1 |
| 92 | {{{ |
| 93 | c3f03a59a865c1aea6455f8838479614e9225f48 */var/raid/1G |
| 94 | }}} |
| 95 | |
| 96 | * mitty@raid5:~$ df -h /var/raid/ |
| 97 | {{{ |
| 98 | Filesystem Size Used Avail Use% Mounted on |
| 99 | /dev/md0 4.0G 1.1G 3.0G 26% /var/raid |
| 100 | }}} |
| 101 | |
| 102 | == attach new 2 disks == |
| 103 | * mitty@raid5:~$ sudo fdisk -lu /dev/sd? |
| 104 | {{{ |
| 105 | (snip) |
| 106 | Device Boot Start End Blocks Id System |
| 107 | /dev/sdb1 63 2097215 1048576+ fd Linux raid autodetect |
| 108 | (snip) |
| 109 | Device Boot Start End Blocks Id System |
| 110 | /dev/sdc1 63 2097215 1048576+ fd Linux raid autodetect |
| 111 | (snip) |
| 112 | Device Boot Start End Blocks Id System |
| 113 | /dev/sdd1 63 2097215 1048576+ fd Linux raid autodetect |
| 114 | (snip) |
| 115 | Device Boot Start End Blocks Id System |
| 116 | /dev/sde1 63 2097215 1048576+ fd Linux raid autodetect |
| 117 | (snip) |
| 118 | Device Boot Start End Blocks Id System |
| 119 | /dev/sdf1 63 2097215 1048576+ fd Linux raid autodetect |
| 120 | (snip) |
| 121 | Device Boot Start End Blocks Id System |
| 122 | /dev/sdg1 63 2097215 1048576+ fd Linux raid autodetect |
| 123 | (snip) |
| 124 | Device Boot Start End Blocks Id System |
| 125 | /dev/sdh1 63 2097215 1048576+ fd Linux raid autodetect |
| 126 | }}} |
| 127 | * mitty@raid5:~$ cat /proc/mdstat |
| 128 | {{{ |
| 129 | Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] |
| 130 | md0 : active raid5 sdc1[1] sdf1[4] sdb1[0] sdd1[2] sde1[3] |
| 131 | 4194048 blocks level 5, 64k chunk, algorithm 2 [5/5] [UUUUU] |
| 132 | |
| 133 | unused devices: <none> |
| 134 | }}} |
| 135 | * mitty@raid5:~$ sudo mdadm -D /dev/md0 |
| 136 | {{{ |
| 137 | mdadm: metadata format 00.90 unknown, ignored. |
| 138 | /dev/md0: |
| 139 | Version : 00.90 |
| 140 | Creation Time : Sat Jun 4 20:48:11 2011 |
| 141 | Raid Level : raid5 |
| 142 | Array Size : 4194048 (4.00 GiB 4.29 GB) |
| 143 | Used Dev Size : 1048512 (1024.11 MiB 1073.68 MB) |
| 144 | Raid Devices : 5 |
| 145 | Total Devices : 5 |
| 146 | Preferred Minor : 0 |
| 147 | Persistence : Superblock is persistent |
| 148 | |
| 149 | Update Time : Sat Jun 4 21:24:55 2011 |
| 150 | State : clean |
| 151 | Active Devices : 5 |
| 152 | Working Devices : 5 |
| 153 | Failed Devices : 0 |
| 154 | Spare Devices : 0 |
| 155 | |
| 156 | Layout : left-symmetric |
| 157 | Chunk Size : 64K |
| 158 | |
| 159 | UUID : b49fdd73:9af2093f:0dfb77a3:1c88c57c (local to host raid5) |
| 160 | Events : 0.40 |
| 161 | |
| 162 | Number Major Minor RaidDevice State |
| 163 | 0 8 17 0 active sync /dev/sdb1 |
| 164 | 1 8 33 1 active sync /dev/sdc1 |
| 165 | 2 8 49 2 active sync /dev/sdd1 |
| 166 | 3 8 65 3 active sync /dev/sde1 |
| 167 | 4 8 81 4 active sync /dev/sdf1 |
| 168 | }}} |
| 169 | |
| 170 | === add 1 of 2 disk2 === |
| 171 | * mitty@raid5:~$ sudo mdadm /dev/md0 -a /dev/sdg1 |
| 172 | {{{ |
| 173 | mdadm: metadata format 00.90 unknown, ignored. |
| 174 | mdadm: added /dev/sdg1 |
| 175 | }}} |
| 176 | * mitty@raid5:~$ cat /proc/mdstat |
| 177 | {{{ |
| 178 | Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] |
| 179 | md0 : active raid5 sdg1[5](S) sdc1[1] sdf1[4] sdb1[0] sdd1[2] sde1[3] |
| 180 | 4194048 blocks level 5, 64k chunk, algorithm 2 [5/5] [UUUUU] |
| 181 | |
| 182 | unused devices: <none> |
| 183 | }}} |
| 184 | * mitty@raid5:~$ sudo mdadm -D /dev/md0 |
| 185 | {{{ |
| 186 | mdadm: metadata format 00.90 unknown, ignored. |
| 187 | /dev/md0: |
| 188 | Version : 00.90 |
| 189 | Creation Time : Sat Jun 4 20:48:11 2011 |
| 190 | Raid Level : raid5 |
| 191 | Array Size : 4194048 (4.00 GiB 4.29 GB) |
| 192 | Used Dev Size : 1048512 (1024.11 MiB 1073.68 MB) |
| 193 | Raid Devices : 5 |
| 194 | Total Devices : 6 |
| 195 | Preferred Minor : 0 |
| 196 | Persistence : Superblock is persistent |
| 197 | |
| 198 | Update Time : Sat Jun 4 21:36:40 2011 |
| 199 | State : clean |
| 200 | Active Devices : 5 |
| 201 | Working Devices : 6 |
| 202 | Failed Devices : 0 |
| 203 | Spare Devices : 1 |
| 204 | |
| 205 | Layout : left-symmetric |
| 206 | Chunk Size : 64K |
| 207 | |
| 208 | UUID : b49fdd73:9af2093f:0dfb77a3:1c88c57c (local to host raid5) |
| 209 | Events : 0.42 |
| 210 | |
| 211 | Number Major Minor RaidDevice State |
| 212 | 0 8 17 0 active sync /dev/sdb1 |
| 213 | 1 8 33 1 active sync /dev/sdc1 |
| 214 | 2 8 49 2 active sync /dev/sdd1 |
| 215 | 3 8 65 3 active sync /dev/sde1 |
| 216 | 4 8 81 4 active sync /dev/sdf1 |
| 217 | |
| 218 | 5 8 97 - spare /dev/sdg1 |
| 219 | }}} |
| 220 | |
| 221 | === add 2 of 2 disks === |
| 222 | * mitty@raid5:~$ sudo mdadm /dev/md0 -a /dev/sdh1 |
| 223 | {{{ |
| 224 | mdadm: metadata format 00.90 unknown, ignored. |
| 225 | mdadm: added /dev/sdh1 |
| 226 | }}} |
| 227 | * mitty@raid5:~$ cat /proc/mdstat |
| 228 | {{{ |
| 229 | Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] |
| 230 | md0 : active raid5 sdh1[5](S) sdg1[6](S) sdc1[1] sdf1[4] sdb1[0] sdd1[2] sde1[3] |
| 231 | 4194048 blocks level 5, 64k chunk, algorithm 2 [5/5] [UUUUU] |
| 232 | |
| 233 | unused devices: <none> |
| 234 | }}} |
| 235 | * mitty@raid5:~$ sudo mdadm -D /dev/md0 |
| 236 | {{{ |
| 237 | mdadm: metadata format 00.90 unknown, ignored. |
| 238 | /dev/md0: |
| 239 | Version : 00.90 |
| 240 | Creation Time : Sat Jun 4 20:48:11 2011 |
| 241 | Raid Level : raid5 |
| 242 | Array Size : 4194048 (4.00 GiB 4.29 GB) |
| 243 | Used Dev Size : 1048512 (1024.11 MiB 1073.68 MB) |
| 244 | Raid Devices : 5 |
| 245 | Total Devices : 7 |
| 246 | Preferred Minor : 0 |
| 247 | Persistence : Superblock is persistent |
| 248 | |
| 249 | Update Time : Sat Jun 4 21:37:28 2011 |
| 250 | State : clean |
| 251 | Active Devices : 5 |
| 252 | Working Devices : 7 |
| 253 | Failed Devices : 0 |
| 254 | Spare Devices : 2 |
| 255 | |
| 256 | Layout : left-symmetric |
| 257 | Chunk Size : 64K |
| 258 | |
| 259 | UUID : b49fdd73:9af2093f:0dfb77a3:1c88c57c (local to host raid5) |
| 260 | Events : 0.44 |
| 261 | |
| 262 | Number Major Minor RaidDevice State |
| 263 | 0 8 17 0 active sync /dev/sdb1 |
| 264 | 1 8 33 1 active sync /dev/sdc1 |
| 265 | 2 8 49 2 active sync /dev/sdd1 |
| 266 | 3 8 65 3 active sync /dev/sde1 |
| 267 | 4 8 81 4 active sync /dev/sdf1 |
| 268 | |
| 269 | 5 8 113 - spare /dev/sdh1 |
| 270 | 6 8 97 - spare /dev/sdg1 |
| 271 | }}} |
| 272 | |
| 273 | == grow array == |
| 274 | === cannot make RAID5 to RAID6 === |
| 275 | * RAID5に後からディスクを追加してRAID6にする機能は(現在は)実装されていない模様 |
| 276 | |
| 277 | * mitty@raid5:~$ sudo mdadm --grow /dev/md0 -l6 -n7 |
| 278 | {{{ |
| 279 | mdadm: metadata format 00.90 unknown, ignored. |
| 280 | mdadm: Need to backup 1280K of critical section.. |
| 281 | mdadm: Cannot set device size/shape for /dev/md0: Invalid argument |
| 282 | }}} |
| 283 | |
| 284 | * mitty@raid5:~$ tail /var/log/kern.log |
| 285 | {{{ |
| 286 | Jun 4 21:55:44 raid5 kernel: [ 1842.255232] md: couldn't update array info. -22 |
| 287 | }}} |
| 288 | * mitty@raid5:~$ man mdadm |
| 289 | {{{ |
| 290 | (snip) |
| 291 | |
| 292 | -l, --level= |
| 293 | (snip) |
| 294 | |
| 295 | Not yet supported with --grow. |
| 296 | }}} |
| 297 | |
| 298 | === RAID5 5 -> 7 disks === |
| 299 | * mitty@raid5:~$ sudo mdadm --grow /dev/md0 -n7 |
| 300 | {{{ |
| 301 | mdadm: metadata format 00.90 unknown, ignored. |
| 302 | mdadm: Need to backup 768K of critical section.. |
| 303 | mdadm: ... critical section passed. |
| 304 | }}} |
| 305 | |
| 306 | * mitty@raid5:~$ cat /proc/mdstat |
| 307 | {{{ |
| 308 | Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] |
| 309 | md0 : active raid5 sdh1[5] sdg1[6] sdc1[1] sdf1[4] sdb1[0] sdd1[2] sde1[3] |
| 310 | 4194048 blocks super 0.91 level 5, 64k chunk, algorithm 2 [7/7] [UUUUUUU] |
| 311 | [>....................] reshape = 0.3% (4160/1048512) finish=25.0min speed=693K/sec |
| 312 | |
| 313 | unused devices: <none> |
| 314 | }}} |
| 315 | * mitty@raid5:~$ sudo mdadm -D /dev/md0 |
| 316 | {{{ |
| 317 | mdadm: metadata format 00.90 unknown, ignored. |
| 318 | /dev/md0: |
| 319 | Version : 00.91 |
| 320 | Creation Time : Sat Jun 4 20:48:11 2011 |
| 321 | Raid Level : raid5 |
| 322 | Array Size : 4194048 (4.00 GiB 4.29 GB) |
| 323 | Used Dev Size : 1048512 (1024.11 MiB 1073.68 MB) |
| 324 | Raid Devices : 7 |
| 325 | Total Devices : 7 |
| 326 | Preferred Minor : 0 |
| 327 | Persistence : Superblock is persistent |
| 328 | |
| 329 | Update Time : Sat Jun 4 21:56:24 2011 |
| 330 | State : clean, recovering |
| 331 | Active Devices : 7 |
| 332 | Working Devices : 7 |
| 333 | Failed Devices : 0 |
| 334 | Spare Devices : 0 |
| 335 | |
| 336 | Layout : left-symmetric |
| 337 | Chunk Size : 64K |
| 338 | |
| 339 | Reshape Status : 2% complete |
| 340 | Delta Devices : 2, (5->7) |
| 341 | |
| 342 | UUID : b49fdd73:9af2093f:0dfb77a3:1c88c57c (local to host raid5) |
| 343 | Events : 0.74 |
| 344 | |
| 345 | Number Major Minor RaidDevice State |
| 346 | 0 8 17 0 active sync /dev/sdb1 |
| 347 | 1 8 33 1 active sync /dev/sdc1 |
| 348 | 2 8 49 2 active sync /dev/sdd1 |
| 349 | 3 8 65 3 active sync /dev/sde1 |
| 350 | 4 8 81 4 active sync /dev/sdf1 |
| 351 | 5 8 113 5 active sync /dev/sdh1 |
| 352 | 6 8 97 6 active sync /dev/sdg1 |
| 353 | }}} |
| 354 | * mitty@raid5:~$ tail /var/log/kern.log |
| 355 | {{{ |
| 356 | Jun 4 21:55:59 raid5 kernel: [ 1857.490635] RAID5 conf printout: |
| 357 | Jun 4 21:55:59 raid5 kernel: [ 1857.490640] --- rd:7 wd:7 |
| 358 | Jun 4 21:55:59 raid5 kernel: [ 1857.490642] disk 0, o:1, dev:sdb1 |
| 359 | Jun 4 21:55:59 raid5 kernel: [ 1857.490644] disk 1, o:1, dev:sdc1 |
| 360 | Jun 4 21:55:59 raid5 kernel: [ 1857.490646] disk 2, o:1, dev:sdd1 |
| 361 | Jun 4 21:55:59 raid5 kernel: [ 1857.490648] disk 3, o:1, dev:sde1 |
| 362 | Jun 4 21:55:59 raid5 kernel: [ 1857.490650] disk 4, o:1, dev:sdf1 |
| 363 | Jun 4 21:55:59 raid5 kernel: [ 1857.490652] disk 5, o:1, dev:sdh1 |
| 364 | Jun 4 21:55:59 raid5 kernel: [ 1857.490665] RAID5 conf printout: |
| 365 | Jun 4 21:55:59 raid5 kernel: [ 1857.490666] --- rd:7 wd:7 |
| 366 | Jun 4 21:55:59 raid5 kernel: [ 1857.490668] disk 0, o:1, dev:sdb1 |
| 367 | Jun 4 21:55:59 raid5 kernel: [ 1857.490670] disk 1, o:1, dev:sdc1 |
| 368 | Jun 4 21:55:59 raid5 kernel: [ 1857.490672] disk 2, o:1, dev:sdd1 |
| 369 | Jun 4 21:55:59 raid5 kernel: [ 1857.490674] disk 3, o:1, dev:sde1 |
| 370 | Jun 4 21:55:59 raid5 kernel: [ 1857.490675] disk 4, o:1, dev:sdf1 |
| 371 | Jun 4 21:55:59 raid5 kernel: [ 1857.490677] disk 5, o:1, dev:sdh1 |
| 372 | Jun 4 21:55:59 raid5 kernel: [ 1857.490679] disk 6, o:1, dev:sdg1 |
| 373 | Jun 4 21:55:59 raid5 kernel: [ 1857.491421] md: reshape of RAID array md0 |
| 374 | Jun 4 21:55:59 raid5 kernel: [ 1857.491428] md: minimum _guaranteed_ speed: 1000 KB/sec/disk. |
| 375 | Jun 4 21:55:59 raid5 kernel: [ 1857.491431] md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for reshape. |
| 376 | Jun 4 21:55:59 raid5 kernel: [ 1857.491443] md: using 128k window, over a total of 1048512 blocks. |
| 377 | }}} |
| 378 | |
| 379 | ==== reshape done ==== |
| 380 | * mitty@raid5:~$ tail /var/log/kern.log |
| 381 | {{{ |
| 382 | Jun 4 22:01:26 raid5 kernel: [ 2184.441331] md: md0: reshape done. |
| 383 | Jun 4 22:01:26 raid5 kernel: [ 2184.448127] RAID5 conf printout: |
| 384 | Jun 4 22:01:26 raid5 kernel: [ 2184.448130] --- rd:7 wd:7 |
| 385 | Jun 4 22:01:26 raid5 kernel: [ 2184.448132] disk 0, o:1, dev:sdb1 |
| 386 | Jun 4 22:01:26 raid5 kernel: [ 2184.448134] disk 1, o:1, dev:sdc1 |
| 387 | Jun 4 22:01:26 raid5 kernel: [ 2184.448136] disk 2, o:1, dev:sdd1 |
| 388 | Jun 4 22:01:26 raid5 kernel: [ 2184.448138] disk 3, o:1, dev:sde1 |
| 389 | Jun 4 22:01:26 raid5 kernel: [ 2184.448140] disk 4, o:1, dev:sdf1 |
| 390 | Jun 4 22:01:26 raid5 kernel: [ 2184.448141] disk 5, o:1, dev:sdh1 |
| 391 | Jun 4 22:01:26 raid5 kernel: [ 2184.448143] disk 6, o:1, dev:sdg1 |
| 392 | Jun 4 22:01:26 raid5 kernel: [ 2184.448154] md0: detected capacity change from 4294705152 to 6442057728 |
| 393 | Jun 4 22:01:26 raid5 kernel: [ 2184.489608] VFS: busy inodes on changed media or resized disk md0 |
| 394 | }}} |
| 395 | * mitty@raid5:~$ cat /proc/mdstat |
| 396 | {{{ |
| 397 | Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] |
| 398 | md0 : active raid5 sdh1[5] sdg1[6] sdc1[1] sdf1[4] sdb1[0] sdd1[2] sde1[3] |
| 399 | 6291072 blocks level 5, 64k chunk, algorithm 2 [7/7] [UUUUUUU] |
| 400 | |
| 401 | unused devices: <none> |
| 402 | }}} |
| 403 | * mitty@raid5:~$ sudo mdadm -D /dev/md0 |
| 404 | {{{ |
| 405 | mdadm: metadata format 00.90 unknown, ignored. |
| 406 | /dev/md0: |
| 407 | Version : 00.90 |
| 408 | Creation Time : Sat Jun 4 20:48:11 2011 |
| 409 | Raid Level : raid5 |
| 410 | Array Size : 6291072 (6.00 GiB 6.44 GB) |
| 411 | Used Dev Size : 1048512 (1024.11 MiB 1073.68 MB) |
| 412 | Raid Devices : 7 |
| 413 | Total Devices : 7 |
| 414 | Preferred Minor : 0 |
| 415 | Persistence : Superblock is persistent |
| 416 | |
| 417 | Update Time : Sat Jun 4 22:02:10 2011 |
| 418 | State : active |
| 419 | Active Devices : 7 |
| 420 | Working Devices : 7 |
| 421 | Failed Devices : 0 |
| 422 | Spare Devices : 0 |
| 423 | |
| 424 | Layout : left-symmetric |
| 425 | Chunk Size : 64K |
| 426 | |
| 427 | UUID : b49fdd73:9af2093f:0dfb77a3:1c88c57c (local to host raid5) |
| 428 | Events : 0.137 |
| 429 | |
| 430 | Number Major Minor RaidDevice State |
| 431 | 0 8 17 0 active sync /dev/sdb1 |
| 432 | 1 8 33 1 active sync /dev/sdc1 |
| 433 | 2 8 49 2 active sync /dev/sdd1 |
| 434 | 3 8 65 3 active sync /dev/sde1 |
| 435 | 4 8 81 4 active sync /dev/sdf1 |
| 436 | 5 8 113 5 active sync /dev/sdh1 |
| 437 | 6 8 97 6 active sync /dev/sdg1 |
| 438 | }}} |
| 439 | |
| 440 | == xfs_growfs == |
| 441 | * see also wiki:TipAndDoc/filesystem/xfs_growfs |
| 442 | |
| 443 | * mitty@raid5:~$ df -h /var/raid/ |
| 444 | {{{ |
| 445 | Filesystem Size Used Avail Use% Mounted on |
| 446 | /dev/md0 4.0G 1.1G 3.0G 26% /var/raid |
| 447 | }}} |
| 448 | * mitty@raid5:~$ mount |
| 449 | {{{ |
| 450 | /dev/md0 on /var/raid type xfs (rw) |
| 451 | }}} |
| 452 | |
| 453 | * mitty@raid5:~$ sudo xfs_growfs /var/raid/ |
| 454 | {{{ |
| 455 | meta-data=/dev/md0 isize=256 agcount=8, agsize=131056 blks |
| 456 | = sectsz=4096 attr=2 |
| 457 | data = bsize=4096 blocks=1048448, imaxpct=25 |
| 458 | = sunit=16 swidth=64 blks |
| 459 | naming =version 2 bsize=4096 ascii-ci=0 |
| 460 | log =internal bsize=4096 blocks=2560, version=2 |
| 461 | = sectsz=4096 sunit=1 blks, lazy-count=1 |
| 462 | realtime =none extsz=4096 blocks=0, rtextents=0 |
| 463 | data blocks changed from 1048448 to 1572768 |
| 464 | }}} |
| 465 | |
| 466 | * mitty@raid5:~$ df -h /var/raid/ |
| 467 | {{{ |
| 468 | Filesystem Size Used Avail Use% Mounted on |
| 469 | /dev/md0 6.0G 1.1G 5.0G 17% /var/raid |
| 470 | }}} |
| 471 | |
| 472 | == check data == |
| 473 | * mitty@raid5:~$ sha1sum -c /var/raid/1G.sha1 |
| 474 | {{{ |
| 475 | /var/raid/1G: OK |
| 476 | }}} |
| 477 | |
| 478 | * mitty@raid5:~$ sudo mdadm -Ds |
| 479 | {{{ |
| 480 | mdadm: metadata format 00.90 unknown, ignored. |
| 481 | ARRAY /dev/md0 level=raid5 num-devices=7 metadata=00.90 UUID=b49fdd73:9af2093f:0dfb77a3:1c88c57c |
| 482 | }}} |
| 483 | |
| 484 | = 7 -> 14 disks = |
| 485 | * 任意の数だけgrow出来る模様 |
| 486 | |
| 487 | * mitty@raid5:~$ cat /proc/mdstat |
| 488 | {{{ |
| 489 | Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] |
| 490 | md0 : active raid5 sdf1[4] sdg1[6] sdd1[2] sdh1[5] sde1[3] sdc1[1] sdb1[0] |
| 491 | 6291072 blocks level 5, 64k chunk, algorithm 2 [7/7] [UUUUUUU] |
| 492 | |
| 493 | unused devices: <none> |
| 494 | }}} |
| 495 | |
| 496 | == add disks == |
| 497 | * mitty@raid5:~$ sudo mdadm /dev/md0 -a /dev/sd[ijklmno]1 |
| 498 | {{{ |
| 499 | mdadm: metadata format 00.90 unknown, ignored. |
| 500 | mdadm: added /dev/sdi1 |
| 501 | mdadm: added /dev/sdj1 |
| 502 | mdadm: added /dev/sdk1 |
| 503 | mdadm: added /dev/sdl1 |
| 504 | mdadm: added /dev/sdm1 |
| 505 | mdadm: added /dev/sdn1 |
| 506 | mdadm: added /dev/sdo1 |
| 507 | }}} |
| 508 | |
| 509 | * mitty@raid5:~$ cat /proc/mdstat |
| 510 | {{{ |
| 511 | Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] |
| 512 | md0 : active raid5 sdo1[7](S) sdn1[8](S) sdm1[9](S) sdl1[10](S) sdk1[11](S) sdj1[12](S) sdi1[13](S) sdf1[4] sdg1[6] sdd1[2] sdh1[5] sde1[3] sdc1[1] sdb1[0] |
| 513 | 6291072 blocks level 5, 64k chunk, algorithm 2 [7/7] [UUUUUUU] |
| 514 | |
| 515 | unused devices: <none> |
| 516 | }}} |
| 517 | * mitty@raid5:~$ sudo mdadm -D /dev/md0 |
| 518 | {{{ |
| 519 | mdadm: metadata format 00.90 unknown, ignored. |
| 520 | /dev/md0: |
| 521 | Version : 00.90 |
| 522 | Creation Time : Sat Jun 4 20:48:11 2011 |
| 523 | Raid Level : raid5 |
| 524 | Array Size : 6291072 (6.00 GiB 6.44 GB) |
| 525 | Used Dev Size : 1048512 (1024.11 MiB 1073.68 MB) |
| 526 | Raid Devices : 7 |
| 527 | Total Devices : 14 |
| 528 | Preferred Minor : 0 |
| 529 | Persistence : Superblock is persistent |
| 530 | |
| 531 | Update Time : Sun Jun 5 09:14:36 2011 |
| 532 | State : clean |
| 533 | Active Devices : 7 |
| 534 | Working Devices : 14 |
| 535 | Failed Devices : 0 |
| 536 | Spare Devices : 7 |
| 537 | |
| 538 | Layout : left-symmetric |
| 539 | Chunk Size : 64K |
| 540 | |
| 541 | UUID : b49fdd73:9af2093f:0dfb77a3:1c88c57c (local to host raid5) |
| 542 | Events : 0.150 |
| 543 | |
| 544 | Number Major Minor RaidDevice State |
| 545 | 0 8 17 0 active sync /dev/sdb1 |
| 546 | 1 8 33 1 active sync /dev/sdc1 |
| 547 | 2 8 49 2 active sync /dev/sdd1 |
| 548 | 3 8 65 3 active sync /dev/sde1 |
| 549 | 4 8 81 4 active sync /dev/sdf1 |
| 550 | 5 8 113 5 active sync /dev/sdh1 |
| 551 | 6 8 97 6 active sync /dev/sdg1 |
| 552 | |
| 553 | 7 8 225 - spare /dev/sdo1 |
| 554 | 8 8 209 - spare /dev/sdn1 |
| 555 | 9 8 193 - spare /dev/sdm1 |
| 556 | 10 8 177 - spare /dev/sdl1 |
| 557 | 11 8 161 - spare /dev/sdk1 |
| 558 | 12 8 145 - spare /dev/sdj1 |
| 559 | 13 8 129 - spare /dev/sdi1 |
| 560 | }}} |
| 561 | |
| 562 | == grow array == |
| 563 | * mitty@raid5:~$ sudo mdadm --grow /dev/md0 -n14 |
| 564 | {{{ |
| 565 | mdadm: metadata format 00.90 unknown, ignored. |
| 566 | mdadm: Need to backup 832K of critical section.. |
| 567 | mdadm: ... critical section passed. |
| 568 | }}} |
| 569 | |
| 570 | * mitty@raid5:~$ sudo mdadm -D /dev/md0 |
| 571 | {{{ |
| 572 | mdadm: metadata format 00.90 unknown, ignored. |
| 573 | /dev/md0: |
| 574 | Version : 00.91 |
| 575 | Creation Time : Sat Jun 4 20:48:11 2011 |
| 576 | Raid Level : raid5 |
| 577 | Array Size : 6291072 (6.00 GiB 6.44 GB) |
| 578 | Used Dev Size : 1048512 (1024.11 MiB 1073.68 MB) |
| 579 | Raid Devices : 14 |
| 580 | Total Devices : 14 |
| 581 | Preferred Minor : 0 |
| 582 | Persistence : Superblock is persistent |
| 583 | |
| 584 | Update Time : Sun Jun 5 09:16:21 2011 |
| 585 | State : clean, recovering |
| 586 | Active Devices : 14 |
| 587 | Working Devices : 14 |
| 588 | Failed Devices : 0 |
| 589 | Spare Devices : 0 |
| 590 | |
| 591 | Layout : left-symmetric |
| 592 | Chunk Size : 64K |
| 593 | |
| 594 | Reshape Status : 0% complete |
| 595 | Delta Devices : 7, (7->14) |
| 596 | |
| 597 | UUID : b49fdd73:9af2093f:0dfb77a3:1c88c57c (local to host raid5) |
| 598 | Events : 0.164 |
| 599 | |
| 600 | Number Major Minor RaidDevice State |
| 601 | 0 8 17 0 active sync /dev/sdb1 |
| 602 | 1 8 33 1 active sync /dev/sdc1 |
| 603 | 2 8 49 2 active sync /dev/sdd1 |
| 604 | 3 8 65 3 active sync /dev/sde1 |
| 605 | 4 8 81 4 active sync /dev/sdf1 |
| 606 | 5 8 113 5 active sync /dev/sdh1 |
| 607 | 6 8 97 6 active sync /dev/sdg1 |
| 608 | 7 8 225 7 active sync /dev/sdo1 |
| 609 | 8 8 209 8 active sync /dev/sdn1 |
| 610 | 9 8 193 9 active sync /dev/sdm1 |
| 611 | 10 8 177 10 active sync /dev/sdl1 |
| 612 | 11 8 161 11 active sync /dev/sdk1 |
| 613 | 12 8 145 12 active sync /dev/sdj1 |
| 614 | 13 8 129 13 active sync /dev/sdi1 |
| 615 | }}} |
| 616 | * mitty@raid5:~$ cat /proc/mdstat |
| 617 | {{{ |
| 618 | Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] |
| 619 | md0 : active raid5 sdo1[7] sdn1[8] sdm1[9] sdl1[10] sdk1[11] sdj1[12] sdi1[13] sdf1[4] sdg1[6] sdd1[2] sdh1[5] sde1[3] sdc1[1] sdb1[0] |
| 620 | 6291072 blocks super 0.91 level 5, 64k chunk, algorithm 2 [14/14] [UUUUUUUUUUUUUU] |
| 621 | [>....................] reshape = 0.6% (7068/1048512) finish=44.1min speed=392K/sec |
| 622 | |
| 623 | unused devices: <none> |
| 624 | }}} |
| 625 | |
| 626 | == reshape done == |
| 627 | * mitty@raid5:~$ cat /proc/mdstat |
| 628 | {{{ |
| 629 | Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] |
| 630 | md0 : active raid5 sdo1[7] sdn1[8] sdm1[9] sdl1[10] sdk1[11] sdj1[12] sdi1[13] sdf1[4] sdg1[6] sdd1[2] sdh1[5] sde1[3] sdc1[1] sdb1[0] |
| 631 | 13630656 blocks level 5, 64k chunk, algorithm 2 [14/14] [UUUUUUUUUUUUUU] |
| 632 | |
| 633 | unused devices: <none> |
| 634 | }}} |
| 635 | * mitty@raid5:~$ sudo mdadm -D /dev/md0 |
| 636 | {{{ |
| 637 | mdadm: metadata format 00.90 unknown, ignored. |
| 638 | /dev/md0: |
| 639 | Version : 00.90 |
| 640 | Creation Time : Sat Jun 4 20:48:11 2011 |
| 641 | Raid Level : raid5 |
| 642 | Array Size : 13630656 (13.00 GiB 13.96 GB) |
| 643 | Used Dev Size : 1048512 (1024.11 MiB 1073.68 MB) |
| 644 | Raid Devices : 14 |
| 645 | Total Devices : 14 |
| 646 | Preferred Minor : 0 |
| 647 | Persistence : Superblock is persistent |
| 648 | |
| 649 | Update Time : Sun Jun 5 09:21:17 2011 |
| 650 | State : clean |
| 651 | Active Devices : 14 |
| 652 | Working Devices : 14 |
| 653 | Failed Devices : 0 |
| 654 | Spare Devices : 0 |
| 655 | |
| 656 | Layout : left-symmetric |
| 657 | Chunk Size : 64K |
| 658 | |
| 659 | UUID : b49fdd73:9af2093f:0dfb77a3:1c88c57c (local to host raid5) |
| 660 | Events : 0.226 |
| 661 | |
| 662 | Number Major Minor RaidDevice State |
| 663 | 0 8 17 0 active sync /dev/sdb1 |
| 664 | 1 8 33 1 active sync /dev/sdc1 |
| 665 | 2 8 49 2 active sync /dev/sdd1 |
| 666 | 3 8 65 3 active sync /dev/sde1 |
| 667 | 4 8 81 4 active sync /dev/sdf1 |
| 668 | 5 8 113 5 active sync /dev/sdh1 |
| 669 | 6 8 97 6 active sync /dev/sdg1 |
| 670 | 7 8 225 7 active sync /dev/sdo1 |
| 671 | 8 8 209 8 active sync /dev/sdn1 |
| 672 | 9 8 193 9 active sync /dev/sdm1 |
| 673 | 10 8 177 10 active sync /dev/sdl1 |
| 674 | 11 8 161 11 active sync /dev/sdk1 |
| 675 | 12 8 145 12 active sync /dev/sdj1 |
| 676 | 13 8 129 13 active sync /dev/sdi1 |
| 677 | |
| 678 | }}} |
| 679 | |
| 680 | == xfs_growfs == |
| 681 | * mitty@raid5:~$ sudo xfs_growfs /var/raid/ |
| 682 | {{{ |
| 683 | xfs_growfs: /var/raid/ is not a mounted XFS filesystem |
| 684 | }}} |
| 685 | * read-onlyでも良いので、mountが必要 |
| 686 | |
| 687 | * mitty@raid5:~$ sudo mount -r /dev/md0 /var/raid/ |
| 688 | * mitty@raid5:~$ sudo xfs_growfs /var/raid/ |
| 689 | {{{ |
| 690 | meta-data=/dev/md0 isize=256 agcount=13, agsize=131056 blks |
| 691 | = sectsz=4096 attr=2 |
| 692 | data = bsize=4096 blocks=1572768, imaxpct=25 |
| 693 | = sunit=16 swidth=64 blks |
| 694 | naming =version 2 bsize=4096 ascii-ci=0 |
| 695 | log =internal bsize=4096 blocks=2560, version=2 |
| 696 | = sectsz=4096 sunit=1 blks, lazy-count=1 |
| 697 | realtime =none extsz=4096 blocks=0, rtextents=0 |
| 698 | data blocks changed from 1572768 to 3407664 |
| 699 | }}} |
| 700 | |
| 701 | * mitty@raid5:~$ mount |
| 702 | {{{ |
| 703 | /dev/md0 on /var/raid type xfs (ro) |
| 704 | }}} |
| 705 | * mitty@raid5:~$ df -h /var/raid/ |
| 706 | {{{ |
| 707 | Filesystem Size Used Avail Use% Mounted on |
| 708 | /dev/md0 13G 1.1G 12G 8% /var/raid |
| 709 | }}} |
| 710 | |
| 711 | |
| 712 | = misc = |
| 713 | * reshape中に再起動した場合、arrayの先頭からreshapeが再開される |
| 714 | * $ dmesg |
| 715 | {{{ |
| 716 | [ 14.359376] raid5: reshape will continue |
| 717 | (snip) |
| 718 | [ 14.361290] ...ok start reshape thread |
| 719 | }}} |