Koozali.org: home of the SME Server

Additional HDD as Storage

Offline darmasanthi

  • ***
  • 139
  • +0/-0
Additional HDD as Storage
« on: July 26, 2014, 08:01:42 AM »
Dear Support,
I have SME 8.1 with 1TBx2 RAID1,
the purpose for the SME is as Storage (file share),
now, the capacity of the HDD getting full,
how to add an additional HDD to extend the capacity (i.e: 2TB) of file share,
and, is that possible to have an additional 2x2TB HDD RAID1 to extend the capacity

regards,
darmasanthi

Offline Stefano

  • *
  • 10,839
  • +2/-0
Re: Additional HDD as Storage
« Reply #1 on: July 26, 2014, 09:14:35 AM »
The first answer is yes
The second is "search The wiki"

thank you

Offline nicolatiana

  • *
  • 721
  • +0/-0
Re: Additional HDD as Storage
« Reply #2 on: July 26, 2014, 11:04:37 AM »
The third is: you have to play with LVM.

Build a new RAID 1 with your new drives and then add to the volume group that contains /main/root.

This is a small specific "memo" I did for my use picking up the essentials from:
http://wiki.contribs.org/Raid http://wiki.contribs.org/Raid:Growing http://forums.whirlpool.net.au/archive/709076

Make some training inside a VM  :hammer: and do not  :pint: before doing it !!  :lol:

Install your new hdds (2 existing drives - add 2 new drives - /dev/sdc - /dev/sdd). Start with partitioning:
Quote
# fdisk /dev/sdc
n (to add a new partition)
p (to make a primary partition)
1 (that's the number one, the number you want to assign to the partition)
   Only if you will be adding this disk to to a RAID set, then you will also need to change the partition type.
t (to change partition type)
L (within t's prompt to list available partition type)
fd (normally the partition type is fd but verify from the L command and look for "Linux raid autodetect"
   Accept the suggested first & last cylinder values
w (write and exit)
Repeat the same with /dev/sdd:
Quote
# fdisk /dev/sdd
Create a new array (say md3):
Quote
# mdadm --create --verbose /dev/md3 --level=1 --raid-devices=2 /dev/sdc1 /dev/sdd1
Wait array rebuild end and then create a Physical Extent for LVM:
Quote
# pvcreate /dev/md3
Resize LVM:
Quote
# vgextend main /dev/md3
# lvresize -l +100%FREE  /dev/main/root
# resize2fs  /dev/main/root
Launch pvdisplay to check the result:
Quote
# pvdisplay
--- Physical volume ---
PV Name               /dev/md2
VG Name               main
PV Size               19,89 GB / not usable 19,38 MB
Allocatable           yes (but full)
PE Size (KByte)       32768
Total PE              636
Free PE               0
Allocated PE          636
PV UUID     ABLB6N-Uku2-JX16-He82-lQB7-lfNw-ScLzr2
--- Physical volume ---
PV Name               /dev/md3
VG Name               main
PV Size               19,99 GB / not usable 25,31 MB
Allocatable           yes (but full)
PE Size (KByte)       32768
Total PE              639
Free PE               0
Allocated PE          639
PV UUID  zDEpB7-CWL7-Zi2B-ZJTw-LivX-no3z-yU9Rvk
Detecting /dev/md3:
Quote
# mdadm --detail /dev/md3 
/dev/md3:
 Version : 0.90
 Creation Time : Thu Apr 10 00:05:32 2014
 Raid Level : raid1
 Array Size : 20964672 (19.99 GiB 21.47 GB)
 Used Dev Size : 20964672 (19.99 GiB 21.47 GB)
 Raid Devices : 2
 Total Devices : 2
 Preferred Minor : 3
 Persistence : Superblock is persistent
 Update Time : Thu Apr 10 00:15:12 2014
 State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
 Spare Devices : 0
 UUID : c6a8dcc5:521a715f:31f0223d:83023d8e
 Events : 0.4
 Number   Major   Minor   RaidDevice State
 0       8       33        0      active sync   /dev/sdc1
 1       8       49        1      active sync   /dev/sdd1
Updating /etc/mdadm.conf:
Quote
# mdadm.conf written out by anaconda
DEVICE partitions
ARRAY /dev/md1 level=raid1 num-devices=2 uuid=f3af85e0:75d8244a:00b8ea18:60e9bd18
ARRAY /dev/md2 level=raid1 num-devices=2 uuid=e036b1ef:88900abe:0ecfc900:b1939721
ARRAY /dev/md3 level=raid1 num-devices=2 uuid=c6a8dcc5:521a715f:31f0223d:83023d8e
Create a new boot image (to declare the new raid partition /dev/md3):
Quote
# mkinitrd /boot/newraid.img  $(uname -r)
Modify /boot/grub/grub.conf to use the new image:
Quote
# sed -i 's/initrd-'"$(uname -r)"'.img/newraid.img/' /boot/grub/grub.conf
# grub.conf generated by anaconda
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/main/root
#          initrd /initrd-version.img
#boot=/dev/md1

default=0
timeout=5
splashimage=(hd0,0)/grub/smeserver.xpm.gz
foreground 000000
background 4E95D3
title SME Server (2.6.18-371.6.1.el5)
 root (hd0,0)
 kernel /vmlinuz-2.6.18-371.6.1.el5 ro root=/dev/main/root nodmraid
 initrd /newraid.img
title SME Server (2.6.18-371.4.1.el5)
 root (hd0,0)
 kernel /vmlinuz-2.6.18-371.4.1.el5 ro root=/dev/main/root nodmraid
 initrd /initrd-2.6.18-371.4.1.el5.img

This is also, with some adjustment, a work-around to face the 2 GB partition limitation of SME 8.

Have a nice training

Nicola
« Last Edit: July 26, 2014, 11:13:44 AM by nicolatiana »
Consulente di Smeserver.it -  Soluzioni e supporto su Sme server in Italia.

Offline stephdl

  • *
  • 1,519
  • +0/-0
    • Linux et Geekeries
Re: Additional HDD as Storage
« Reply #3 on: July 26, 2014, 01:17:10 PM »
Hi nicolatiana

Thanks for the support that you provided :)

Does your post come from a wiki page, if not could you set up in it. May be that page could be a good place : http://wiki.contribs.org/Raid:Growing

I know by experience these CL are not easy and we have to record them for later.
See http://wiki.contribs.org/Koozali_Foundation
irc : Freenode #sme_server #sme-fr

!!! Please write your knowledge to the Wiki !!!

Offline nicolatiana

  • *
  • 721
  • +0/-0
Re: Additional HDD as Storage
« Reply #4 on: August 06, 2014, 11:27:57 AM »
Not completely new really, it's a strict customization of the general scenario of the existing wiki page.
My tipical is Hp Microserver with a couple of hhds where I add another couple.

With a bit of time (I hope next week) maybe I'll a separate wiki-howto.

Nicola
Consulente di Smeserver.it -  Soluzioni e supporto su Sme server in Italia.