TL;DR: How to combine RAID + LVM partitions online (not touching rootfs)?
I have a server which was used for something else before and had a certain partition structure create. df -h
shows
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/raid1-rootfs
50G 28G 20G 59% /
tmpfs 16G 0 16G 0% /lib/init/rw
udev 16G 152K 16G 1% /dev
tmpfs 16G 624K 16G 1% /dev/shm
/dev/md0 460M 29M 408M 7% /boot
/dev/mapper/raid1-data
99G 20G 74G 22% /data
/dev/mapper/raid1-mysql
99G 4.6G 89G 5% /data/mysql
/dev/mapper/raid1-backup
99G 664M 93G 1% /data/backup
/dev/mapper/raid1-activemq
99G 188M 94G 1% /data/activemq
/dev/mapper/raid1-backups
1.0T 651G 373G 64% /backup
Basically I do not need the different /data
partitions anymore. I mainly need if to store backups in the last partition mounted at /backup
.
In order to have more disk space there I would like to add the 4*99G
of the partitions above it to /backup
.
It would also be fine to combine them in a separate partition, I could mount some sub-dir to it then.
The disk is mirrored and has LVM apparently.
I am a bit lost on how to do it, I would like to be able to do it online, I do not have physical access.
Can you explain or guide me how this can be achieved?
PS:
fdisk -l
tells me:
WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted
lvdisplay
output:
--- Logical volume ---
LV Name /dev/raid1/swap
VG Name raid1
LV UUID gOtYhu-oORL-JZRy-inlb-hlyn-0qGU-SBxYo3
LV Write Access read/write
LV Status available
# open 1
LV Size 4.00 GiB
Current LE 1024
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
--- Logical volume ---
LV Name /dev/raid1/rootfs
VG Name raid1
LV UUID Y3np5X-IyEn-WMGW-2t51-LIiX-9I8z-rnBXZp
LV Write Access read/write
LV Status available
# open 1
LV Size 50.00 GiB
Current LE 12800
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Name /dev/raid1/activemq
VG Name raid1
LV UUID 0mGA9R-wi89-adqN-oI2x-W24j-2qzD-pXJdNA
LV Write Access read/write
LV Status available
# open 1
LV Size 100.00 GiB
Current LE 25600
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:2
--- Logical volume ---
LV Name /dev/raid1/mysql
VG Name raid1
LV UUID D5dD6A-1TDZ-fKsO-pc1u-Xttm-Wb2K-RjqAJw
LV Write Access read/write
LV Status available
# open 1
LV Size 100.00 GiB
Current LE 25600
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:3
--- Logical volume ---
LV Name /dev/raid1/backup
VG Name raid1
LV UUID Brfzgy-nDWG-xyAD-b2a5-sTWf-T7hX-jZRiji
LV Write Access read/write
LV Status available
# open 1
LV Size 100.00 GiB
Current LE 25600
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:4
--- Logical volume ---
LV Name /dev/raid1/data
VG Name raid1
LV UUID JmF16w-jLJz-V3Is-WeTb-K0Qn-uG21-WhLWJY
LV Write Access read/write
LV Status available
# open 1
LV Size 100.00 GiB
Current LE 25600
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:6
--- Logical volume ---
LV Name /dev/raid1/storage
VG Name raid1
LV UUID 0qRsZl-Kbix-6dhc-g7UD-xJuG-tK3t-zP04fd
LV Write Access read/write
LV Status available
# open 1
LV Size 25.00 GiB
Current LE 6400
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:7
--- Logical volume ---
LV Name /dev/raid1/backups
VG Name raid1
LV UUID g3VgO6-QkEv-KlD4-Wo7N-0cvn-Aolg-1hz1P1
LV Write Access read/write
LV Status available
# open 1
LV Size 1.00 TiB
Current LE 262144
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:8
Note that there is one partition which is excluded from the output and is not relevant for this operation.
lvdisplay
to your question. – wurtel Nov 12 '15 at 12:57