8/24/2013

Ubunt : Software RAID 5 + LVM

Example link and other information. open http://intranet.sci.com/blog.php?u=3&b=775
Step software raid 5.
1. Install Ubunt 10.04 server 32bit
2. Install time server
  1. apt-get install ntp
  2. nano /etc/ntp.conf

change server to 192.168.2.252 << NTP Server IP
3.Set proxy for Update
  1. nano /etc/apt/apt.conf
พิมพ์ Acquire::http { Proxy "http://192.168.2.252:9999"; }; finish save file and update and upgrade.
4.
  1. Install apt-get install mdadm lvm2

5. Shutdown ubuntu and add hdd in setting storage tree drive.
6. Start Ubuntu
7. Check disk
  1. fdisk -l
  2. fdisk /dev/sdb
Create partition
8. Create partition:
  1. mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 /dev/sdb1 /dev/sdc2 /dev/sdd3
9. Check :
  1. mdadm --detail /dev/md0
10. Save file in config for use startup next time.
  1. mdadm -Es | grep md  >>/etc/mdadm/mdadm.conf
11. Test remove hdd on partition and start ubuntu.
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Step software LVM. use ubuntu old in software raid 5.
1. Create partition Physical Volume.
  1. pvcreate /dev/md0
2. Create Volume Group.
  1. vgcreate vg1 /dev/md0
  2.     vgdisplay
3. Create Logical Volume (xxxxx is mean Total PE number in number 5 example 4094 )
  1.    lvcreate -l xxxxx -n lv1 vg1 /dev/md0
  2.     lvdisplay
4. Format to ext4 or other type partition.
  1. mkfs.ext4 /dev/vg1/lv1
5. Create directory and mount. by edit file /etc/fstab and add.
  1. /dev/vg1/lv1       /DATA            ext4        defaults        0        0
6. Command mount partition.
  1.    mkdir /DATA
  2.     mount -a
7. Check partition.
  1. df -h /DATA
Finish step software LVM.

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Step software LVM is not set raid. use ubuntu old in software raid 5.
1. Add hdd in virtualbox 3.
2. Start ubuntu and fdisk -l see disk. Example sde , sdf , sdg
3. Create disk by use commad
  1. fdisk /dev/sdb
And create disk in step by step.
4. Fdisk -l for see disk. Example sde1 , sdf2 , sdf3.
5. Create Physical Volume :
  1. pvcreate /dev/sde1
6. Create Volume Group :
  1. vgcreate lvm /dev/sde1
And test display
  1. vgdisplay
7. Add disk to Volume Group by use command :
  1. vgextend lvm /dev/sdf2
And
  1. vgextend lvm /dev/sdg3
 And test display :
  1. vgdisplay

8. Create Logical Volume (xxxxx is mean Total PE in number 7.)
  1.    lvcreate -l xxxxx -n lv1 lvm
  2.     lvdisplay

9. Format to ext4 or other type partition.
  1. mkfs.ext4 /dev/lvm/lv1

10. Create directory and mount. by edit file /etc/fstab and add.
  1. /dev/lvm/lv1       /DATALVM           ext4        defaults        0        0

11. Command mount partition.
  1.    mkdir /DATALVM
  2.     mount -a

12. Check partition.
  1. df -h /DATALVM
Finish step software LVM formate hdd is not set raid.

No comments:

Post a Comment