Selasa, 06 Oktober 2009

Mirroring Disk (RAID 1) Solaris 10

Berikut langkah-langkah mirroring internal disk pada masing-masing server SUN.
1. Mengkopy file /etc/vfstab dan /etc/system
# cp -p /etc/system /etc/system.orig."date"
# cp -p /etc/vfstab /etc/vfstab.orig."date"
Mengkopi file vfstab dan file syaytem ini bertujuan untuk membackup kedua file tersebut, sehingga jika ada kemungkinan error pada saat mirroring maka sistem dapat di restore dengan menggunakakan kedua file tersebut.
2. Sebelum melakukan Mirorring, dipastikan terlebih dahulu status dari disk yaitu ada atau tidaknya data. Jika ada disk yang akan dilkukan mirroring terdapat data didalamnya . lebih baik data tersebut di backup terlebih dahulu.
3. Membuat slice kecil berukuran 25 Mb (10 Mb juga bagus) untuk menyimpan database volume
Melalui command format ---> modify
Silahkan dibuat slice yang akan berisikan database Volume
4. Melalui command format pastikan terlebih dahulu disk yang existing akan di mirror ke disk yang mana.
Contoh
bash# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
0. c0t0d0
/pci@1dc,700000/pci@1/pci@1/scsi@2/sd@0,0
1. c0t1d0
/pci@1dc,700000/pci@1/pci@1/scsi@2/sd@1,0
2. c4t50060E80047D0D50d0
/pseudo/dlmndrv@1/dlmfdrv@w50060e80047d0d50,0
Output truncated

Untuk contoh diatas disk yang digunakan
c0t0d0
c0t1d0

5. Mengkopi VTOC dengan menggunakan perintah prtvtoc dan fmthard karena VTOC (volume table of contents) di root disk dan di mirror disk harus sama
# prtvtoc /dev/rdsk/c?t?d?s2 |fmthard -s - /dev/rdsk/c?t?d?s2
Contoh :
# prtvtoc /dev/rdsk/c0t0d0s2 |fmthard -s - /dev/rdsk/c0t1d0s2

6. Membuat metadatabase pada slice kecil yang telah dibuat
# metadb -f -a –c 2 c?t?d?s6 /dev/dsk/c?t?d?s6 (Slice 6 adalah contoh slice kecil yang telah di buat)

# metadb -a -f –c 2 /dev/dsk/c0t0d0s6 /dev/dsk/c0t1d0s6 (Slice 6 pada rootmirror)
7. Tiap-tiap slice pada tabel partisi dapat di mirror.
Mirror the root slice
# metainit -f d10 1 1 c?t?d?s0
# metainit -f d20 1 1 c?t?d?s0
# metainit d0 -m d10
# metaroot d0 (Use this command only on the root slice!)
Mirror the swap slice.
# metainit -f d11 1 1 c?t?d?s1
# metainit -f d21 1 1 c?t?d?s1
# metainit d1 -m d11
Mirror other slice
# metainit -f d13 1 1 c?t?d?s3
# metainit -f d23 1 1 c?t?d?s3
# metainit d3 -m d13\

# metainit -f d14 1 1 c?t?d?s4
# metainit -f d24 1 1 c?t?d?s4
# metainit d4 -m d14

# metainit -f d15 1 1 c?t?d?s5
# metainit -f d25 1 1 c?t?d?s5
# metainit d5 -m d15

# metainit -f d16 1 1 c?t?d?s6
# metainit -f d26 1 1 c?t?d?s6
# metainit d6 -m d16
Terdapat 6 slice di disk existing yaitu s0, s1, s3, s4, s5 dan s6. Tegantung pada keadaan slice yang exist, jika pada slice yang exist hanya terdapat 2 slice maka mirror dapat dilakukan pada 2 slice saja.
Contoh isian tanda tanya diatas
Mirror the root slice
# metainit -f d10 1 1 c0t0d0s0
# metainit -f d20 1 1 c0t1d0s0
# metainit d0 -m d10
# metaroot d0 (Use this command only on the root slice!)
Mirror the swap slice.
# metainit -f d11 1 1 c0t0d0s1
# metainit -f d21 1 1 c0t1d0s1
# metainit d1 -m d11
Mirror other slice
# metainit -f d13 1 1 c0t0d0s3
# metainit -f d23 1 1 c0t1d0s3
# metainit d3 -m d13

# metainit -f d14 1 1 c0t0d0s4
# metainit -f d24 1 1 c0t1d0s4
# metainit d4 -m d14

# metainit -f d15 1 1 c0t0d0s5
# metainit -f d25 1 1 c0t1d0s5
# metainit d5 -m d15

# metainit -f d16 1 1 c0t0d0s6
# metainit -f d26 1 1 c0t1d0s6
# metainit d6 -m d16

8. Mengupdate file /etc/vfstab untuk mount mirror disk setelah boot.
Contoh pada server Sun Fire V215 dengan hostname : notifgw
Sebelum diupdate
#device device fsck mount mount
#to mount fsck type pass at boot options
#
/dev/fd fd_[6C-_[7Cno_[6C-
/proc /proc proc
/dev/dsk/c1t0d0s1 swap
/dev/md/dsk/d0 /dev/md/rdsk/d0 /
/dev/dsk/c1t0d0s3 /dev/rdsk/c1t0d0s3 /export/home ufs 2
yes -
/devices/devices devfs /system/contract_[8Cctfs
objfs /system/object objfs -
swap /tmp tmpfs yes

Sesudah diupdate

#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/md/dsk/d1 - - swap - no -
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no -
/dev/md/dsk/d3 /dev/md/rdsk/d3 /export/home ufs 2 yes -
/devices - /devices devfs - no -
ctfs - /system/contract ctfs - no -
objfs - /system/object objfs - no -
swap - /tmp tmpfs - yes

Isi file /etc/vstab yang diupdate diatas adalah tulisan yang bercetak tebal
9. Reboot system dengan perintah
# lockfs -fa
# init 6
10. Meng-attach submirror yang kedua pada mirror
# metattach d0 d20
# metattach d1 d21
# metattach d3 d23
# metattach d4 d24
# metattach d5 d25
# metattach d6 d26
11. Memastikan physical device path dari mirror disk
# ls -l /dev/dsk/c?t?d?s0
Contoh
# # ls -l /dev/dsk/c0t1d0s0
Contoh output pada server yang dilakukan mirroring
lrwxrwxrwx 1 root root 67 Dec 21 12:47 /dev/dsk/c0t1d0s0 -> ../../devices/pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/sd@0,0:a
12. Membuat mirror device alias pada mirror disk
Contoh yang dilakukan pada server notifgw
# eeprom "nvramrc=devalias mirror /pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/sd@0,0:a "
# eeprom "use-nvramrc?=true"


References :

2 komentar: