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!

Ogłoszenie

Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.

#1  2014-03-31 14:18:32

  lukaz1987 - Członek DUG

lukaz1987
Członek DUG
Zarejestrowany: 2008-08-12

Dodanie dysku do macierzy programowej RAID1

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).

Kod:

 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

Kod:

 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:

Kod:

sfdisk -d /dev/sda | sfdisk /dev/sdb

2) dodanie dysku do macierzy:

Kod:

mdadm /dev/md0 --add /dev/sdb1
mdadm /dev/md1 --add /dev/sdb2

3) Podgląd odbudowania macierzy:

Kod:

watch -d -n 1 cat /proc/mdstat

Dobrą mam kolejność dysku (/dev/sda) w macierzy?

Kod:

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

Kod:

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

 

Stopka forum

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson
To nie jest tylko forum, to nasza mała ojczyzna ;-)