• Tidak ada hasil yang ditemukan

Belajar Mengkonfigurasi Software RAID Menggunakan Tools Linux mdadm

N/A
N/A
Protected

Academic year: 2021

Membagikan "Belajar Mengkonfigurasi Software RAID Menggunakan Tools Linux mdadm"

Copied!
9
0
0

Teks penuh

(1)

Belajar Mengkonfigurasi Software RAID Menggunakan Tools Linux

“mdadm”

Pada kesempatan kali ini saya ingin berbagi sedikit pengalaman bagaimana mengkonfigurasi software RAID menggunakan tools Linux “mdadm”. Sebagai informasi bahwa server yang digunakan adalah server Stratus dengan type 45XX dan Operating system yang digunakan adalah RHEL 5.X. Informasi layout server untuk slot HDD adalah sebagai berikut:

(Gambar-1, Layout Internal Naming)

Kali ini kita akan mencoba membuat RAID-1 di device HDD slot /dev/sdd dan HDD slot /dev/sdl. Besarnya tiap HDD adalah 146GB SAS dan kecepatan rpm-nya 15K. Langkah-langkahnya adalah sebagai berikut:

1. Cek/memastikan apakah HDD dislot /dev/sdd dan /dev/sdl belum digunakan dan masih kosong.

--- [root@toiletumum ~]# fdisk -l /dev/sdd

Disk /dev/sdd: 146.5 GB, 146500042752 bytes 255 heads, 63 sectors/track, 17810 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System [root@toiletumum ~]#

--- [root@toiletumum ~]# fdisk -l /dev/sdl

Disk /dev/sdd: 146.5 GB, 146500042752 bytes 255 heads, 63 sectors/track, 17810 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System [root@toiletumum ~]#

(2)

2. Buat partisi baru menggunakan perintah fdisk di HDD pada slot /dev/sdd dan slot /dev/sdl.

[root@toiletumum ~]# fdisk /dev/sdd

The number of cylinders for this disk is set to 17810.

There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs

(e.g., DOS FDISK, OS/2 FDISK) Command (m for help):

--- Command (m for help): p

Disk /dev/sdd: 146.5 GB, 146500042752 bytes 255 heads, 63 sectors/track, 17810 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System Command (m for help):

--- 3. Ketik “n” untuk menambahkan partisi baru

Command (m for help): n

--- 4. Ketik “e” atau “p”

Command action e extended

p primary partition (1-4)

p

--- 5. Ketikan nomor partisi

Partition number (1-4): 1

---

6. Ketikan nilai awal dan nilai akhir dari besarnya partisi yang diinginkan(pada kasus saya, saya menggunakan besaran default sehingga besaran partisi yang diinginkan adalah sebesar +/- 146GB.)

First cylinder (1-17810, default 1): Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-17810, default 17810): Using default value 17810

--- Command (m for help): m

Command action

a toggle a bootable flag b edit bsd disklabel

c toggle the dos compatibility flag d delete a partition

l list known partition types m print this menu

(3)

n add a new partition

o create a new empty DOS partition table p print the partition table

q quit without saving changes s create a new empty Sun disklabel t change a partition's system id u change display/entry units v verify the partition table w write table to disk and exit

x extra functionality (experts only)

--- 7. Ketikan perintah “t”

Command (m for help): t Selected partition 1

--- 8. Ketikan perintah “L”

Hex code (type L to list codes): l

