RAID Configuration

From Nowickipedia
Jump to: navigation, search

Create RAID 1 array

 root@steambox:~# mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sde /dev/sdc
 mdadm: Note: this array has metadata at the start and
   may not be suitable as a boot device.  If you plan to
   store '/boot' on this device please ensure that
   your boot-loader understands md/v1.x metadata, or use
   --metadata=0.90
 Continue creating array? y
 mdadm: Defaulting to version 1.2 metadata
 mdadm: array /dev/md2 started.

Add array to physical volume group in LVM

 root@steambox:~# lvm
 lvm> pvcreate /dev/md2
 lvm> vgextend sysvg /dev/md2
 lvm> vgdisplay
   --- Volume group ---
   VG Name               sysvg
   System ID
   Format                lvm2
   Metadata Areas        2
   Metadata Sequence No  43
   VG Access             read/write
   VG Status             resizable
   MAX LV                0
   Cur LV                7
   Open LV               5
   Max PV                0
   Cur PV                2
   Act PV                2
   VG Size               7.28 TiB
   PE Size               4.00 MiB
   Total PE              1907658
   Alloc PE / Size       950848 / 3.63 TiB
   Free  PE / Size       956810 / 3.65 TiB
   VG UUID               oq4u2i-g6BY-13na-Hhv6-S8gF-AwqM-bkBgir

Extend existing logical volumes

 lvm> lvextend -L+1T /dev/sysvg/hdmovies
   Size of logical volume sysvg/hdmovies changed from 1.37 TiB (359424 extents) to 2.37 TiB (621568 extents).
   Logical volume hdmovies successfully resized
 lvm> lvextend -L+1T /dev/sysvg/tvshows
 Size of logical volume sysvg/tvshows changed from 1.40 TiB (366080 extents) to 2.40 TiB (628224 extents).
 Logical volume tvshows successfully resized

Extend disks in BTRFS

 root@steambox:~# btrfs filesystem resize max /media/tvshows/
 Resize '/media/tvshows/' of 'max'
 root@steambox:~# btrfs filesystem resize max /media/hdmovies/
 Resize '/media/hdmovies/' of 'max'