Wissensdatenbank
Buehl, Kevin
23 August 2017
23 August 2017
1.445

Wissensdatenbank

CentOs logisches Volume entfernen und zu root hinzufügen

Vorwort


Ich habe einen Linux CentOs Server und möchte die /home Partition auflösen und zu der Root-Partition hinzufügen.

Logisches Volume


anzeigen


Zuerst sollten Sie den Namen des logischen Volumes auslesen:
lvdisplay
  --- Logical volume ---
LV Path /dev/cl/swap
LV Name swap
VG Name cl
LV UUID N3Nb18-A7Gp-EAo9-WT5e-czQb-6D2b-d2ykRB
LV Write Access read/write
LV Creation host, time 4b42.net, 2017-08-23 23:13:31 +0200
LV Status available
# open 2
LV Size 3.88 GiB
Current LE 992
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:1

--- Logical volume ---
LV Path /dev/cl/home
LV Name home
VG Name cl
LV UUID RQwRAW-x2tU-sPwX-ABo8-jD3z-7167-K49NFH
LV Write Access read/write
LV Creation host, time 4b42.net, 2017-08-23 23:13:31 +0200
LV Status available
# open 1
LV Size 22.84 GiB
Current LE 5847
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:2

--- Logical volume ---
LV Path /dev/cl/root
LV Name root
VG Name cl
LV UUID klNqPW-r0Qs-RVhL-hinx-01YC-nQ2X-0jz5tD
LV Write Access read/write
LV Creation host, time 4b42.net, 2017-08-23 23:13:32 +0200
LV Status available
# open 1
LV Size 46.79 GiB
Current LE 11977
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0


entfernen


Damit Sie das VOlume löschen können müssen Sie dieses aushängen:
umount /home/
lvremove /dev/mapper/cl-home
Do you really want to remove active logical volume cl/home? [y/n]: y
Logical volume "home" successfully removed


vergrössern


lvextend -l +100%FREE -r /dev/mapper/cl-root
  Size of logical volume cl/root changed from 46.79 GiB (11977 extents) to 69.63 GiB (17825 extents).
Logical volume cl/root successfully resized.
meta-data=/dev/mapper/cl-root isize=512 agcount=4, agsize=3066112 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=0 spinodes=0
data = bsize=4096 blocks=12264448, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=1
log =Intern bsize=4096 blocks=5988, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =keine extsz=4096 blocks=0, rtextents=0
Datenblöcke von 12264448 auf 18252800 geändert.