Re: [CentOS] Increase Disk Space with LVM

2018-07-31 Thread Louis Lagendijk
On Tue, 2018-07-31 at 13:31 +0200, Felix Kölzow wrote:
> Dear CentOS-Community,
> 
> we have a server with four hard drives that are configured as raid10 
> (/dev/sda).
> 
> Now, /home and /root are almost full. Therefore, we decided to buy
> four
> 
> additional hard drives that should configured also as raid 10
> (/dev/sdb).
> 
> 
> I want to use LVM to extend disk space for root and home.
> 
> My (successful) test procedure in a virtual environment looks like
> this:
> 
> 
>  1. devide /dev/sdb into /dev/sdb1 for root and /dev/sdb2 for home
> using
> parted

How many volume groups do you have: I  would assume only one? If so,
just create a single partition and add that to the VG. lvm will take
care of the rest...
What does the vgs command report?

Are you using a RAID controller? If not you need to create the raid
array first (and the disk names may be some mdxxx instead)

>  2. Convert disk to physical volume: pvcreate /dev/sdb1
>  3. add physical volume to volume group (called centos): vgextend
> centos
> /dev/sdb1
>  4. Allocate physical volume to a logical volume:lvextend -l
> +100$FREE
> /dev/centos/root
Just a nitpick: This just allocates space from the VG (that got more
space by adding the new disks), but if there is space in the PV on the
old disk that might get allocated instead.
Anyhow this looks ok, but I recommend to add the -r option, that will
resize the file system in the same step

>  5. resize2fs /dev/centos/root or xfs_grows /dev/centos/root
> depending
> on file system used
See above, if you use the -r option on the lvextend this step is not
needed

>  6. repeat steps 2-6 for /home and sdb2
> 
See above: this is only required when you have more than one VG.


___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


[CentOS] Increase Disk Space with LVM

2018-07-31 Thread Felix Kölzow

Dear CentOS-Community,

we have a server with four hard drives that are configured as raid10 
(/dev/sda).


Now, /home and /root are almost full. Therefore, we decided to buy four

additional hard drives that should configured also as raid 10 (/dev/sdb).


I want to use LVM to extend disk space for root and home.

My (successful) test procedure in a virtual environment looks like this:


1. devide /dev/sdb into /dev/sdb1 for root and /dev/sdb2 for home using
   parted
2. Convert disk to physical volume: pvcreate /dev/sdb1
3. add physical volume to volume group (called centos): vgextend centos
   /dev/sdb1
4. Allocate physical volume to a logical volume:lvextend -l +100$FREE
   /dev/centos/root
5. resize2fs /dev/centos/root or xfs_grows /dev/centos/root depending
   on file system used
6. repeat steps 2-6 for /home and sdb2


The mentioned instruction I've got from this page:

https://askubuntu.com/questions/458476/adding-disks-with-lvm#459176


Now my question:

Is this procedure really safe or is something missing or are there some 
steps


which I overlooked actually?


Kind Regards

Felix Kölzow

___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos