Increasing Partition Sizes

Questions and answers about how to do stuff
Post Reply
User avatar
shawniverson
Posts: 3573
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Increasing Partition Sizes

Post 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 56224 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 56224 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 56224 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 56224 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 56224 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 56224 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 56224 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 56224 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 56224 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 56224 times
14) Reboot the system.

Code: Select all

shutdown -r now
microcore
Posts: 7
Joined: 10 Mar 2014 20:51

Re: Increasing Partition Sizes

Post by microcore »

Why the EFA dont has pvextend command?

Thank
User avatar
shawniverson
Posts: 3573
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Increasing Partition Sizes

Post by shawniverson »

I have pvextend command. Is it not present?
david
Posts: 6
Joined: 31 Mar 2014 13:32
Location: Los Cristianos, Tenerife, Spain

Re: Increasing Partition Sizes

Post by david »

also in my installation, command pvextend is not present. I used vgextend and worked properly.
Widmo
Posts: 17
Joined: 23 Jun 2014 12:45

Re: Increasing Partition Sizes

Post by Widmo »

lvextend maybe?
david
Posts: 6
Joined: 31 Mar 2014 13:32
Location: Los Cristianos, Tenerife, Spain

Re: Increasing Partition Sizes

Post by david »

vgextend vg_00 /dev/sda5
dbator
Posts: 35
Joined: 20 Aug 2014 19:18

Re: Increasing Partition Sizes

Post by dbator »

I also did not have the pvextend command. vgextend worked perfectly.

Other than that, thank you for this tutorial! very, very helpful
User avatar
shawniverson
Posts: 3573
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Increasing Partition Sizes

Post by shawniverson »

Updated how-to to use vgextend :) :) :)
blobb
Posts: 4
Joined: 21 Jun 2014 21:47

Re: Increasing Partition Sizes

Post 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
DrDomino
Posts: 5
Joined: 14 Mar 2016 12:51

Re: Increasing Partition Sizes

Post by DrDomino »

worked perfectly
thank you
yahav02
Posts: 4
Joined: 26 Sep 2016 19:55

Re: Increasing Partition Sizes

Post by yahav02 »

hi
Is it possible to build OVF file with 100 GB VAR folder?
User avatar
shawniverson
Posts: 3573
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Increasing Partition Sizes

Post by shawniverson »

The 3.0.1.5 ovf is 100GB now.
webguyz
Posts: 61
Joined: 26 Oct 2016 02:17

Re: Increasing Partition Sizes

Post 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!!
mavelit
Posts: 1
Joined: 21 Jan 2018 07:13

Re: Increasing Partition Sizes

Post 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!
User avatar
bikertrash
Posts: 49
Joined: 03 Feb 2016 12:53
Location: San Diego, CA
Contact:

Re: Increasing Partition Sizes

Post 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??
"If it ain't broke, it needs a lot more fix'n."
User avatar
shawniverson
Posts: 3573
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Increasing Partition Sizes

Post 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?
User avatar
bikertrash
Posts: 49
Joined: 03 Feb 2016 12:53
Location: San Diego, CA
Contact:

Re: Increasing Partition Sizes

Post 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:
"If it ain't broke, it needs a lot more fix'n."
Post Reply