UFS Unable to expand UFS slice

IT_Architect

Member

Thanks: 4
Messages: 90

#1
I've spent quite a bit of time on this using the manual and Googling but I still haven't been successful.
Situation: FreeBSD 11.2, ESXi initially with 80G VHD, expanded to 130G. It is the last slice, /home, that I am attempting to expand.
Initial:
Code:
.  # gpart show
=>       63  272629697  da0  MBR  (130G)
         63          1       - free -  (512B)
         64  167772095    1  freebsd  [active]  (80G)
  167772159  104857601       - free -  (50G)

=>        0  167772095  da0s1  BSD  (80G)
          0    4194304      1  freebsd-ufs  (2.0G)
    4194304    8388608      2  freebsd-swap  (4.0G)
   12582912    2097152      4  freebsd-ufs  (1.0G)
   14680064   10485760      5  freebsd-ufs  (5.0G)
   25165824    2097152      6  freebsd-ufs  (1.0G)
   27262976   31457280      7  freebsd-ufs  (15G)
   58720256  109051838      8  freebsd-ufs  (52G)
  167772094          1         - free -  (512B)
gpart resize -i 1 da0

gpart commit da0s1

Code:
gpart show
=>       63  272629697  da0  MBR  (130G)
         63          1       - free -  (512B)
         64  272629696    1  freebsd  [active]  (130G)

=>        0  272629696  da0s1  BSD  (130G)
          0    4194304      1  freebsd-ufs  (2.0G)
    4194304    8388608      2  freebsd-swap  (4.0G)
   12582912    2097152      4  freebsd-ufs  (1.0G)
   14680064   10485760      5  freebsd-ufs  (5.0G)
   25165824    2097152      6  freebsd-ufs  (1.0G)
   27262976   31457280      7  freebsd-ufs  (15G)
   58720256  109051838      8  freebsd-ufs  (52G)
  167772094  104857602         - free -  (50G)
Here is where the problem starts:
Code:
gpart resize -i 8 -s 102G -a 4k da0
gpart: invalid partition index
Thank you in advance for your help.
 
OP
OP
I

IT_Architect

Member

Thanks: 4
Messages: 90

#3
Just being pedantic here but the distinction is important, da0s1h is a partition, da0s1 is the slice. Slices contain partitions.


It's index number 8 from da0s1 you need to resize, not da0.
I would have figured it out on my own in a year or two. :D I've done this in FreeBSD 7.x, but not 10.x or newer. The new method is a LOT easier once you do it right.

Thanks TONS!!!
 
OP
OP
I

IT_Architect

Member

Thanks: 4
Messages: 90

#4
To summarize:
1. Expand the size of the vHD in ESXi. Run
gpart show
and it should show at the end of the device as raw space.

2. Add the added capacity to the number 1 and only slice
gpart resize -i 1 da0
gpart commit da0s1

3. Add the added capacity to the last partition, in this case partition 8 /home
gpart resize -i 8 -a 4k da0s1

4. Grow the file system to be able to use the additional capacity for file storage
growfs /home
 
Top