File system growth

I enlarged the virtual hard disk with which I’d like to test NomadBSD.

Is it possible to grow a file system, to utilise the free space?

growfs(8)

Hi @grahamperrin,

  1. Boot into single-user mode.
  2. Run gpart resize -i 3 ada0
  3. Run growfs /dev/ada0s3a
  4. Exit from the single-user shell via exit or Ctrl-D
3 Likes

Hi, my friend Mk1, how are you?

In my case, expanded the ZFS file system that way >

marcdat@NomadBSD ~> gpart show ada0
=>       40  625142368  ada0  GPT  (298G) [CORRUPT]
         40       1024     1  freebsd-boot  (512K)
       1064      81920     2  efi  (40M)
      82984        984        - free -  (492K)
      83968    8192000     3  freebsd-swap  (3.9G)
    8275968  460584960     4  freebsd-zfs  (220G)
  468860928  156281480        - free -  (75G)

marcdat@NomadBSD ~ [1]> gpart recover /dev/ada0 
ada0 recovered
marcdat@NomadBSD ~> gpart show ada0
=>       40  625142368  ada0  GPT  (298G)
         40       1024     1  freebsd-boot  (512K)
       1064      81920     2  efi  (40M)
      82984        984        - free -  (492K)
      83968    8192000     3  freebsd-swap  (3.9G)
    8275968  460584960     4  freebsd-zfs  (220G)
  468860928  156281480        - free -  (75G)

marcdat@NomadBSD ~> gpart resize -i 4 ada0
ada0p4 resized
marcdat@NomadBSD ~> gpart show ada0
=>       40  625142368  ada0  GPT  (298G)
         40       1024     1  freebsd-boot  (512K)
       1064      81920     2  efi  (40M)
      82984        984        - free -  (492K)
      83968    8192000     3  freebsd-swap  (3.9G)
    8275968  616866440     4  freebsd-zfs  (294G)

marcdat@NomadBSD ~ [1]> zpool list
NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
zroot   218G  24.3G   194G        -       74G     1%    11%  1.00x    ONLINE  -

marcdat@NomadBSD ~> glabel status
                                      Name  Status  Components
                diskid/DISK-S165J50PA03972     N/A  ada1
                                gpt/gpboot     N/A  ada0p1
gptid/7140bbb2-09bf-11ec-a27f-001279dea3fd     N/A  ada0p1
                             gpt/gpefiboot     N/A  ada0p2
gptid/7140bbb3-09bf-11ec-a27f-001279dea3fd     N/A  ada0p2
                              gpt/nbsdswap     N/A  ada0p3
gptid/7140bbb4-09bf-11ec-a27f-001279dea3fd     N/A  ada0p3
                            gpt/nbsdrootfs     N/A  ada0p4

root@NomadBSD:/home/marcdat # zpool online -e zroot gpt/nbsdrootfs

root@NomadBSD:/home/marcdat # zpool list
NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
zroot   294G  24.3G   270G        -         -     1%     8%  1.00x    ONLINE  -
root@NomadBSD:/home/marcdat #

Learning … still crawling :sweat_smile: