Control Web Panel

WebPanel => Updates => Topic started by: vxdas on March 14, 2018, 11:44:51 AM

Title: Combine second partition to the root
Post by: vxdas on March 14, 2018, 11:44:51 AM
 I have expanded storage in my provider, and I do not know how to add that partition to centos web panel that does not recognize me

df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            2.0G     0  2.0G   0% /dev
tmpfs           395M   65M  331M  17% /run
/dev/vda         46G   16G   28G  37% /
tmpfs           2.0G  8.0K  2.0G   1% /dev/shm
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
tmpfs           395M     0  395M   0% /run/user/1006

fdisk -l

Disk /dev/vda: 50.0 GB, 50000000000 bytes, 97656250 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/vdb: 50.0 GB, 50000000000 bytes, 97656250 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Title: Re: Combine second partition to the root
Post by: vxdas on March 15, 2018, 06:58:09 PM
I am already moving something ... I have managed to mount the unit and already centos web panel recognizes the unit. Now I would like to be able to add that extension to the / home folder to have more space in existing accounts.
(https://cldup.com/-KWGlDdbhy.jpg)
I have added / dev / vdb / home / vxd ext4 defaults 0 2 in / etc / fstab to mount the partition automatically.
Title: Re: Combine second partition to the root
Post by: vxdas on March 21, 2018, 01:53:16 PM
Partitioning the new disk

Now we need to partition the new disk / dev / sdv so that it can be used, this is done by using fdisk.

fdisk / dev / vdb

Once the command has been executed, we will select the option 'n' to add a new partition:

root @ cloud: ~ # fdisk / dev / vdb
Command (m for help): n
Later we will select the option 'p' to make the primary partition:

Command action
   e extended
   p primary partition (1-4)
p


As it is a new album, we still do not have any particiin, then we will select 1

Partition number (1-4): 1

Next, we press 'Enter' twice, since, by default, the first and the last cylinder of the unallocated space must be correct.


First cylinder (1-2610, default 1): "enter"
Using default value 1
Last cylinder, + cylinders or + size {K, M, G} (1-2610, default 2610): "enter"
Using default value 2610


't' is selected to change to a partition system ID, in this case we change to '1' automatically since it is our only partition.
Command (m for help): t
Selected partition 1

He entered the hexadecimal code '8e', since this is the code for a Linux LVM, since we will join it with the original Linux LVM that currently uses / dev / sda5.
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)

'w' is used to write the table on the disk and exit, all changes that have been made will be saved and then it will leave fdisk.
Command (m for help): w
The partition table has been altered!

Calling ioctl () to re-read partition table.
Syncing disks.

By using "fdisk -l" you can now see that / dev / sdv1 appears in the list, this is the new partition created on our disk in / dev / sdb just added and is currently using the 20 gb of space.
fdisk after partition created

Step 4. Increasing the logical volume

Next, we will use the pvcreate command to create a physical volume for later use by LVM. In this case, the physical volume will be our new partition / dev / sdb1
root @ cloud: ~ # pvcreate / dev / vdb1
  Physical volume "/ dev / vdb1" successfully created

Now we need to confirm the name of the current volume group using the vgdisplay command. The name will vary according to your configuration, for me it will be the name of my test server. vgdisplay provides a lot of information about the volume group, I will only show the current name and size for this example.
root @ cloud: ~ # vgdisplay
  --- Volume group ---
  VG Name cloud
  VG Size 19.76 GiB

Now, using the vgextend command, we expand the 'cloud' volume group by adding the physical volume / dev / vdb1 that we created using the pvcreate command just before.
root @ cloud: ~ # vgextend cloud / dev / vdb1
  Volume group "cloud" successfully extended

Using the pvscan command we scan all disks for physical volumes, this should confirm the original / dev / sda5 partition and the newly created / dev / vdb1 physical volume
root @ cloud: ~ # pvscan
  PV / dev / sda5 VG cloud lvm2 [19.76 GiB / 0 free]
  PV / dev / sdb1 VG cloud lvm2 [19.99 GiB / 19.99 GiB free]
  Total: 2 [39.75 GiB] / in use: 2 [39.75 GiB] / in no VG: 0
Title: Re: Combine second partition to the root
Post by: vxdas on March 21, 2018, 01:54:59 PM
I still have not confirmed if you can lose data from the folder / home ;D