Growing a UFS filesystem on Solaris

Growing a UFS filesystem without firstly umounting the volume, performing a backup, resize the volume and finally restore the data is normally a feature of Solstice DiskSuite (SDS) or Veritas Volume Manager (VxVm).

But did you know that it is also possible without either SDS or VxVM? You just have to know some special arguments and the second "hidden" mkfs command.

  1. Use format and select the necessary disk.
  2. Change your partition to the new desired size and record the new size in blocks (last column in the print output within format)
  3. Invoke mkfs to grown the filesystem:
    # /usr/lib/fs/ufs/mkfs -G -M /your_current_mount_point /dev/rdsk/cxtxdxsx newsize
    NOTE: 'newsize' is the size in Blocks (you recorded).

The filesystem will start to grow as rapid as normal, mkfs is working without doing any harm to your data.