0 Empty 1e Hidden W95 FAT1 80 Old Minix bf Solaris 1 FAT12 24 NEC DOS 81 Minix / old Lin c1 DRDOS/sec (FAT- 2 XENIX root 39 Plan 9 82 Linux swap / So c4 DRDOS/sec (FAT- 3 XENIX usr 3c PartitionMagic 83 Linux c6 DRDOS/sec (FAT- 4 FAT16 <32M 40 Venix 80286 84 OS/2 hidden C: c7 Syrinx 5 Extended 41 PPC PReP Boot 85 Linux extended da Non-FS data 6 FAT16 42 SFS 86 NTFS volume set db CP/M / CTOS / . 7 HPFS/NTFS 4d QNX4.x 87 NTFS volume set de Dell Utility 8 AIX 4e QNX4.x 2nd part 88 Linux plaintext df BootIt 9 AIX bootable 4f QNX4.x 3rd part 8e Linux LVM e1 DOS access a OS/2 Boot Manag 50 OnTrack DM 93 Amoeba e3 DOS R/O b W95 FAT32 51 OnTrack DM6 Aux 94 Amoeba BBT e4 SpeedStor c W95 FAT32 (LBA) 52 CP/M 9f BSD/OS eb BeOS fs e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad hi ee EFI GPT f W95 Ext'd (LBA) 54 OnTrackDM6 a5 FreeBSD ef EFI (FAT-12/16/ 10 OPUS 55 EZ-Drive a6 OpenBSD f0 Linux/PA-RISC b 11 Hidden FAT12 56 Golden Bow a7 NeXTSTEP f1 SpeedStor 12 Compaq diagnost 5c Priam Edisk a8 Darwin UFS f4 SpeedStor 14 Hidden FAT16 <3 61 SpeedStor a9 NetBSD f2 DOS secondary 16 Hidden FAT16 63 GNU HURD or Sys ab Darwin boot fb VMware VMFS 17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE 18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto 1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep 1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT ---

9. Jika kita ingin menginginkan type default (83) tekan enter,karena saya ingin menggunakan system pertisi “Linux RAID autidetect”, maka saya mengetikan perintah “fd”.

Hex code (type L to list codes): fd

Changed system type of partition 1 to fd (Linux raid autodetect) ---

10. Ketikan perintah “w” untuk menulis tabel partisi kedisk dan kemudian keluar. Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table. Syncing disks.

[root@toiletumum ~]#

(4)

11. Lakukan langkah pada point 2 s/d 10 di slot hdd /dev/sdl [root@toiletumum ~]# fdisk /dev/sdl

The number of cylinders for this disk is set to 17810.

There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs

(e.g., DOS FDISK, OS/2 FDISK) Command (m for help): n

Command action e extended

p primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-17810, default 1): Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-17810, default 17810): Using default value 17810

Command (m for help): t Selected partition 1

Hex code (type L to list codes): fd

Changed system type of partition 1 to fd (Linux raid autodetect) Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table. Syncing disks.

[root@toiletumum ~]#

---

12. Periksa hasil pekerjaan kita, apakah sudah sesuai dengan keinginan kita yaitu partisi tabel sebesar 146 GB dengan type “Linux raid autodetect” [root@toiletumum ~]# fdisk -l /dev/sdd

Disk /dev/sdd: 146.5 GB, 146500042752 bytes 255 heads, 63 sectors/track, 17810 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/dev/sdd1 1 17810 143058793+ fd Linux raid autodetect [root@toiletumum ~]# fdisk -l /dev/sdl

Disk /dev/sdl: 146.5 GB, 146500042752 bytes 255 heads, 63 sectors/track, 17810 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System

/dev/sdl1 1 17810 143058793+ fd Linux raid autodetect [root@toiletumum ~]#

(5)

--- 13. Cek tabel partisi dan mount-point existing

[root@toiletumum ~]# df -h

Filesystem Size Used Avail Use% Mounted on /dev/md2 31G 12G 19G 39% / /dev/md3 33G 177M 31G 1% /var/crash /dev/md0 251M 22M 216M 10% /boot tmpfs 47G 0 47G 0% /dev/shm [root@toiletumum ~]# ---

14. Langkah selanjutnya adalah membuat RAID-1 dengan perintah berikut, dimana device baru bernama /dev/md20, menggunakan mode=1 (mirroring) dimana device pasangannya adalah /dev/sdd1 dan /dev/sdl1:

[root@toiletumum ~]# mdadm -C /dev/md20 -b internal --level=1 --raid-devices=2

/dev/sdd1 /dev/sdl1

mdadm: array /dev/md20 started.

---

15. Untuk mengecek status RAID yang sedang dibuat atau ingin mengetahui proses RAID yang sedang berjalan, bisa menggunakan perintah berikut:

[root@toiletumum ~]# cat /proc/mdstat Personalities : [raid1]

md20 : active raid1 sdx1[1] sdt1[0] 143058688 blocks [2/2] [UU]

[>...] resync = 1.6% (2421632/143058688) finish=13.5min speed=172973K/sec

bitmap: 137/137 pages [548KB], 512KB chunk md0 : active raid1 sdq1[1] sdu1[0]

264960 blocks [2/2] [UU]

bitmap: 0/33 pages [0KB], 4KB chunk md1 : active raid1 sdq3[1] sdu3[0]

12586816 blocks [2/2] [UU]

bitmap: 0/193 pages [0KB], 32KB chunk md3 : active raid1 sdq5[1] sdu5[0]

34644032 blocks [2/2] [UU]

bitmap: 0/133 pages [0KB], 128KB chunk md2 : active raid1 sdq2[1] sdu2[0]

33551680 blocks [2/2] [UU]

bitmap: 2/128 pages [8KB], 128KB chunk unused devices: <none>

(6)

(Gambar-2,/dev/sdd dan /dev/sdl sedang dalam proses pembuatan RAID-1) ---

16. Selain perintah cat /proc/mdstat, kita bisa juga menggunakan perintah lain untuk mengetahui status dari RAID.

[root@toiletumum ~]# mdadm -Q --detail /dev/md20 /dev/md20:

Version : 0.90

Creation Time : Tue Mar 4 10:01:21 2014 Raid Level : raid1

Array Size : 143058688 (136.43 GiB 146.49 GB) Used Dev Size : 143058688 (136.43 GiB 146.49 GB) Raid Devices : 2

Total Devices : 2 Preferred Minor : 20

Persistence : Superblock is persistent Intent Bitmap : Internal

Update Time : Tue Mar 4 10:01:21 2014 State : active, resyncing

Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0

Rebuild Status : 7% complete

UUID : ba54c955:ac61fc5d:87a88595:3947eac7 Events : 0.1

Number Major Minor RaidDevice State

0 65 49 0 active sync /dev/sdd1 1 65 113 1 active sync /dev/sdl1 [root@toiletumum ~]#

(7)

17. Untuk meload RAID array yang baru ketika booting tambahkan informasi array baru kedalam konfigurasi /etc/mdadm.conf

[root@toiletumum ~]# mdadm --detail --scan -v

ARRAY /dev/md2 level=raid1 num-devices=2 metadata=0.90 UUID=387b6b8a:1d33cd75:ed53c63b:4cd72ec1

devices=/dev/sdi2,/dev/sda2

ARRAY /dev/md3 level=raid1 num-devices=2 metadata=0.90 UUID=f08961db:2cad273a:a7b37711:2fb0462c

devices=/dev/sdi5,/dev/sda5

ARRAY /dev/md1 level=raid1 num-devices=2 metadata=0.90 UUID=6887676b:1dee3134:6a63ea65:bb42a944

devices=/dev/sdi3,/dev/sda3

ARRAY /dev/md0 level=raid1 num-devices=2 metadata=0.90 UUID=01ff7fe7:af66d3f8:de336369:d34485c0

devices=/dev/sdi1,/dev/sda1

ARRAY /dev/md20 level=raid1 num-devices=2 metadata=0.90 UUID=ba54c955:ac61fc5d:87a88595:3947eac7

devices=/dev/sdd1,/dev/sdl1

[root@toiletumum ~]#

--- # mdadm.conf written out by anaconda

DEVICE partitions MAILADDR root

ARRAY /dev/md2 level=raid1 num-devices=2 uuid=387b6b8a:1d33cd75:ed53c63b:4cd72ec1 ARRAY /dev/md3 level=raid1 num-devices=2 uuid=f08961db:2cad273a:a7b37711:2fb0462c ARRAY /dev/md0 level=raid1 num-devices=2 uuid=01ff7fe7:af66d3f8:de336369:d34485c0 ARRAY /dev/md1 level=raid1 num-devices=2 uuid=6887676b:1dee3134:6a63ea65:bb42a944

ARRAY /dev/md20 level=raid1 num-devices=2 UUID=ba54c955:ac61fc5d:87a88595:3947eac7

---

18. Untuk menggunakan raw disk block devices yang baru dibuat kita harus memformat dam me-mounting nya terlebih dahulu (Pada percobaan saya menggunakan journaling EXT3).

[root@toiletumum /]# mkfs.ext3 /dev/md20 mke2fs 1.39 (29-May-2006)

Filesystem label= OS type: Linux

Block size=4096 (log=2) Fragment size=4096 (log=2)

17891328 inodes, 35764672 blocks

1788233 blocks (5.00%) reserved for the super user First data block=0

Maximum filesystem blocks=4294967296 1092 block groups

32768 blocks per group, 32768 fragments per group 16384 inodes per group

Superblock backups stored on blocks:

32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872

(8)

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 30 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. [root@toiletumum /]#

[root@toiletumum /]#

--- 19. Mount hasil dari langkah 18 ke mountpoint yang kita inginkan. [root@toiletumum /]# mount /dev/md20 /bayar_seribu/

[root@toiletumum /]# df -h

Filesystem Size Used Avail Use% Mounted on /dev/md2 31G 12G 19G 39% / /dev/md3 33G 177M 31G 1% /var/crash /dev/md0 251M 22M 216M 10% /boot tmpfs 47G 0 47G 0% /dev/shm /dev/md20 135G 188M 128G 1% /bayar_seribu [root@toiletumum /]# [root@toiletumum /]# df /bayar_seribu/

Filesystem 1K-blocks Used Available Use% Mounted on /dev/md20 140812936 192132 133467872 1% /bayar_seribu [root@toiletumum /]#

--- [root@toiletumum /]# ls -l /bayar_seribu/

total 16

drwx--- 2 root root 16384 Mar 4 10:18 lost+found [root@toiletumum /]#

---

20. Jangan lupa tambahkan mount-point baru di fstab agar bisa termounting secara otomatis ketika server direstart.

[root@toiletumum /]# cat /etc/fstab

/dev/md2 / ext3 defaults 1 1 /dev/md3 /var/crash ext3 defaults 1 2 /dev/md0 /boot ext3 defaults 1 2 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 /dev/md1 swap swap defaults 0 0 /dev/scd1 /media/cdrecorder auto pamconsole,exec,noauto,managed 0 0

/dev/md20 /bayar_seribu ext3 defaults 0 0

[root@toiletumum /]#

(9)

21. Cek hasil hasilnya dengan cara merestart server. [root@toiletumum ~]# df -h

Filesystem Size Used Avail Use% Mounted on /dev/md2 31G 12G 19G 39% / /dev/md3 33G 177M 31G 1% /var/crash /dev/md0 251M 22M 216M 10% /boot tmpfs 47G 0 47G 0% /dev/shm /dev/md20 135G 188M 128G 1% /bayar_seribu [root@toiletumum ~]# cd /bayar_seribu/ [root@toiletumum bayar_seribu]# ls lost+found

[root@toiletumum bayar_seribu]# mkdir test.txt [root@toiletumum bayar_seribu]# ls lost+found test.txt [root@toiletumum bayar_seribu]# pwd /bayar_seribu [root@toiletumum bayar_seribu]# --- Sekian pengalamam dari saya, mudah-mudahan dapat bermanfaat. Ref:

[1].http://stratadoc.stratus.com/linux/4.1.0/r003l-05a/wwhelp/wwhimpl/common/ html/r003l-05a.pdf, (Diakses Februari 2014)

Referensi

Dokumen terkait

Hal ini menunjukkan bahwa penderita psikotik yang telah dinyatakan sembuh setelah diberikan terapi di rumah sakit, namun kemudian kembali tinggal bersama keluar- ga

Tujuan penelitian ini adalah: (1) untuk mendapatkan model matematika guna menduga perubahan suhu pada oven surya, (2) untuk menduga pola aliran dan distribusi suhu pada oven

Analisis data menggunakan regresi linier berganda.Hasil penelitian menunjukkan bahwa ukuran perusahaan, leverage, dan kualitas KAP berpengaruh terhadap audit delay,

problematik, kurang memiliki persepsi struktural sehingga kenyataan adalah superealitas (sesuatu yang ada di luar kenyataan obyektif). Masyarakat yang berada pada wilayah

PKB/PLKB juga juga mampu mampu mengembangkan mengembangkan jaringan jaringan dengan dengan Tokoh Tokoh agama, agama, tokoh tokoh masyarakat, masyarakat, mengembangkan

Satu bulan yang lalu kami juga berpesta, saat itu ia baru saja pindah rumah.. Ke tempat ia

Bütün erkeklere samur kürk, bütün kadınlara kadife giysi dağıtabilme olanağı bulunmadığına göre, ayaklanan toplum, çok olasıdır ki, gereksiz- gerekli şeklinde

 Half Adder : Cara kerja rangkaian ini adalah dengan menjumlahkan 2 input bilangan biner 1 bit yang ada, hasil penjumlahan tersebut menjadi nilai Sum dan apabila terdapat