Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!
Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.
Serwer do czasu awarii posiadał dwa dyski 500GB spięte w macierz RAID1. Jeden z dysków był na tyle sprawny że udało mi się sklonować go na dysk 1TB. System uruchamia się poprawnie z nowego dysku (/dev/sda). Teraz chciałbym dodać drugi dysk do macierzy RAID1 (/dev/sdb).
fdisk -l Disk /dev/sda: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 fd Linux raid autodetect /dev/sda2 14 60801 488279610 fd Linux raid autodetect /dev/sda3 60802 121602 488377344 83 Linux Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 121602 976760832 83 Linux Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdc1 1 121602 976760832 83 Linux Disk /dev/md0: 106 MB, 106823680 bytes 2 heads, 4 sectors/track, 26080 cylinders Units = cylinders of 8 * 512 = 4096 bytes Device Boot Start End Blocks Id System Disk /dev/md1: 499.9 GB, 499998195712 bytes 2 heads, 4 sectors/track, 122069872 cylinders Units = cylinders of 8 * 512 = 4096 bytes Disk /dev/dm-0: 464.5 GB, 464502390784 bytes 255 heads, 63 sectors/track, 56472 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/dm-1: 5368 MB, 5368709120 bytes 255 heads, 63 sectors/track, 652 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/dm-2: 4294 MB, 4294967296 bytes 255 heads, 63 sectors/track, 522 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/dm-3: 10.7 GB, 10737418240 bytes 255 heads, 63 sectors/track, 1305 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/dm-4: 4294 MB, 4294967296 bytes 255 heads, 63 sectors/track, 522 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/dm-5: 2147 MB, 2147483648 bytes 255 heads, 63 sectors/track, 261 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/dm-6: 6442 MB, 6442450944 bytes 255 heads, 63 sectors/track, 783 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk /dev/dm-7: 2147 MB, 2147483648 bytes 255 heads, 63 sectors/track, 261 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes
mount /dev/mapper/vg00-root on / type ext3 (rw,acl,user_xattr) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) debugfs on /sys/kernel/debug type debugfs (rw) udev on /dev type tmpfs (rw) devpts on /dev/pts type devpts (rw,mode=0620,gid=5) /dev/md0 on /boot type ext3 (rw,acl,user_xattr) /dev/mapper/vg00-home on /home type ext3 (rw,acl,user_xattr) /dev/mapper/vg00-opt on /opt type ext3 (rw,acl,user_xattr) /dev/mapper/vg00-srv on /srv type xfs (rw) /dev/mapper/vg00-tmp on /tmp type xfs (rw) /dev/mapper/vg00-usr on /usr type ext3 (rw,acl,user_xattr) /dev/mapper/vg00-var on /var type xfs (rw) /dev/sdc1 on /mnt/sdc type ext3 (rw) /mnt/sdc/faks_przetw on /home/indok/indata/faks_przetw type bind (rw,bind) /mnt/sdc/faks_tiff on /home/indok/indata/faks_tiff type bind (rw,bind) securityfs on /sys/kernel/security type securityfs (rw)
Do spięcia macierzy wystarczy wykonać następujące kroki czy coś więcej?
1) skopiowanie struktury partycji:
sfdisk -d /dev/sda | sfdisk /dev/sdb
2) dodanie dysku do macierzy:
mdadm /dev/md0 --add /dev/sdb1 mdadm /dev/md1 --add /dev/sdb2
3) Podgląd odbudowania macierzy:
watch -d -n 1 cat /proc/mdstat
Dobrą mam kolejność dysku (/dev/sda) w macierzy?
mdadm --detail /dev/md0 /dev/md0: Version : 00.90.03 Creation Time : Mon Aug 17 12:00:11 2009 Raid Level : raid1 Array Size : 104320 (101.89 MiB 106.82 MB) Used Dev Size : 104320 (101.89 MiB 106.82 MB) Raid Devices : 2 Total Devices : 1 Preferred Minor : 0 Persistence : Superblock is persistent Update Time : Fri Mar 28 14:41:26 2014 State : clean, degraded Active Devices : 1 Working Devices : 1 Failed Devices : 0 Spare Devices : 0 UUID : ce03ca58:da03a033:2bbfe745:c8664328 Events : 0.1437 Number Major Minor RaidDevice State 0 0 0 0 removed 1 8 1 1 active sync /dev/sda1
mdadm --detail /dev/md1 /dev/md1: Version : 00.90.03 Creation Time : Mon Aug 17 12:00:14 2009 Raid Level : raid1 Array Size : 488279488 (465.66 GiB 500.00 GB) Used Dev Size : 488279488 (465.66 GiB 500.00 GB) Raid Devices : 2 Total Devices : 1 Preferred Minor : 1 Persistence : Superblock is persistent Update Time : Mon Mar 31 16:24:23 2014 State : clean, degraded Active Devices : 1 Working Devices : 1 Failed Devices : 0 Spare Devices : 0 UUID : 79b8f613:43393c37:27fefd34:e0ae0295 Events : 0.67188199 Number Major Minor RaidDevice State 0 0 0 0 removed 1 8 2 1 active sync /dev/sda2
sda1 i sda2 nie powinno być w miejscu tam gdzie jest usunięty dysk? Przy przywracaniu mdadm nie będzie próbował czasami przenosić pusty dysk na dysk z danymi?
Ostatnio edytowany przez lukaz1987 (2014-04-03 10:36:41)
Offline
Time (s) | Query |
---|---|
0.00009 | SET CHARSET latin2 |
0.00004 | SET NAMES latin2 |
0.00097 | SELECT u.*, g.*, o.logged FROM punbb_users AS u INNER JOIN punbb_groups AS g ON u.group_id=g.g_id LEFT JOIN punbb_online AS o ON o.ident='3.23.103.216' WHERE u.id=1 |
0.00200 | REPLACE INTO punbb_online (user_id, ident, logged) VALUES(1, '3.23.103.216', 1732247338) |
0.00040 | SELECT * FROM punbb_online WHERE logged<1732247038 |
0.00052 | SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 FROM punbb_topics AS t INNER JOIN punbb_forums AS f ON f.id=t.forum_id LEFT JOIN punbb_forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id=25527 AND t.moved_to IS NULL |
0.00022 | SELECT search_for, replace_with FROM punbb_censoring |
0.00094 | SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM punbb_posts AS p INNER JOIN punbb_users AS u ON u.id=p.poster_id INNER JOIN punbb_groups AS g ON g.g_id=u.group_id LEFT JOIN punbb_online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id=25527 ORDER BY p.id LIMIT 0,25 |
0.00087 | UPDATE punbb_topics SET num_views=num_views+1 WHERE id=25527 |
Total query time: 0.00605 s |