Situation
Ein Kunde hat seinen virtuellen Server eines Providers auf die neuste Version aktualisert. In dem neuen Paket ist eine grössere Festplatte enthalten. Aus diesem Grund muss die Partition, LVM und das Dateisystem vergrössert werden.
Parted
parted
GNU Parted 3.4
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)
p
Model: QEMU QEMU HARDDISK (scsi)
Disk /dev/sda: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 3146kB 2097kB grub bios_grub
2 3146kB 503MB 500MB ext4 boot boot, esp
3 503MB 10.7GB 10.2GB system
resizepart 3
End? [10.7GB]? 100%
p
Model: QEMU QEMU HARDDISK (scsi)
Disk /dev/sda: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 3146kB 2097kB grub bios_grub
2 3146kB 503MB 500MB ext4 boot boot, esp
3 503MB 21.5GB 21.0GB system
q
LVM
pvs
PV VG Fmt Attr PSize PFree
/dev/mapper/sdb3_crypt lvm lvm2 a-- 9.51g 0
pvresize /dev/mapper/sdb3_crypt
Physical volume "/dev/mapper/sdb3_crypt" changed
1 physical volume(s) resized or updated / 0 physical volume(s) not resized
pvs
PV VG Fmt Attr PSize PFree
/dev/mapper/sdb3_crypt lvm lvm2 a-- 19.51g 10.00g
vgdisplay lvm
--- Volume group ---
VG Name lvm
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size 19.51 GiB
PE Size 4.00 MiB
Total PE 4995
Alloc PE / Size 2435 / 9.51 GiB
Free PE / Size 2560 / 10.00 GiB
lvchange -a y lvm
lvextend -l +100%FREE /dev/mapper/lvm-root
Size of logical volume lvm/root changed from 9.02 GiB (2310 extents) to 19.02 GiB (4870 extents).
Logical volume lvm/root successfully resized.
Dateisystem
e2fsck -f /dev/mapper/lvm-root
e2fsck 1.44.5 (15-Dec-2018)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
root: 47743/592176 files (0.3% non-contiguous), 1610082/2365440 blocks
resize2fs -p /dev/mapper/lvm-root
resize2fs 1.44.5 (15-Dec-2018)
Resizing the filesystem on /dev/mapper/lvm-root to 4986880 (4k) blocks.
The filesystem on /dev/mapper/lvm-root is now 4986880 (4k) blocks long.
To view this entry in full, you must be a customer of Securebit AG. You can order any product from our range.
If you are already a customer, you can log in
here.