Growing Solaris UFS file systems

I recently needed to grow a Solaris UFS file system, and accomplished this with the growfs(1m) utility. The growfs(1m) utility takes two arguments. The first argument to growfs ( the value passed to “-M” ) is the mount point of the file system to grow. The second argument is the raw device that backs this mount point. The following example will grow “/test” to the maximum size available on the meta device d100:

$ growfs -M /test /dev/md/rdsk/d100

To see how many sectors will be available on d100 after the grow operation completes, you can run newfs with the “-N” option, and compare that with the current value of df (1m):

$ newfs -N /dev/md/dsk/d100
/dev/md/rdsk/d0: 232331520 sectors in 56944 cylinders of 16 tracks, 255 sectors
113443.1MB in 2191 cyl groups (26 c/g, 51.80MB/g, 6400 i/g)

This will report the number of sectors, cylinders and MBs that would be allocated if a new file system was created on meta device d100. As always, test everything on a non critical system prior to making changes to critical boxen.

2 thoughts on “Growing Solaris UFS file systems”

  1. The first argument to growfs ( the value passed to “-M” ) is the mount point of the file system to grow.

    This argument is not mandatory, it can be skipped if the FS isn’t mounted. I usually prefer to boot from network to do this.

    But when you need to do it online, you need -M

  2. I tried to grow a fs in file, but couldn’t get growfs/mkfs to do it. Any hints ?

    Why somebody want’s to do that?
    I need to grow slice 1 from the solaris DVD.
    If I create a complete new fs, then the parameters don’t match the fs on the DVD. Is this a problem ?

    Sincerely
    Bernhard

Leave a Reply

Your email address will not be published. Required fields are marked *