Wir haben einen RHEL 7 Server mit 2 Festplatten ( sdaund sdb). Unsere /, /var/logund swapsind auf sda, /varist auf sdb. Wir verwenden LVM und XFS.
sdaist zu groß (160 GB) und wir möchten es auf 40 GB verkleinern. Wir können dann die kostenlosen 120 GB zum Erweitern verwenden sdb.
[root@foo ~]# pvs
PV VG Fmt Attr PSize PFree
/dev/sda2 rhel lvm2 a-- 134.77g 9.77g
/dev/sdb1 vg_var lvm2 a-- 200.00g 0
[root@foo ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root rhel -wi-ao---- 117.19g
swap rhel -wi-ao---- 3.91g
var_log rhel -wi-ao---- 3.91g
lv_var vg_var -wi-ao---- 200.00g
[root@foo ~]# fdisk -l
Disk /dev/sdb: 214.7 GB, 214748364800 bytes, 419430400 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x3235298e
Device Boot Start End Blocks Id System
/dev/sdb1 2048 419430399 209714176 8e Linux LVM
Disk /dev/sda: 161.1 GB, 161061273600 bytes, 314572800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: dos
Disk identifier: 0x0009b153
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 283656191 141315072 8e Linux LVM
Disk /dev/mapper/rhel-root: 125.8 GB, 125829120000 bytes, 245760000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/rhel-swap: 4194 MB, 4194304000 bytes, 8192000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/vg_var-lv_var: 214.7 GB, 214744170496 bytes, 419422208 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/rhel-var_log: 4194 MB, 4194304000 bytes, 8192000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Wie können wir dies sicher erreichen? Ich habe dies mit einer Testmaschine versucht, aber es ist fehlgeschlagen:
- Fügen Sie eine neue Festplatte hinzu
- Erstellen Sie eine LVM-Partition, erstellen Sie eine neue LV und fügen Sie eine neue LV hinzu.
- Booten Sie mit der Rettungsdiskette
- Montieren Sie
sdaauf/mnt/sysimageund montieren Sie den LV der neuen Festplatte/mnt/sdb cp -ax /mnt/sysimage/* /mnt/sdb- Update
/mnt/sysimage/etc/fstabzur Verwendung/dev/mapper/rhel-lv_root - Schließlich schlägt der Neustart aufgrund von fehl
INT18 boot failure