Jump to content

LVM questions

So, i assume i am not the first to ask it here, but i did not manage to find any proper answer...

 

some background (not vital to my question):

I have been an advanced system administrator for a government company for almost 3 years now, "mastering" in linux, vmware, netapp, windows, hardware and more...

I have a fair amount of technical background, and fluent in the technical lingual...

 

To my main question here:

Both at work and at my home server (running esxi 6.5), i have an Ubuntu server, both at work and at home i encountered a dilemma so to say... should i extend the existing virtual disk, therefor extend the existing pv, vg and lv? or should i create a new virtual disk, extend the vg with it and then extend the lv?

at work we have a "suggested" way to do it, but it is only for the root drive, and we say to always add a new virtual disk, although i believe it is because of a trauma from working with esxi 5.0 back in the days, where extending disks would lead to all kind of problems...

I would really like a solid answer, from the technical side of it, so not like "its easier like that...", but like "this way increase the misalignment over the physical disks..." or something..

 

p.s. i want to know if it changes if i am doing it to the root partition, a data partition, or even a lvcached partition.

 

thanks. 

Link to comment
Share on other sites

Link to post
Share on other sites

depending on kernel/vm options... hot adding a new virtual drive can be easier than expanding because it could require a reboot to get the new space "seen".

 

If you know you can expand without needing a reboot of the VM.. then its really just personal preference.

 

 

Can Anybody Link A Virtual Machine while I go download some RAM?

 

Link to comment
Share on other sites

Link to post
Share on other sites

21 hours ago, unijab said:

depending on kernel/vm options... hot adding a new virtual drive can be easier than expanding because it could require a reboot to get the new space "seen".

 

If you know you can expand without needing a reboot of the VM.. then its really just personal preference.

 

 

Thank you very much, the reboot is not my problem, my concern were the performance impact and ressiliancy and such

Link to comment
Share on other sites

Link to post
Share on other sites

Well, you can extend disk. However, if it's MBR, you can expand it 4 times (4 primary partitions) - each expansion is new partition, and new PV, which you use to extend VG.

I still would rather recommend new disk. This is also way we do it. Keep in mind that in some cases some people make PV on disk itself, rather than partition - in that case you cannot extend it.

 

Link to comment
Share on other sites

Link to post
Share on other sites

47 minutes ago, Nick7 said:

each expansion is new partition, and new PV, which you use to extend VG.

Incorrect

 

You can extend the partition easily if the lvm partition is the last one on the disk.

 

 

 

49 minutes ago, Nick7 said:

some people make PV on disk itself, rather than partition - in that case you cannot extend it.

Also untrue. There's a pv command for resizing

Can Anybody Link A Virtual Machine while I go download some RAM?

 

Link to comment
Share on other sites

Link to post
Share on other sites

19 minutes ago, unijab said:

Incorrect

 

You can extend the partition easily if the lvm partition is the last one on the disk.

Well, you *can* do it - but offline. You need to delete partition, and create new, bigger one.

To do it online, you need to add new partition (or new disk).

Link to comment
Share on other sites

Link to post
Share on other sites

Thank you for your help!

43 minutes ago, Nick7 said:

Well, you *can* do it - but offline. You need to delete partition, and create new, bigger one.

To do it online, you need to add new partition (or new disk).

 

1 hour ago, unijab said:

Incorrect

 

You can extend the partition easily if the lvm partition is the last one on the disk.

 

 

 

Also untrue. There's a pv command for resizing

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Nick7 said:

offline

Not sure what you mean by that but you just make the partition change, then reboot, and then extend the pv.

Can Anybody Link A Virtual Machine while I go download some RAM?

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, unijab said:

Not sure what you mean by that but you just make the partition change, then reboot, and then extend the pv.

Exactly that. You need to have filesystem offline (unmounted) while doing it this way.

By adding partition/disk - you can do it online, and resize filesystem online (FS is accessible at all times, no unmount, and especially no reboot).

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Nick7 said:

You need to have filesystem offline (unmounted) while doing it this way.

Nope

Can Anybody Link A Virtual Machine while I go download some RAM?

 

Link to comment
Share on other sites

Link to post
Share on other sites

7 minutes ago, unijab said:

Nope

Well, you are right.

I actually tested it now. You can do it that way too, online.

... though I don't like part of deleting/recreating partition in fdisk, but it works.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×