-1

I am running a debian server on Windows in Hyper-V, I have expanded the Hyper-V partition to 2T, now I would like to expand the Debian partition to use that new space. The new space will be for videos, so I am thinking the easiest thing to do is simply create a new partition and mount that and save the video in the partition. I am running from the cmd line, so I need some assistence in creating the partition. I have both fdisk and parted install. Here is the current state of things:

Disk /dev/sda: 2 TiB, 2199023255552 bytes, 4294967296 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
Disklabel type: dos
Disk identifier: 0x8427e4f2

Device     Boot  Start       End   Sectors   Size Id Type
/dev/sda1  *      2048    499711    497664   243M 83 Linux
/dev/sda2       501758 266336255 265834498 126.8G  5 Extended
/dev/sda5       501760 266336255 265834496 126.8G 8e Linux LVM

Partition 2 does not start on physical sector boundary.



Disk /dev/mapper/UniFiServer--vg-root: 124.8 GiB, 133957681152 bytes, 261636096 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/UniFiServer--vg-swap_1: 2 GiB, 2147483648 bytes, 4194304 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

I have made some progress, it appears that I succeeded in using parted to actually extend /dev/sda2 & /dev/sda5 and with the help of Romeo, used pvresize to extend them to show 2T, now I just need some help on actually creating something I can use, the lvcreate command isn't working:

Disk /dev/sda: 2 TiB, 2199023255552 bytes, 4294967296 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
Disklabel type: dos
Disk identifier: 0x8427e4f2

Device     Boot  Start        End    Sectors  Size Id Type
/dev/sda1  *      2048     499711     497664  243M 83 Linux
/dev/sda2       501758 4294921875 4294420118    2T  5 Extended
/dev/sda5       501760 4294921875 4294420116    2T 8e Linux LVM

Partition 2 does not start on physical sector boundary.




Disk /dev/mapper/UniFiServer--vg-root: 124.8 GiB, 133957681152 bytes, 261636096 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/UniFiServer--vg-swap_1: 2 GiB, 2147483648 bytes, 4194304 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

$ sudo vgs
VG             #PV #LV #SN Attr   VSize VFree
UniFiServer-vg   1   2   0 wz--n- 2.00t 1.88t

$ sudo lvcreate -L 1.88t --name videodata UniFiServer--vg
  Volume group "UniFiServer--vg" not found
  Cannot process volume group UniFiServer--vg
1

You should run pvresize to extend the PV

pvresize /dev/sda5

Then you can check the new size of VG

vgs

Then you can create new LV

lvcreate -L <size of the new volume> --name <name of volume> UniFiServer-vg

Then you should format and mount this new volume. And do not forget to edit /etcfstab to mount it on every boot

  • When I do the pvresize command, it says "1 physical volume(s) resized / 0 physical volume(s) not resized" and vgs returns the same VSize of 126.76g. Don't I need to use fdisk to extend the logical partition or something first? – Sam Carleton May 30 at 10:41
  • check with pws if PV is really resized and how much – Romeo Ninov May 30 at 11:08
  • @SamCarleton, will edit my answer to make your last command successful – Romeo Ninov May 30 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.