lister171254
January 12th, 2016, 05:11 AM
I'm running my mailserver (Ubuntu 10.04 LTS 64 bit server edition) on a VPS and got the people hosting this service to extend the disk do 26GB (from 15)
I have boot root and swap partitions with swap and root encrypted
/dev/xvd already shows the extended size
llist@llmail:~$ sudo fdisk -l
Disk /dev/xvda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders, total 52428800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00027e1c
Device Boot Start End Blocks Id System
/dev/xvda1 * 2048 1075199 536576 83 Linux
/dev/xvda2 1075200 31455231 15190016 8e Linux LVM
llist@llmail:~$ sudo parted -l
Model: Linux device-mapper (crypt) (dm)
Disk /dev/mapper/EncrUbunt-swap_crypt: 998MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 998MB 998MB linux-swap(v1)
Model: Linux device-mapper (crypt) (dm)
Disk /dev/mapper/EncrUbunt-EncrUbuntu_crypt: 14.6GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 14.6GB 14.6GB ext4
Error: /dev/mapper/EncrUbunt-swap: unrecognised disk label
Error: /dev/mapper/EncrUbunt-EncrUbuntu: unrecognised disk label
Model: Xen Virtual Block Device (xvd)
Disk /dev/xvda: 26.8GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 551MB 549MB primary ext4 boot
2 551MB 16.1GB 15.6GB primary lvm
llist@llmail:~$ sudo lvdisplay
--- Logical volume ---
LV Path /dev/EncrUbunt/swap
LV Name swap
VG Name EncrUbunt
LV UUID cU53xe-gBG3-Lgno-1Kfd-pseN-qckN-ZnuBMH
LV Write Access read/write
LV Creation host, time mail, 2014-05-01 22:30:40 +1000
LV Status available
# open 1
LV Size 952.00 MiB
Current LE 238
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:0
--- Logical volume ---
LV Path /dev/EncrUbunt/EncrUbuntu
LV Name EncrUbuntu
VG Name EncrUbunt
LV UUID XvqLCU-6LMr-AadR-uWrU-HGe8-zWwK-LZwIED
LV Write Access read/write
LV Creation host, time mail, 2014-05-01 22:31:22 +1000
LV Status available
# open 1
LV Size 13.55 GiB
Current LE 3470
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:1
While there seems to be a fair amount of 'HowTos' for this, most seem outdated (or wrong) and none specifically handle extending encrypted roots without dismount.
Do I need to extend /dev/xvda2 with parted and then use resize2fs or can I just extend with lvextend?
Thanks,
Leo
I have boot root and swap partitions with swap and root encrypted
/dev/xvd already shows the extended size
llist@llmail:~$ sudo fdisk -l
Disk /dev/xvda: 26.8 GB, 26843545600 bytes
255 heads, 63 sectors/track, 3263 cylinders, total 52428800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00027e1c
Device Boot Start End Blocks Id System
/dev/xvda1 * 2048 1075199 536576 83 Linux
/dev/xvda2 1075200 31455231 15190016 8e Linux LVM
llist@llmail:~$ sudo parted -l
Model: Linux device-mapper (crypt) (dm)
Disk /dev/mapper/EncrUbunt-swap_crypt: 998MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 998MB 998MB linux-swap(v1)
Model: Linux device-mapper (crypt) (dm)
Disk /dev/mapper/EncrUbunt-EncrUbuntu_crypt: 14.6GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 14.6GB 14.6GB ext4
Error: /dev/mapper/EncrUbunt-swap: unrecognised disk label
Error: /dev/mapper/EncrUbunt-EncrUbuntu: unrecognised disk label
Model: Xen Virtual Block Device (xvd)
Disk /dev/xvda: 26.8GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 1049kB 551MB 549MB primary ext4 boot
2 551MB 16.1GB 15.6GB primary lvm
llist@llmail:~$ sudo lvdisplay
--- Logical volume ---
LV Path /dev/EncrUbunt/swap
LV Name swap
VG Name EncrUbunt
LV UUID cU53xe-gBG3-Lgno-1Kfd-pseN-qckN-ZnuBMH
LV Write Access read/write
LV Creation host, time mail, 2014-05-01 22:30:40 +1000
LV Status available
# open 1
LV Size 952.00 MiB
Current LE 238
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:0
--- Logical volume ---
LV Path /dev/EncrUbunt/EncrUbuntu
LV Name EncrUbuntu
VG Name EncrUbunt
LV UUID XvqLCU-6LMr-AadR-uWrU-HGe8-zWwK-LZwIED
LV Write Access read/write
LV Creation host, time mail, 2014-05-01 22:31:22 +1000
LV Status available
# open 1
LV Size 13.55 GiB
Current LE 3470
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 252:1
While there seems to be a fair amount of 'HowTos' for this, most seem outdated (or wrong) and none specifically handle extending encrypted roots without dismount.
Do I need to extend /dev/xvda2 with parted and then use resize2fs or can I just extend with lvextend?
Thanks,
Leo