Entire HDD is one big lvm2-pv, hence unable to resize partitions or even bring back Windows

724

LVM has concepts of a physical volume and logical volume. You can resize logical volumes and even move them between physical drives (each with a physical volume), as much as you like. But that is only affecting the logical volumes, and you can't install Windows inside one. To install Windows, you have to put it in a bare partition without LVM that Windows can boot to.

LVM's not really designed to be able to easily resize or move physical volumes. It's designed for environments where you just throw a new physical drive in and start migrating. Manipulating a physical volume on an existing drive can be done, but it's complicated and if done wrong you can lose everything.

One alternative way to do this would be to migrate everything off the drive onto a portable or second drive, then reformat the first without LVM, partition it how you like (with a Windows partition) and then migrate back. You could decide you don't want the hassle of LVM and migrate raw. Still fairly involved though, as you still need to know how to resize partitions and do a raw block copy of a partition, and if you use LVM on your temporary drive you'll need to boot with a boot CD and mount an LVM volume manually, which is hair-raisingly tricky. I've done it before with the added complication of luks encryption, which adds another layer of complexity.

If you want to resize the LVM physical volume in-place, you can follow some of these instructions. It'll be faster but you have to be careful.

How can I resize an LVM partition? (i.e: physical volume)

Backup first as it's easy to make a mistake in which you lose your data.

Share:
724

Related videos on Youtube

Simon
Author by

Simon

Updated on September 18, 2022

Comments

  • Simon
    Simon over 1 year

    I am working on an Angular 5 project and I'm trying to filter an array.

    I have an array of objects. An object has the property color. I am iterating over my array and I want to get all objects with the same color of my current object in the array. With the code below I seem to get only the first hit in the array and not all the elements.

    This is my current code.

    for(let object of this.objects){
    let a: any = this.objects.find( a => a.color === object.color )
    console.log(a);
    // Do other stuff
    }
    

    Any idea how to solve this?

    Thank you.

  • Kaz Wolfe
    Kaz Wolfe over 9 years
    Can you integrate a summary of the linked content into the post? If said link does, this answer is useless. :(
  • thomasrutter
    thomasrutter over 6 years
    What the OP needs is to reduce the size of the physical volume (pv). This won't help with that. He won't be able to install Windows on an LVM logical volume.