Merging Volumes (sda2 to sdb1)

General support questions
Post Reply
darkb1t
Posts: 2
Joined: 2018/03/08 15:57:40

Merging Volumes (sda2 to sdb1)

Post by darkb1t » 2018/03/08 17:28:57

Hello CentOS Community,

I am clueless on how to perform this as my original plan to just extend the volumes and create one large one failed. So I am here to ask for some help. :D I basically have a CentOS NFS that needs more space and I need to merge two volumes, one is in use, and the other is just sitting there in vmware and my master plan of performing lvextend /dev/sda2 /dev/sdb1 failed.

So here is the scenario - I have this CentOS Box which basically acts as a data store for logs, now I have 2tb on /dev/sdb1 /data which these logs are stored. I also have created another 2tb extended in vmware and I am trying to add the other 2tb to the one that is already in use. <see df -h & fdisk -l & > to make it a total of 4tb.

Any help would be much appreciated :-D

[root@PXXX ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos_XXX-root 50G 2.2G 48G 5% /
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 0 3.9G 0% /dev/shm
tmpfs 3.9G 33M 3.8G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sdb1 2.0T 1.7T 208G 90% /data
/dev/sda1 1014M 189M 826M 19% /boot
/dev/mapper/centos_XXX-home 142G 33M 142G 1% /home
tmpfs 783M 0 783M 0% /run/user/0

[root@XXX ~]# fdisk -l

Disk /dev/sda: 214.7 GB, 214748364800 bytes, 419430400 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 label type: dos
Disk identifier: 0x000c05a7

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 2099199 1048576 83 Linux
/dev/sda2 2099200 419430399 208665600 8e Linux LVM

Disk /dev/sdb: 4398.0 GB, 4398046511104 bytes, 8589934592 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 label type: dos
Disk identifier: 0x20aee93a

Device Boot Start End Blocks Id System
/dev/sdb1 2048 4294967294 2147482623+ 83 Linux

Disk /dev/mapper/centos_XXX-root: 53.7 GB, 53687091200 bytes, 104857600 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/mapper/centos_XXX-swap: 8455 MB, 8455716864 bytes, 16515072 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/mapper/centos_XXX-home: 151.5 GB, 151523426304 bytes, 295944192 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

pjsr2
Posts: 614
Joined: 2014/03/27 20:11:07

Re: Merging Volumes (sda2 to sdb1)

Post by pjsr2 » 2018/03/08 18:02:59

https://kompjuteras.com/en/how-to-exten ... -new-disk/

Note that you need to change the file system type on /dev/sdb1 from 83 (Linux) to 8e (Linux LVM).

darkb1t
Posts: 2
Joined: 2018/03/08 15:57:40

Re: Merging Volumes (sda2 to sdb1)

Post by darkb1t » 2018/03/08 21:50:01

Ah, I see the light now. Thank you.

Post Reply