Hallo,
grundsätzlich ist der Ablauf so wohl machbar, nur fehlen zwischen 1. und 2. noch ein paar essentielle Zwischenschritte. Der letzte Punkt, das Erweitern des Root Filesystems, fehlt auch in der Liste.
In On LVM, RAIDs, and Resizing Partitions hat jemad seine Erfahrungen beschrieben.
Hilfestellung für parted finden Sie z.B. in http://www.gnu.org/software/parted/manual/html_chapter/parted_2.html
Im folgenden Transkript bin ich mal einen anfänglich anderen Weg gegangen und habe auf dem Testsystem einfach eine zweite virtuelle Platte /dev/vdb mit 10GB hinzugefügt und meine Root-Partition um 5GB erweitert.
Ob Sie am Ende wirklich - wie gezeigt - eine Online-Vergrößerung riskieren oder sicherheitshalber das System extern booten und dann vergrößern wollen, entscheiden Sie bitte selbst.
root@slave1:~# fdisk -l /dev/vdb
Disk /dev/vdb: 10.7 GB, 10737417728 bytes
16 heads, 63 sectors/track, 20805 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Disk /dev/vdb doesn't contain a valid partition table
root@slave1:~# parted /dev/vdb
GNU Parted 2.3
Using /dev/vdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Error: /dev/vdb: unrecognised disk label
(parted) mklabel gpt
(parted) print
Model: Virtio Block Device (virtblk)
Disk /dev/vdb: 10.7GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
(parted) unit %
(parted) mkpart primary 0 100%
(parted) print
Model: Virtio Block Device (virtblk)
Disk /dev/vdb: 100%
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 0.01% 100% 100% primary
(parted) quit
Information: You may need to update /etc/fstab.
root@slave1:~# fdisk -l /dev/vdb
WARNING: GPT (GUID Partition Table) detected on '/dev/vdb'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/vdb: 10.7 GB, 10737417728 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/vdb1 1 1306 10485759 ee GPT
root@slave1:~# pvdisplay
--- Physical volume ---
PV Name /dev/vda4
VG Name vg_ucs
PV Size 15.42 GiB / not usable 1.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 3947
Free PE 4
Allocated PE 3943
PV UUID RYz71A-rfd3-fGxG-HRAv-Lvc0-AmK2-h5QZfP
root@slave1:~# pvcreate /dev/vdb1
Physical volume "/dev/vdb1" successfully created
root@slave1:~# pvdisplay
--- Physical volume ---
PV Name /dev/vda4
VG Name vg_ucs
PV Size 15.42 GiB / not usable 1.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 3947
Free PE 4
Allocated PE 3943
PV UUID RYz71A-rfd3-fGxG-HRAv-Lvc0-AmK2-h5QZfP
"/dev/vdb1" is a new physical volume of "10.00 GiB"
--- NEW Physical volume ---
PV Name /dev/vdb1
VG Name
PV Size 10.00 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID uQCoz4-GiiL-f1XN-XLPg-ow8e-L7Ar-a0GoZ1
root@slave1:~# vgdisplay
--- Volume group ---
VG Name vg_ucs
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 2
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 1
Act PV 1
VG Size 15.42 GiB
PE Size 4.00 MiB
Total PE 3947
Alloc PE / Size 3943 / 15.40 GiB
Free PE / Size 4 / 16.00 MiB
VG UUID 5lIJxp-6JhB-5d1e-S4hc-blLF-TG1F-loF6A4
root@slave1:~# vgextend vg_ucs /dev/vdb1
Volume group "vg_ucs" successfully extended
root@slave1:~# vgdisplay
--- Volume group ---
VG Name vg_ucs
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 1
Max PV 0
Cur PV 2
Act PV 2
VG Size 25.41 GiB
PE Size 4.00 MiB
Total PE 6506
Alloc PE / Size 3943 / 15.40 GiB
Free PE / Size 2563 / 10.01 GiB
VG UUID 5lIJxp-6JhB-5d1e-S4hc-blLF-TG1F-loF6A4
root@slave1:~# lvdisplay
--- Logical volume ---
LV Name /dev/vg_ucs/rootfs
VG Name vg_ucs
LV UUID QZRvV1-pToH-2MhQ-nuDI-v6xG-DFIS-VdMNt4
LV Write Access read/write
LV Status available
# open 1
LV Size 15.40 GiB
Current LE 3943
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
root@slave1:~# lvextend -L +5G /dev/vg_ucs/rootfs
Extending logical volume rootfs to 20.40 GiB
Logical volume rootfs successfully resized
root@slave1:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg_ucs-rootfs
15896992 3182348 11907120 22% /
tmpfs 1030504 0 1030504 0% /lib/init/rw
udev 1020092 160 1019932 1% /dev
tmpfs 1030504 0 1030504 0% /dev/shm
/dev/vda2 516040 70356 419472 15% /boot
root@slave1:~# resize2fs -p /dev/mapper/vg_ucs-rootfs
resize2fs 1.41.12 (17-May-2010)
Filesystem at /dev/mapper/vg_ucs-rootfs is mounted on /; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 2
Performing an on-line resize of /dev/mapper/vg_ucs-rootfs to 5348352 (4k) blocks.
The filesystem on /dev/mapper/vg_ucs-rootfs is now 5348352 blocks long.
root@slave1:~# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/vg_ucs-rootfs
21058060 3186244 16807332 16% /
tmpfs 1030504 0 1030504 0% /lib/init/rw
udev 1020092 160 1019932 1% /dev
tmpfs 1030504 0 1030504 0% /dev/shm
/dev/vda2 516040 70356 419472 15% /boot
Viele Grüße,
Dirk Ahrnke