Split LVM2 partition while server is online
I need to split one of my big partitions without data loss while the server is running,
here is my df -h output: Filesystem Size Used Avail Use% Mounted on /dev/pve/root 95G 756M 89G 1% / tmpfs 1003M 0 1003M 0% /lib/init/rw udev 10M 2.7M 7.4M 27% /dev tmpfs 1003M 4.0K 1003M 1% /dev/shm /dev/mapper/pve-data 356G 52G 304G 15% /var/lib/vz /dev/sda1 504M 32M 448M 7% /boot I want to make a little partition from /dev/mapper/pve-data with size of 50 GB while the other files on that partition remain untouched, |
Provide the output of pvdisplay and lvdisplay, as well as your fstab.
|
Quote:
--- Physical volume --- PV Name /dev/sda2 VG Name pve PV Size 465.26 GB / not usable 1.50 MB Allocatable yes PE Size (KByte) 4096 Total PE 119106 Free PE 1023 Allocated PE 118083 PV UUID JQbm22-HZ2o-hn1z-78iK-yZCO-XZc9-MOcNCz ------------------------------------------------- lvdisplay --- Logical volume --- LV Name /dev/pve/swap VG Name pve LV UUID Cthq3b-q4un-xsLq-UyZa-iLD6-vKY4-Bb81RV LV Write Access read/write LV Status available # open 1 LV Size 4.00 GB Current LE 1024 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:0 --- Logical volume --- LV Name /dev/pve/root VG Name pve LV UUID M9z3ZZ-fg0J-eEJ0-meT1-NgMo-GhOR-BUOy4x LV Write Access read/write LV Status available # open 1 LV Size 96.00 GB Current LE 24576 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:1 --- Logical volume --- LV Name /dev/pve/data VG Name pve LV UUID rESyJk-R2hc-VgDj-9V50-5FLh-yA6c-nKy5wk LV Write Access read/write LV Status available # open 1 LV Size 361.26 GB Current LE 92483 Segments 1 Allocation inherit Read ahead sectors auto - currently set to 256 Block device 253:2 unfortunately fstab is not installed on my debian. |
fstab is a file:
/etc/fstab |
Quote:
/dev/pve/root / ext3 errors=remount-ro 0 1 /dev/pve/data /var/lib/vz ext3 defaults 0 1 UUID=09591461-2abf-4d56-9d02-e40591f70c32 /boot ext3 defaults 0 1 /dev/pve/swap none swap sw 0 0 proc /proc proc defaults 0 0 |
So you need to shrink the ext3 parition that is in /dev/pve/data:
http://www.howtoforge.com/linux_resi...xt3_partitions Then resize the lv container itself with lvresize. Then create a new lv in the available extra space left in the pv. |
Quote:
|
You can have as many Logical Volumes (as you are using lvm) as you wish, these are not the same as disk paritions.
If you were using disk partitions then you would be limited to 4 primary partitions, But a primary partition can be an extended partition which may contain more logical partitions, but these are still not the same as LVM logical volumes. |
Quote:
|
All times are GMT -5. The time now is 04:15 AM. |