Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
root@u1:/home/alf# mdadm --detail /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Fri Nov 1 05:44:00 2013
Raid Level : raid1
Array Size : 20967352 (20.00 GiB 21.47 GB)
Used Dev Size : 20967352 (20.00 GiB 21.47 GB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent
Update Time : Fri Nov 1 06:08:30 2013
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Name : u1:0 (local to host u1)
UUID : 63e24f74:2a1b03c1:4151c2a0:eb8ac91f
Events : 19
Number Major Minor RaidDevice State
0 8 2 0 active sync /dev/sda2
1 8 18 1 active sync /dev/sdb2
root@u1:/home/alf# mdadm --grow /dev/md0 --level=5 --backup-file=/mnt/sdd1/backup1
mdadm: level of /dev/md0 changed to raid5
mdadm: failed to set chunk size
root@u1:/home/alf# cat /proc/mdstat
Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10]
md0 : active raid5 sdb2[1] sda2[0]
20967352 blocks super 1.2 level 5, 8k chunk, algorithm 2 [2/2] [UU]
unused devices: <none>
root@u1:/home/alf# mdadm --detail /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Fri Nov 1 12:23:49 2013
Raid Level : raid1
Array Size : 20967352 (20.00 GiB 21.47 GB)
Used Dev Size : 20967352 (20.00 GiB 21.47 GB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent
Update Time : Fri Nov 1 13:46:27 2013
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Name : u1:0 (local to host u1)
UUID : 0138d79c:6a9bb1ab:c732b3ea:21f036c3
Events : 21
Number Major Minor RaidDevice State
0 8 2 0 active sync /dev/sda2
1 8 18 1 active sync /dev/sdb2
root@u1:/home/alf# mdadm --grow /dev/md0 --level=5 --backup-file=/mnt/sdd1/backup1
mdadm: level of /dev/md0 changed to raid5
mdadm: failed to set chunk size
root@u1:/home/alf# mdadm --detail /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Fri Nov 1 12:23:49 2013
Raid Level : raid5
Array Size : 20967352 (20.00 GiB 21.47 GB)
Used Dev Size : 20967352 (20.00 GiB 21.47 GB)
Raid Devices : 2
Total Devices : 2
Persistence : Superblock is persistent
Update Time : Fri Nov 1 13:47:03 2013
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Layout : left-symmetric
Chunk Size : 8K
Name : u1:0 (local to host u1)
UUID : 0138d79c:6a9bb1ab:c732b3ea:21f036c3
Events : 22
Number Major Minor RaidDevice State
0 8 2 0 active sync /dev/sda2
1 8 18 1 active sync /dev/sdb2
//...
int count = 0;
//...
for (i = disks; i--; )
if (i != target)
xor_srcs[count++] = sh->dev[i].page;
//...
if (unlikely(count == 1))
tx = async_memcpy(xor_dest, xor_srcs[0], 0, 0, STRIPE_SIZE, &submit);
else
tx = async_xor(xor_dest, xor_srcs, 0, count, STRIPE_SIZE, &submit);
//...
/* chunk size is meaningful, must divide component_size
* evenly
*/
if (info->component_size % (info->new_chunk/512)) {
unsigned long long shrink = info->component_size;
shrink &= ~(unsigned long long)(info->new_chunk/512-1);
pr_err("New chunk size (%dK) does not evenly divide device size (%lluk)\n",
info->new_chunk/1024, info->component_size/2);
pr_err("After shrinking any filesystem, \"mdadm --grow %s --size %llu\"\n",
devname, shrink/2);
pr_err("will shrink the array so the given chunk size would work.\n");
return "";
}
Работа с утилитой mdadm. Изменение типа массива, chunk size, расширение