Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

This is how my 2 TB (GPT) hard disk looks like

sda1 1    MiB Bios_boot
sda2 1024 GB LVM --- vg1 1024 GB --- lv1 24   GB ext4
                                     lv2 1000 GB ext4
     800  GB unallocated
sda3 200  GB ext4

What is the safest or better way to add 512 GB to lv2 ?

  1. Resize sda2 to be 512 GB bigger with parted or gdisk and then pvresize, lvresize, resize2fs.
  2. Create a new partition in the unallocated space, initialize it as a new pv and add it to the vg, then lvresize, resize2fs.

What's the best alternative? Are there performance penalties if the 2nd option is used?

Thank you

share|improve this question

1 Answer 1

Resize sda2 to be 512 GB bigger with parted or gdisk and then pvresize, lvresize, resize2fs.

This is fastest and easiest.

The only caveat is that the filesystem should not be mounted while you are working on resizing it this way. If it's your root filesystem, then you'll need to do this work from a Live CD.

share|improve this answer
    
Thank you for your help. Anyways I'm a little afraid. Can I lose my data if I employ this method? or it is 100% or 99% safe? did you ever try it? how should the resizing of the partition should be done? erasing it and creating it with a bigger end sector? Thanks –  cronilus Aug 3 '12 at 12:27
    
You risk losing your data every day by turning your computer on and accidentally typing the wrong thing or clicking your mouse in the wrong places. This is reasonably safe, but if you've never done it before, then double check what you're doing. –  Michael Hampton Aug 3 '12 at 20:12
    
thanks, but how the resizing of the partition should be done? erasing it and creating it with a bigger end sector? What are the benefits over method 2? are there any? –  cronilus Aug 6 '12 at 5:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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