Increasing Partition Sizes

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

Increasing Partition Sizes

Post by shawniverson » 09 Mar 2014 17:34

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

Code: Select all

shutdown -r now
Version eFa 4.0.0 now available!

microcore
Posts: 7
Joined: 10 Mar 2014 20:51

Re: Increasing Partition Sizes

Post by microcore » 19 May 2014 20:10

Why the EFA dont has pvextend command?

Thank

User avatar
shawniverson
Posts: 2879
Joined: 13 Jan 2014 23:30
Location: Rushville, Indiana, USA
Contact:

Re: Increasing Partition Sizes

Post by shawniverson » 21 May 2014 01:17

I have pvextend command. Is it not present?
Version eFa 4.0.0 now available!

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

Re: Increasing Partition Sizes

Post by david » 04 Aug 2014 16:01

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 » 05 Aug 2014 11:15

lvextend maybe?

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

Re: Increasing Partition Sizes

Post by david » 05 Aug 2014 11:22

vgextend vg_00 /dev/sda5

dbator
Posts: 35
Joined: 20 Aug 2014 19:18

Re: Increasing Partition Sizes

Post by dbator » 21 Aug 2014 18:05

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: 2879
Joined: 13 Jan 2014 23:30
Location: Rushville, Indiana, USA
Contact:

Re: Increasing Partition Sizes

Post by shawniverson » 24 Aug 2014 13:30

Updated how-to to use vgextend :) :) :)
Version eFa 4.0.0 now available!

blobb
Posts: 4
Joined: 21 Jun 2014 21:47

Re: Increasing Partition Sizes

Post by blobb » 23 Oct 2015 00:38

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 » 14 Mar 2016 14:14

worked perfectly
thank you

yahav02
Posts: 4
Joined: 26 Sep 2016 19:55

Re: Increasing Partition Sizes

Post by yahav02 » 27 Sep 2016 19:05

hi
Is it possible to build OVF file with 100 GB VAR folder?

User avatar
shawniverson
Posts: 2879
Joined: 13 Jan 2014 23:30
Location: Rushville, Indiana, USA
Contact:

Re: Increasing Partition Sizes

Post by shawniverson » 27 Sep 2016 22:01

The 3.0.1.5 ovf is 100GB now.
Version eFa 4.0.0 now available!

webguyz
Posts: 47
Joined: 26 Oct 2016 02:17

Re: Increasing Partition Sizes

Post by webguyz » 05 Nov 2016 19:01

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 » 21 Jan 2018 07:27

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: 23
Joined: 03 Feb 2016 12:53
Location: San Diego, CA
Contact:

Re: Increasing Partition Sizes

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

User avatar
shawniverson
Posts: 2879
Joined: 13 Jan 2014 23:30
Location: Rushville, Indiana, USA
Contact:

Re: Increasing Partition Sizes

Post by shawniverson » 26 Dec 2018 11:09

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?
Version eFa 4.0.0 now available!

User avatar
bikertrash
Posts: 23
Joined: 03 Feb 2016 12:53
Location: San Diego, CA
Contact:

Re: Increasing Partition Sizes

Post by bikertrash » 26 Dec 2018 12:52

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