Home > Articles

Tuning File Systems in Solaris 8

Practice one of the Solaris 8 Certification exam objectives with expert Bill Calkins' lesson on how to tune file systems. This article from New Riders teaches you how to administer the Solaris file system for optimum performance.
This article is excerpted from Solaris 8 Training Guide (310-011 and 310-012): System Administrator Certification by Bill Calkins.
Like this article? We recommend

A 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:

  • maxcontig
  • rotdelay
  • maxbpg
  • minfree
  • optimization

See Table 1 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/filesystem

The tunefs command is described in Table 1.

Table 1 The tunefs Command

Option

Description

-a <maxcontig>

Specifies the maximum number of contiguous blocks that are laid out before forcing a rotational delay (see the -d option). The default value is 1 because most device drivers require an interrupt per disk transfer. For device drivers that can chain several buffers into a single transfer, set this to the maximum chain length.

-d <rotdelay>

Specifies the expected time (in milliseconds) to service a transfer completion interrupt and to initiate a new transfer on the same disk. It is used to decide how much rotational spacing to place between successive blocks in a file.

-e <maxbpg>

Sets the maximum number of blocks that any single file can allocate from a cylinder group before it is forced to begin allocating blocks from another cylinder group. Typically, this value is set to approximately one quarter of the total blocks in a cylinder group. The intent is to prevent any single file from using up all the blocks in a single cylinder group. The effect of this limit is to cause big files to do long seeks more frequently than if they were allowed to allocate all the blocks in a cylinder group before seeking elsewhere. For file systems with exclusively large files, this parameter should be set higher.

-m <minfree>

Specifies the percentage of space held back from normal users (the minimum free space threshold). The default value is 10 percent, however, on large file systems, the minfree value is determined automatically.

-o <value>

Changes the optimization strategy for the file system. The value is either space or time. Use space to conserve space; use time to organize file layout and minimize access time. Generally, optimize a file system for time unless it is more than 90 percent full.

<special>/<filesystem>

Enters either the special device name (such as /dev/rdsk/c0t0d0s6) or the file system name (such as /home).


The file system must be unmounted before you use tunefs.

To change the minimum free space (minfree) on a file system from 10 percent to 5 percent, 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 percent, and that if you set the value under that, you lose performance. This means that 10 percent 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 percent. 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 percent 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 the performance, applications do not complain about the lower minfree value. The one exception would be 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 percent full.

NOTE

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/c0t0d0s6

The system responds with this:

mkfs -F ufs -o nsect=117,ntrack=9,bsize=8192, \fragsize=1024,cgsize=16,free=5,rps=90,nbpi=2062,opt=t, \apc=0,gap=0,nrpos=8,maxcontig=15 /dev/rdsk/c0t0d0s6 205334

The fstyp Command

Another good command to use to view file system parameters is the fstyp command. Use the -v option to obtain a full listing of a file system's parameters:

fstyp -v /dev/rdsk/c0t0d0s6

The system responds with this:

ufs
magic 11954 format dynamic   time  Sat Oct   2 10:11:06 1999
sblkno 16   cblkno 24   iblkno 32   dblkno 528
sbsize 3072  cgsize 2048  cgoffset   64   cgmask 0xfffffff0
ncg  13   size  102667 blocks95994
bsize 8192  shift 13   mask 0xffffe000
fsize 1024  shift 10   mask 0xfffffc00
frag  8   shift 3   fsbtodb   1
minfree    5%   maxbpg 2048 optim time
maxcontig 15 rotdelay 0ms rps  90
csaddr 528  cssize 1024  shift 9   mask  0xfffffe00
ntrak 9   nsect 117  spc  1053  ncyl  195
cpg  16   bpg  1053  fpg  8424  ipg  3968
nindir 2048  inopb 64   nspf 2
nbfree 11995 ndir  2   nifree 51577 nffree 1
cgrotor    0   fmod  0   ronly 0
fs_reclaim is not set
file system state is valid, fsclean is 1
blocks available in each rotational position
cylinder number 0:
  position 0:  0  8  15  22  30  37  44  52  59
  position 1:  1  9  16  23  31  38  45  53  60
  position 2:  2  10  17  24  39  46  61
  position 3:  3  18  25  32  40  47  54  62
  position 4:  4  11  19  26  33  41  48  55  63
  position 5:  5  12  20  27  34  42  49  56
  position 6:  6  13  21  28  35  50  57  64
  position 7:  7  14  29  36  43  51  58  65
cylinder number 1:
  position 0: 66  74  81  88 103 110 117 125
  position 1: 67  82  89  96 104 111 118 126
  position 2: 68  75  83  90  97 105 112 119 127
  position 3: 69  76  84  91  98 106 113 120
  position 4: 70  77  85  92  99 114 121 128
  position 5: 71  78  93 100 107 115 122 129
  position 6: 72  79  86  94 101 108 116 123 130
  position 7: 73  80  87  95 102 109 124 131
...
...

NOTE

It's always a good idea to print the mkfs options used on a file system along with information provided by the prtvtoc command. Put the printout in your system log so that if you ever need to rebuild a file system because of a hard drive failure, you can re-create it exactly as it was before.

About this Article

This article is excerpted from Solaris 8 Training Guide (310-011 and 310-012): System Administrator Certification, by Bill Calkins ( New Riders Publishing, ISBN: 1578702593). Refer to chapter 7, "Solaris File Systems: Advanced Topics" of the book to learn more about the advanced topics of file systems and how to meet the objectives of the Solaris 8 exam.

Pearson IT Certification Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from Pearson IT Certification and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about Pearson IT Certification products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites; develop new products and services; conduct educational research; and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by Adobe Press. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.pearsonitcertification.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020