centos – Re-allocate space on Centos7 RAID-1 volume from one mount to another

We have a set of Centos7 machines that were configured with 100GB /tmp and 400GB /scratch partitions. The tools we’re using are consuming more /tmp space than anticipated so we need to re-allocate some /scratch space to /tmp.

Our systems are set up with two 1TB NVME drives in RAID-1; relevant lsblk output:

nvme0n1              259:0    0 894.3G  0 disk
├─nvme0n1p1          259:4    0     1G  0 part
│ └─md126              9:126  0  1023M  0 raid1 /boot
├─nvme0n1p2          259:6    0   201M  0 part
│ └─md125              9:125  0   201M  0 raid1 /boot/efi
└─nvme0n1p3          259:8    0 893.1G  0 part
  └─md127              9:127  0   893G  0 raid1
    ├─centos-root    253:0    0   200G  0 lvm   /
    ├─centos-swap    253:1    0   256G  0 lvm   [SWAP]
    ├─centos-tmp     253:3    0   100G  0 lvm   /tmp
    └─centos-scratch 253:4    0   300G  0 lvm   /scratch
nvme1n1              259:1    0 894.3G  0 disk
├─nvme1n1p1          259:3    0     1G  0 part
│ └─md126              9:126  0  1023M  0 raid1 /boot
├─nvme1n1p2          259:5    0   201M  0 part
│ └─md125              9:125  0   201M  0 raid1 /boot/efi
└─nvme1n1p3          259:7    0 893.1G  0 part
  └─md127              9:127  0   893G  0 raid1
    ├─centos-root    253:0    0   200G  0 lvm   /
    ├─centos-swap    253:1    0   256G  0 lvm   [SWAP]
    ├─centos-tmp     253:3    0   100G  0 lvm   /tmp
    └─centos-scratch 253:4    0   300G  0 lvm   /scratch

I am struggling to determine how to shrink the size of /scratch by 100GB, and increase the size of /tmp by 100GB. fdisk cannot find a partition map:

[root /tmp]# fdisk /dev/md127
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0x6fb1c8c6.

Command (m for help): p

Disk /dev/md127: 958.8 GB, 958774902784 bytes, 1872607232 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: 0x6fb1c8c6

      Device Boot      Start         End      Blocks   Id  System

I am able to take the machines offline for this procedure, but am unclear on where to start. How would one shrink the size of one volume on a RAID-1 and extend another volume with that space?

Read more here: Source link