pvresize, resize 8e Linux LVM partition
Hello.
Trying to figure out how to resize LVM partition.
I cloned hard drive using Acronis True Image and now have some space after LVM partition.
As I see, before run pvresize I need to resize partition itself. Which tool can help me to do it? man pvresize refers to fdisk, but I can't understand how to use it for resize.
Simply running pvresize does nothing.
Actually I am trying to build some pipeline to quick make a test and production box from development one. I can make it manually by creating new pv and dump/restore, but its a 3 page of commands. And I still cant figure out that is the right tool for ext3 dump/restore.
Another way is create new pv in free space and add it to volume group
- but after that this box will be a little different from the original one, thus I need additional tracking of its configuration.
Thank you.
Signature · 1 line
Stanislaw Senotrusov
Quoted 10 lines · Stanislaw Senotrusov
Hello.
Trying to figure out how to resize LVM partition.
I cloned hard drive using Acronis True Image and now have some space after LVM partition.
As I see, before run pvresize I need to resize partition itself. Which tool can help me to do it? man pvresize refers to fdisk, but I can't understand how to use it for resize.
fdisk does not have a resize function. Delete the existing partition and recreate it, but bigger. Be ***VERY*** careful; the most important thing is that the new partition must *begin* exactly where the old one did.
I would recommend writting down the cylinder numbers of the partition before deleting it.
Quoted 1 line
Simply running pvresize does nothing.
Yup. That's because he PV is already the full size of the partition it's living on. Although this is a case where using the disk raw would make things easier (you could run pvresize without having to alter the partition first), I would never recommend it.
Quoted 4 lines
Actually I am trying to build some pipeline to quick make a test and production box from development one. I can make it manually by creating new pv and dump/restore, but its a 3 page of commands. And I still cant figure out that is the right tool for ext3 dump/restore.
Are you talking about data on the LVs you want to copy? Are you also including the entire OS?
Here is how I would do it:
1. Kickstart install of new box (sets up LVM, includes packages, etc.)
2. Run a script to install all of the needed configuration files for all the services the new server needs (could be run as part of the Kickstart).
3. Copy the data the services will be "serving" to the new machine.
There are lots of ways to do step 3. Personally, I like to avoid as much of computational overhead as possible at this stage, so I like NFS mounting and "cp -a". Plain, simple, fast and comprehensive. YMMV.
Quoted 3 lines
Another way is create new pv in free space and add it to volume group
- but after that this box will be a little different from the original one, thus I need additional tracking of its configuration.
I think you're right, that's not the right way to do it.
Signature · 10 lines
Lamont R. Peterson <[email protected]> Founder [ http://blog.OpenBrainstem.net/peregrine/ ] GPG Key fingerprint: 0E35 93C5 4249 49F0 EC7B 4DDD BE46 4732 6460 CCB5 ___ ____ _ _ / _ \ _ __ ___ _ __ | __ ) _ __ __ _(_)_ __ ___| |_ ___ _ __ ___ | | | | '_ \ / _ \ '_ \| _ \| '__/ _` | | '_ \/ __| __/ _ \ '_ ` _ \ | |_| | |_) | __/ | | | |_) | | | (_| | | | | \__ \ || __/ | | | | | \___/| .__/ \___|_| |_|____/|_| \__,_|_|_| |_|___/\__\___|_| |_| |_| |_| Intelligent Open Source Software Engineering [ http://www.OpenBrainstem.net/ ]
Quoted 10 lines · Lamont R. Peterson
Here is how I would do it:
1. Kickstart install of new box (sets up LVM, includes packages, etc.)
2. Run a script to install all of the needed configuration files for all the services the new server needs (could be run as part of the Kickstart).
3. Copy the data the services will be "serving" to the new machine.There are lots of ways to do step 3. Personally, I like to avoid as much of computational overhead as possible at this stage, so I like NFS mounting and "cp -a". Plain, simple, fast and comprehensive. YMMV.
Thank you for the letter, Lamont!
Procedure you described requires a so much time to complete.
Tomorrow I end up the following pipeline:
1. Create only one 4Gb plain root partition (no LVM) which holds a entire system and my application. It's used in a development and test environment. The actual stored data is about a 1.5 Gb. I am pretty sure the base system it never fills entire 4 Gb in my case.
2. To build a production server I am bytecopy the root partition to a new box (only a few minutes), boot from it, create LVM in a free space and moves application from root to LVM.
Production database now have space to grow. Also I get rid of equal UUID problem.
Additionally there is no need for kickstart process is VM environment
- I just need to setup OS one time, and then when I need another box I just clone initial setup - it takes a few second. For testing and development VM overhead is ok.
--
Stas Senotrusov