home       inleiding       sysadmin       services       links       bash       werk       nothing      

185 sudo yum install lvm2
186 sudo yum install mdadm
 
190 sudo mdadm --create /dev/md0 --raid-devices=3 --level=5 /dev/sdg /dev/sdf /dev/sde
191 sudo mdadm --create /dev/md1 --raid-devices=3 --level=5 /dev/sdd /dev/sdc /dev/sdb
 
194 watch 'cat /proc/mdstat'
195 sudo init 6
196 cat /proc/mdstat

[user@centOS74-30-161 ~]$ cat /proc/mdstat
Personalities : [raid6] [raid5] [raid4] 
md0 : active raid5 sdg[0] sdf[1] sde[3]
      67043328 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]
    
md1 : active raid5 sdd[0] sdc[1] sdb[3]
      67043328 blocks super 1.2 level 5, 512k chunk, algorithm 2 [3/3] [UUU]

 
198 sudo pvcreate /dev/md0
199 sudo pvcreate /dev/md1
200 sudo pvs

[user@centOS74-30-161 ~]$ sudo pvs
  PV         VG      Fmt  Attr PSize  PFree 
  /dev/md0   storage lvm2 a--  63,93g 35,93g
  /dev/md1   storage lvm2 a--  63,93g 63,93g

 
201 sudo vgcreate storage /dev/md0 /dev/md1
 
202 sudo lvcreate --size=20G --name=media storage
203 sudo lvcreate --size=5G --name=docs storage
204 sudo lvcreate --size=3G --name=balie storage
205 sudo lvs

[user@centOS74-30-161 ~]$ sudo lvs
  LV    VG      Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  balie storage -wi-ao----  3,00g                                                    
  docs  storage -wi-ao----  5,00g                                                    
  media storage -wi-ao---- 20,00g 

 
206 sudo mkfs.ext4 /dev/storage/media
207 sudo mkfs.xfs /dev/storage/docs
208 sudo mkfs.xfs /dev/storage/balie
209 sudo lsblk -f

[user@centOS74-30-161 ~]$ sudo lsblk -o NAME,FSTYPE,SIZE
NAME              FSTYPE             SIZE
sda                                   16G
├─sda1            xfs                  1G
├─sda2            swap                 1G
└─sda3            xfs                 14G
sdb               linux_raid_member   32G
└─md1             LVM2_member         64G
sdc               linux_raid_member   32G
└─md1             LVM2_member         64G
sdd               linux_raid_member   32G
└─md1             LVM2_member         64G
sde               linux_raid_member   32G
└─md0             LVM2_member         64G
  ├─storage-media ext4                20G
  ├─storage-docs  xfs                  5G
  └─storage-balie xfs                  3G
sdf               linux_raid_member   32G
└─md0             LVM2_member         64G
  ├─storage-media ext4                20G
  ├─storage-docs  xfs                  5G
  └─storage-balie xfs                  3G
sdg               linux_raid_member   32G
└─md0             LVM2_member         64G
  ├─storage-media ext4                20G
  ├─storage-docs  xfs                  5G
  └─storage-balie xfs                  3G
sr0                                 1024M

211 sudo mkdir -p /node/storage/media
212 sudo mkdir -p /node/storage/docs
213 sudo mkdir -p /node/storage/balie
 
216 sudo vi /etc/fstab

# /etc/fstab
# Created by anaconda on Fri Dec 15 12:13:50 2017
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=a5ea04cf-a6f3-4d1e-8b56-c90904abff30 /                       xfs     defaults        0 0
UUID=0d80c291-4c12-4449-9798-9f638cfb3c19 /boot                   xfs     defaults        0 0
UUID=a423574d-4fe0-4c98-9639-dd5ead622a57 swap                    swap    defaults        0 0
 
#storage-media ext4                                6b704437-9548-4447-9a3b-db707513cb88   
UUID=6b704437-9548-4447-9a3b-db707513cb88 /node/storage/media   ext4    defaults    0   0
 
#storage-docs  xfs                                 2a3fcfcc-a4e9-451f-b2b8-ef9b3a9189b5   
UUID=2a3fcfcc-a4e9-451f-b2b8-ef9b3a9189b5 /node/storage/docs    xfs defaults    0   0
 
#storage-balie xfs                                 d6ea0bcf-5967-4bef-961f-123a1a20ce99 
UUID=d6ea0bcf-5967-4bef-961f-123a1a20ce99 /node/storage/balie   xfs defaults    0   0

217 sudo mount -av
218 df -h

[user@centOS74-30-161 ~]$ df -h | grep -v tmp
Filesystem                 Size  Used Avail Use% Mounted on
/dev/sda3                   14G  973M   14G   7% /
/dev/sda1                 1014M  119M  896M  12% /boot
/dev/mapper/storage-media   20G   45M   19G   1% /node/storage/media
/dev/mapper/storage-docs   5,0G   33M  5,0G   1% /node/storage/docs
/dev/mapper/storage-balie  3,0G   33M  3,0G   2% /node/storage/balie