المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : شرح كيفية اعداد نظام Raid 1



admin
11-02-2013, بتوقيت غرينيتش 02:03 AM
بسم الله الرحمن الرحيم



السلام عليكم ورحمة الله وبركاته



اليوم شرح طريقةنا يتحدث عن شرح كيفية اعداد نظام Raid 1 , ونظام Linux يدعم Raid 1 ومستوياته الاخرى وتحتاج الى هاردين بنفس المساحة على الخادم server وبنفس التقسيم .


ملحوظه : اذا قمت بتطبيق الشرح طريقة بشكل خاطئ سوف تفقد جميع البيانات الموجوده على الهارد فقبل تطبيق هذا الشرح طريقة تاكد بأن لديك باك اب buckup من ملفاتك المهمه على الخادم server .


نبدأ بالشرح طريقة :-

المرحله الأولى : نقوم بعرض تقسيم البارتشن الخاص بالهارد

رمز PHP:

<code style="white-space:nowrap"> <code> fdisk -l
fdisk -l /dev/sda
</code> </code>



سوف يظهر لك على سبيل المثال

اقتباس
Disk /dev/sda: 73.2 GB, 73295462400 bytes 255 heads, 63 sectors/track, 8910 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 3929 31455270 83 Linux /dev/sda3 3930 8779 38957625 83 Linux /dev/sda4 8780 8910 1052257+ 5 Extended /dev/sda5 8780 8910 1052226 82 Linux swap / Solaris

اﻻن على سبيل المثال سوف تستخدم /dev/sda3 بمساحة 37 جيجا بايت , اﻻن نستعرض البارتشن الاخر :

رمز PHP:

<code style="white-space:nowrap"> <code> fdisk -l /dev/sdb
</code> </code>

سيظهر لك كالتالي :

اقتباس
Disk /dev/sdb: 73.2 GB, 73295462400 bytes 255 heads, 63 sectors/track, 8910 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System

المرحله الثانية : نقوم بانشاء بارتشن جديد فى /dev/sdb بمساحه 37 جيجا بايت

رمز PHP:

<code style="white-space:nowrap"> <code> fdisk /dev/sdb
</code> </code>



سوف يظهر لك كالتالى

اقتباس
The number of cylinders for this disk is set to 8910. 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): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-8910, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-8910, default 8910): +37G



بكدا تم ان شاء البارتشن الجديد سوف نقوم اﻻن بعمل print للبارتشن

اقتباس
Command (m for help): p Disk /dev/sdb: 73.2 GB, 73295462400 bytes 255 heads, 63 sectors/track, 8910 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 37 297171 83 Linux

واخيرا , ظبط البارتشن ليكون بنظام Raid 1


اقتباس
Command (m for help): t Selected partition 1 Hex code (type L to list codes): fd Command (m for help): p Disk /dev/sdb: 73.2 GB, 73295462400 bytes 255 heads, 63 sectors/track, 8910 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sdb1 1 37 297171 fd Linux raid autodetect



نقوم اﻻن بعمل حفظ للإعدادات

اقتباس
Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. Syncing disks.


ثالثاً :

رمز PHP:

<code style="white-space:nowrap"> <code> fdisk /dev/sda
</code> </code>



نقوم بعمل التالي

اقتباس
The number of cylinders for this disk is set to 8910. 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): p Disk /dev/sda: 73.2 GB, 73295462400 bytes 255 heads, 63 sectors/track, 8910 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 3929 31455270 83 Linux /dev/sda3 3930 8779 38957625 83 Linux /dev/sda4 8780 8910 1052257+ 5 Extended /dev/sda5 8780 8910 1052226 82 Linux swap / Solaris Command (m for help): t Partition number (1-5): 3 Hex code (type L to list codes): fd Changed system type of partition 3 to fd (Linux raid autodetect) Command (m for help): p Disk /dev/sda: 73.2 GB, 73295462400 bytes 255 heads, 63 sectors/track, 8910 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System /dev/sda1 * 1 13 104391 83 Linux /dev/sda2 14 3929 31455270 83 Linux /dev/sda3 3930 8779 38957625 fd Linux raid autodetect /dev/sda4 8780 8910 1052257+ 5 Extended /dev/sda5 8780 8910 1052226 82 Linux swap / Solaris Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot. Syncing disks.

بعد ذلك نقوم بعمل اعاده تهيئة للبارتشن

رمز PHP:

<code style="white-space:nowrap"> <code> partprobe /dev/sda
</code> </code>



اﻻن نقوم بانشاء نظام الـ Raid 1

لعمل نظام Raid 1 على بارتشن /dev/sda3 و /dev/sdb1 نقوم باضافة الأمر التالي :

رمز PHP:

<code style="white-space:nowrap"> <code> mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sda3 /dev/sdb1
</code> </code>

لمشاهده عمل نظام الـ Raid 1

رمز PHP:

<code style="white-space:nowrap"> <code> watch cat /proc/mdstat
</code> </code>



عند الإنتهاء نقوم بانشاء ملفات لنظام الـ Raid

رمز PHP:

<code style="white-space:nowrap"> <code> mkfs.ext3 /dev/md0
</code> </code>

اﻻن نقوم بعمل Mount لـ Raid 1

رمز Code:
mkdir /raid1 mount /dev/md0 /raid1/ df -H /raid1/
اﻻن نقوم بعمل تجربة سرعه الـ Raid 1

رمز Code:
cd /raid1/ dd if=/dev/zero of=output bs=8k count=256k rm output


نقوم اﻻن بتحديث update /etc/fstab

رمز PHP:

<code style="white-space:nowrap"> <code> echo '/dev/md0 /raid1 ext3 noatime,rw 0 0' >> /etc/fstab
</code> </code>



لجلب معلومات اكتر حول الـ Raid 1 نقوم باضافه الامر التالى :

رمز PHP:

<code style="white-space:nowrap"> <code> mdadm --query --detail /dev/md0
</code> </code>




اﻻن انتهيت من الشرح طريقة وأسأل الله ان اكون وفقت فى شرح طريقةى هذا
يرجى عند نقل الموضوع ذكر المصدر وذكر صاحب الموضوع
شركة بيت هوست لخدمات الويب المتكامله (http://beethost.net)








https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-ash4/482113_236967293114455_1193518507_n.png (http://www.dzbatna.com)
©المشاركات المنشورة تعبر عن وجهة نظر صاحبها فقط، ولا تُعبّر بأي شكل من الأشكال عن وجهة نظر إدارة المنتدى (http://www.dzbatna.com)©

استعمل مربع البحث في الاسفل لمزيد من المواضيع


سريع للبحث عن مواضيع في المنتدى