Solved gpart resize

I have never tried gpart resize and not sure how it works. If the partition on which FreeBSD is installed is getting full how do I go about increasing it?

Do I need spare space immediately after the partition or could I use up some spare space elsewhere on the partion.

Assuming I can create spare space immediatel after the partion by deleting a parttion can I use that partition to grow the FreeBSD partition?
 
you need to create spare space after the partition — generally, filesystems must be one single uninterrupted (contiguous) block of space.

gpart resize only resizes the partition table's view of the size. you run that after deleting the following partition, and then you have to use growfs(8) to grow the UFS partition into that space.
 
I can't tell you about your particular disk but I have a recommendation.

Learn how to use gpart resize and growfs on the FreeBSD memstick installer.
That Disk Image is usually smaller than USB disk so you can practice enlarging memstick install to fit all disk space.
Very handy to use for extras. I use the memstick installer for a wide range of tasks. Good platform for flashing eMMC with disk image.
Just enlarge your installer to fit some images to flash....

A word of advice MBR/BSD Slices are different than EFI/GPT disk scheme. GPT only requires gpart resize and growfs while BSD Scheme/Slices requires two resizes and growfs.

Learn what Indexes are. They are used instead of partition name.
 
I have a recommendation.

Learn how to use gpart resize and growfs on the FreeBSD memstick installer.
That Disk Image is usually smaller than USB disk so you can practice enlarging memstick install to fit all disk space.
oh very good suggestion, yeah, get you some practice on the memstick.
 
This what I have currently:-

Code:
root@X61:~ $ gpart show

=>       34  156301421  ada0  GPT  (75G)
         34       2014        - free -  (1.0M)
       2048   33353864     1  ms-basic-data  (16G)
   33355912      65536     2  ms-basic-data  (32M)
   33421448       1912        - free -  (956K)
   33423360   10485760     3  linux-data  (5.0G)
   43909120     786432     4  freebsd-ufs  (384M)
   44695552   10485760     5  linux-data  (5.0G)
   55181312    9764864     6  linux-data  (4.7G)
   64946176   20971520     7  freebsd-ufs  (10G)
   85917696   20971520     8  freebsd-ufs  (10G)
  106889216   10485760     9  linux-data  (5.0G)
  117374976   20971520    10  freebsd-ufs  (10G)
  138346496   17954959        - free -  (8.6G)
I want to resize partition 7.

Do I first gpart delete -i 8 ada0, and then gpart resize -7 ada0

and then growfs /dev/ada0p7

?
 
Do I first gpart delete -i 8 ada0, and then gpart resize -7 ada0
Apart for some typos, yes. But note that you will lose whatever data was in ada0p8. p8 will become that 5GB linux-data and the 10GB freebsd-ufs will become p9. Linux shouldn't have a problem with it (it typically uses the UUID in fstab; which doesn't change), but FreeBSD might fail to mount a now non-existent ada0p10.
 
Apart for some typos, yes. But note that you will lose whatever data was in ada0p8. p8 will become that 5GB linux-data and the 10GB freebsd-ufs will become p9. Linux shouldn't have a problem with it (it typically uses the UUID in fstab; which doesn't change), but FreeBSD might fail to mount a now non-existent ada0p10.
Actually p8 simply disappears. p9 and p10 remain intact. I just checked if I could boot FreeBSD from p10 and there was no problem.
 
with a GPT partitioning scheme, we always set a glabel reference to use in /etc/fstab so as to not bind closely to partition numbers or disk placement.
 
Back
Top