Tuning File SystemsA situation might arise in which you want to change some of the parameters that were set when you originally created the file system. Perhaps you want to change the minfree value to free some additional disk space on a large disk drive. Using the tunefs command, you can modify the following file system parameters:
See Table 1.14 for a description of these options. Caution tunefs can destroy a file system in seconds. Always back up the entire file system before using tunefs. The syntax for tunefs is as follows: tunefs [ -a <maxcontig> ] [ -d <rotdelay> ] [ -e <maxbpg> ] [ -m <minfree> ] [ -o [ <value> ] <special>/<file system> The tunefs command is described in Table 1.14. The file system does not need to be unmounted before using tunefs. To change the minimum free space (minfree) on a file system from 10% to 5%, type the following: tunefs -m5 /dev/rdsk/c0t0d0s6 minimum percentage of free space changes from 10% to 5% The manual page of tunefs recommends that minfree be set at 10%; if you set the value under that, you lose performance. This means that 10% of the disk is unusable. This might not have been too bad in the days when disks were a couple hundred megabytes in size, but on a 9GB disk, you're losing 900MB of disk space. The mention of loss of performance in the manual page is misleading. With such large disk drives, you can afford to have minfree as low as 1%. This has been found to be a practical and affordable limit. In addition, performance does not become an issue because locating free blocks even within a 90MB area is efficient. A rule of thumb is to use the default 10% minfree value for file systems up to 1GB and then adjust the minfree value so that your minfree area is no larger than 100MB. As for performance, applications do not complain about the lower minfree value. The one exception is the root (/) file system, in which the system administrator can use his judgment to allow more free space just to be conservative, in case root (/) ever becomes 100% full. Note Viewing the minfree Value On large file systems, the minfree is automatically determined so that disk space is not wasted. Use the mkfs -m command described next if you want to see the actual minfree value that newfs used. Later, if you want to see what parameters were used when creating a file system, issue the mkfs command: mkfs -m /dev/rdsk/c2t1d0s1 The system responds with this: mkfs -F ufs -o nsect=135,ntrack=16,bsize=8192,fragsize=1024,cgsize=46,free=1,\ rps=120,nbpi=8179,opt=t,apc=0,gap=0,nrpos=8,maxcontig=128,mtb=n\ /dev/rdsk/c2t1d0s1 8337600 |