Changing the Parameters of a Solaris File System Dynamically

Joseph GanSystem Admin
CERTIFIED EXPERT
Published:
In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it.
For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volume, which destroys the data on it. After that it could take a significant amount of time for the volume to be reinitialized if you've got a large amount of disk space. In addition, you may need to change the segment size of a logical unit number (LUN) in a Redundant Array of Inexpensive Disks (RAID) box, which requires deleting the existing LUN, and so on. Even if you're changing the parameter of a metadevice, or renaming the metadevice, you'll need to unmount the file system.
How do I dynamically change the parameters of a file system without destroying the data on it?
You can do this with Solaris Volume Manager software, which is delivered as an integral part of the Solaris 9 OS. In earlier versions of the Solaris OS, it was called Solstice DiskSuite software or Online: DiskSuite software.
First, the file system has to be created and mounted as a one-way mirror metadevice such as d100, which contends with d101 as its submirror in this example:
   # metastat d100
                         d100: Mirror
                             Submirror 0: d101
                               State: Okay
                             Pass: 1
                             Read option: roundrobin (default)
                             Write option: parallel (default)
                             Size: 10261520 blocks
                      
                         d101: Submirror of d100
                             State: Okay
                             Size: 10261520 blocks
                             Stripe 0: (interlace: 32 blocks)
                                 Device              Start Block  Dbase State        Hot Spare
                                 c1t12d0s0                  0     No    Okay
                                 c1t13d0s0               1520     No    Okay
                                 c1t14d0s0               1520     No    Okay
                                 c1t15d0s0               1520     No    Okay

Open in new window

The next step is to create a new metadevice d102, which must be the same size as the submirror d101. For T3, you need a spare disk volume. For the RAID box, you need a set of spare disks.
   # metainit d102 1 4 c0t11d0s0 c0t12d0s0 c0t13d0s0 c0t14d0s0
                         d82: Concat/Stripe is setup
                      
                         # metastat d102
                         d102: Concat/Stripe
                             Size: 10261520 blocks
                             Stripe 0: (interlace: 32 blocks)
                                 Device              Start Block  Dbase
                                 c0t11d0s0                  0     No
                                 c0t12d0s0               1520     No
                                 c0t13d0s0               1520     No
                                 c0t14d0s0               1520     No

Open in new window

Then apply a set of new parameters by using the commands newfs, tunefs, and so on.
The final step is to add the new metadevice d102 as the second submirror to d100. The resynchronization occurs automatically.
   # metattach d100 d102
                         d100: submirror d102 is attached
                      
                         # metastat d100
                         d100: Mirror
                             Submirror 0: d101
                               State: Okay
                             Submirror 1: d102
                               State: Resyncing
                             Resync in progress: 80 % done
                             Pass: 1
                             Read option: roundrobin (default)
                             Write option: parallel (default)
                             Size: 10261520 blocks
                         ......

Open in new window

When the resynchronization is complete, you have two-way mirrors. One submirror has the old parameters, and the other has the new parameters.
Then you should detach the submirror d101 from d100, and remove it altogether.
   # metadetach d100 d101
                         # metaclear d101

Open in new window

Now you've changed the file system with a set of new parameters dynamically.
0
4,049 Views
Joseph GanSystem Admin
CERTIFIED EXPERT

Comments (0)

Have a question about something in this article? You can receive help directly from the article author. Sign up for a free trial to get started.