This section describes how to grow a UFS that uses a metadevice that was expanded with additional slices.
After a metadevice containing a file system is expanded (more space is added), if that metadevice contains a UFS, you need to "grow" the file system to recognize the added space.
If you use DiskSuite Tool to add additional space to a metadevice, you receive a growfs message automatically. If you use the command line interface, you must manually grow the file system with the growfs(1M) command.
An application, such as a database, that uses the raw device must have its own method to grow added space. DiskSuite does not provide this functionality.
The growfs(1M) command expands the file system, even while mounted.
After checking the prerequisites on "Prerequisites for Maintaining DiskSuite Objects", and the preliminary information on "Preliminary Information For Growing a File System", use the growfs(1M) command to grow a UFS. Refer to the growfs(1M) man page for more information.
# df -k Filesystem kbytes used avail capacity Mounted on ... /dev/md/dsk/d10 69047 65426 0 100% /home2 ... # growfs -M /home2 /dev/md/rdsk/d10 /dev/md/rdsk/d10: 295200 sectors in 240 cylinders of 15 tracks, 82 sectors 144.1MB in 15 cyl groups (16 c/g, 9.61MB/g, 4608 i/g) super-block backups (for fsck -F ufs -o b=#) at: 32, 19808, 39584, 59360, 79136, 98912, 118688, 138464, 158240, 178016, 197792, 217568, 237344, 257120, 276896, # df -k Filesystem kbytes used avail capacity Mounted on ... /dev/md/dsk/d10 138703 65426 59407 53% /home2 ... |
A new slice was added to a concatenation, d10, which contains the mounted file system /home2. The growfs command specifies the mount point with the -M option to be /home2, which is expanded onto the raw device /dev/md/rdsk/d10. The file system will span the entire metadevice when the growfs(1M) command is done. Use the df -k command before and after to verify the total disk capacity.
The growfs(1M) command will "write-lock" (see lockfs(1M)) a mounted file system when expanding. The length of time the file system is write-locked can be shortened by expanding the file system in stages. For instance, to expand a 1 Gbyte file system to 2 Gbytes, the file system can be grown in 16 Mbyte stages using the -s option to specify the total size of the new file system at each stage.
During the expansion, the file system is not available for write access because of write-lock. Write accesses are transparently suspended and are restarted when growfs(1M) unlocks the file system. Read accesses are not affected, though access times are not kept while the lock is in effect.
For mirror and trans metadevices, always run the growfs(1M) command on the top-level metadevice, not a submirror or master device, even though space is added to the submirror or master device.