Page 1 of 1

Increasing Partition Sizes

Posted: 09 Mar 2014 17:34
by shawniverson
You may find after running E.F.A. for a while that you may need more capacity. Here's a how-to.

1) Shutdown MailScanner to halt mail processing

Code: Select all

sudo service MailScanner stop
2) Recommend a full backup before proceeding. (Don't snapshot, you won't be able to resize the disk...) This procedure varies depending on what type of virtualization/backup solution you are using.

3) Shutdown your system.

Code: Select all

sudo shutdown -h now
4) Increase the size of your virtual hard disk. In VMware...right click VM --> Edit Settings
disk resize
disk resize
vmdisk.PNG (29.15 KiB) Viewed 66832 times
Optionally, you can also add a new virtual hard disk to add capacity, in case your solution doesn't allow you to dynamically resize your virtual hard disk.

5) Start your EFA and have the console open. When the countdown appears, press a key to interrupt automatic boot
vmboot.PNG
vmboot.PNG (52.05 KiB) Viewed 66832 times
6) Press 'e' to edit the boot options, arrow down to the line starting with "kernel", press 'e' again, and add 'single' to the end of the line with a leading space
vmsingle.PNG
vmsingle.PNG (44.43 KiB) Viewed 66832 times
7) Press enter and 'b' to boot. This will take you to single user mode (init level 2)

8) On the commandline, launch fdisk

Code: Select all

fdisk /dev/sda
Press p <enter> to view existing partitions.

(note that if you added a new disk, the next disk will be /dev/sdb instead)
fdisk.PNG
fdisk.PNG (38.66 KiB) Viewed 66832 times
9) Create a new partition

9a) Press n to create a new partition

9b) If you already have 3 partitions, choose extended 'e' <enter>, otherwise choose primary 'p' <enter>

9c) Accept the default first cylinder <enter> and last cylinder <enter>
newpartition.PNG
newpartition.PNG (61.79 KiB) Viewed 66832 times
9d) If you created an extended partition in step 9b, create a new partition again, accepting defaults for cylinders.

9e) Press 'p' to view partitions again, and note the name of the new Linux partition. Press 't' <enter> to change the partition type.

9f) Choose the appropriate partition, press <enter>, and enter '8e' for the type <enter>
type.PNG
type.PNG (53.84 KiB) Viewed 66832 times
9g) Check your work with 'p' <enter>. If satisfied, type 'w' <enter> to save your work.

10) Reboot the system, and return to single user mode using steps 5-7.

11) Add the new partition to the LVM pool

Run pvcreate (changing /dev/sda5 with the name of your newly created partition)

Code: Select all

pvcreate /dev/sda5

Code: Select all

pvdisplay
pvdisplay.PNG
pvdisplay.PNG (36.32 KiB) Viewed 66832 times
You should see a new PV. Now add the PV to the volume group, replacing /dev/sda5 with your partition.

Code: Select all

vgextend vg_00 /dev/sda5

Code: Select all

pvdisplay
pvdisplay2.PNG
pvdisplay2.PNG (41.13 KiB) Viewed 66832 times
12) Now it is time to resize the logical volume. I will demonstrate with /tmp (you can also increase /var or / this way). Because these volumes are mounted, we will perform a live resize.

Code: Select all

lvdisplay
lvdisplay.PNG
lvdisplay.PNG (32.25 KiB) Viewed 66832 times
13) Making note of the LV Path, execute the following, substituting the device and size that you desire

Code: Select all

lvextend -r /dev/vg_00/lv_tmp -L +10G
lvresize.PNG
lvresize.PNG (31.4 KiB) Viewed 66832 times
14) Reboot the system.

Code: Select all

shutdown -r now

Re: Increasing Partition Sizes

Posted: 19 May 2014 20:10
by microcore
Why the EFA dont has pvextend command?

Thank

Re: Increasing Partition Sizes

Posted: 21 May 2014 01:17
by shawniverson
I have pvextend command. Is it not present?

Re: Increasing Partition Sizes

Posted: 04 Aug 2014 16:01
by david
also in my installation, command pvextend is not present. I used vgextend and worked properly.

Re: Increasing Partition Sizes

Posted: 05 Aug 2014 11:15
by Widmo
lvextend maybe?

Re: Increasing Partition Sizes

Posted: 05 Aug 2014 11:22
by david
vgextend vg_00 /dev/sda5

Re: Increasing Partition Sizes

Posted: 21 Aug 2014 18:05
by dbator
I also did not have the pvextend command. vgextend worked perfectly.

Other than that, thank you for this tutorial! very, very helpful

Re: Increasing Partition Sizes

Posted: 24 Aug 2014 13:30
by shawniverson
Updated how-to to use vgextend :) :) :)

Re: Increasing Partition Sizes

Posted: 23 Oct 2015 00:38
by blobb
The instructions above are awesome... but I changed them a little...

I increased the storage in VMware
then booted to GParted Live.
The extended the var group by the amount I increased the partition.

This worked. Thanks from the instructions

Re: Increasing Partition Sizes

Posted: 14 Mar 2016 14:14
by DrDomino
worked perfectly
thank you

Re: Increasing Partition Sizes

Posted: 27 Sep 2016 19:05
by yahav02
hi
Is it possible to build OVF file with 100 GB VAR folder?

Re: Increasing Partition Sizes

Posted: 27 Sep 2016 22:01
by shawniverson
The 3.0.1.5 ovf is 100GB now.

Re: Increasing Partition Sizes

Posted: 05 Nov 2016 19:01
by webguyz
The downloads section OVF files all have a version of 3.0.0.9. Where do you get a version 3.0.1.5 that has the larger partition?

Never mind! There is a link at the bottom of each message :-)

Thanks for this great utility!!

Re: Increasing Partition Sizes

Posted: 21 Jan 2018 07:27
by mavelit
Great guide!,
i would remenber to use last command :
resize2fs /dev/vg_00/lv_tmp
or
resize2fs /dev/vg_00/lv_var

for complete the extension of fs.
bye!

Re: Increasing Partition Sizes

Posted: 25 Dec 2018 14:55
by bikertrash
Sorry to report... none of this worked... restoring the entire device from a backup copy...

Is there a thread thart's a little more up to date??

Re: Increasing Partition Sizes

Posted: 26 Dec 2018 11:09
by shawniverson
bikertrash wrote: 25 Dec 2018 14:55 Sorry to report... none of this worked... restoring the entire device from a backup copy...

Is there a thread thart's a little more up to date??
What went wrong?

Re: Increasing Partition Sizes

Posted: 26 Dec 2018 12:52
by bikertrash
I kept bang'n on it until I figured it out (thanks to the URL listed above). I had problems trying to identify the partitions. :whistle:

I may still completely re-deploy in the near future though... as I'd really like to try and turn this guy into a full-on mail server so that I can ditch the outdated Exchange Server inside the network.

For the record... this server has been working flawlessly for several years now and pretty much NOTHING gets past it... :clap: