Custom Search

Thursday, June 30, 2005

Administrating File Systems

Topics:
Adding a File System to a Volume
Using Veritas File System Commands
Comparing the Allocation Policies of VxFS and Traditional File Systems
Upgrading the VxFS File System Layout
Controlling File System Fragmentation
Logging in VxFS

Adding a File System: VEA
Select Actions -> File System -> New File System

Mounting a File System: VEA
Select Action -> File System -> Mount File System

Unmounting a File System: VEA
Select Action -> File System -> Unmount File System


Adding a File System: CLI
To create and mount a VxFS file system:
mkfs –F vxfs /dev/vx/rdsk/diskgroup/volume_name
i.e. mkfs –F vxfs /dev/vx/rdsk/datadg/datavol

mkdir mount_point
i.e. mkdir /data

mount –F vxfs /dev/vx/dsk/diskgroup/volume_name mount_point
i.e. mount –F vxfs /dev/vx/dsk/datadg/datavol /data

To create and mount a ufs file system:
newfs /dev/vx/rdsk/diskgroup/volume_name
i.e. newfs /dev/vx/rdsk/datadg/datavol

mkdir mount_point
i.e. mkdir /data

mount /dev/vx/dsk/diskgroup/volume_name mount_point
i.e. mount /dev/vx/dsk/datadg/datavol /data


The vxupgrade Command
For better performance, use file system layout Version 6 for new file systems.

To upgrade the layout online, use vxupgrade:
vxupgrade [-n new_version] [-o noquota] [-r rawdev] mount_point

To display the current file system layout version number:
vxupgrade mount_point

Upgrading must be done in stages. For example, to upgrade the file system layout from Version 4 to Version 6:
vxupgrade –n 5 /mnt
vxupgrade –n 6 /mnt


Monitoring Fragmentation

To monitor directory fragmentation:
fsadm –D mount_point

A high total in the “Dirs to Reduce” column indicates fragmentation.

To monitor extent fragmentation:
fsadm –E mount_point

Free space in extents of less than 64 blocks in length –
lt 5% = unfragmented, gt 50% badly fragmented

Free space in extents of less than 8 blocks in length –
lt 1% = unfragmented, gt 5% badly fragmented

Total file system size in extents of length 64 blocks or greater –
gt 5% = unfragmented, lt 5% badly fragmented


Defragmenting a File System

CLI:
fsadm [-d] [-D] [-e] [-E] [-t time] [-p passes] mount_point
Note: the lowercase “d” and “e” actually do the defrag of directories and extents

VEA:
Actions -> Defrag File System

Testing Performance Using vxbench

Obtained from: ftp://ftp.veritas.com/pub/support/vxbench.tar.Z

vxbench –w workload [options] filename


Intent Log
1) The intent log records pending file system changes before metadata is changed
2) After the intent log is written, other file system updates are made
3) If the system crashes, the intent log is replayed by VxFS fsck


Maintaining VxFS Consistency

To check file system consistency by using the intent log for VxFS on the volume datavol:
fsck [fs_type] /dev/vx/rdsk/datadg/datavol

To perform a full check without using the intent log:
fsck [fs_type] –o full,nolog /dev/vx/rdsk/datadg/datavol

To check two file systems in parallel using the intent log:
fsck [fs_type] –o p /dev/rdsk/c1t2d0s4 /dev/rdsk/c1t0d0s5

To perform a file system check using VEA:
Highlight an unmounted file system
Select Actions -> Check File System


Resizing the Intent Log
Larger log sizes may improve performance for intensive synchronous writes, but may increase recovery time, memory requirements, and log maintenance time.

Default log size depends on file system size (in the range of 256K to 64MB)
Maximum log size is 2Gb for version 6 and 16MB in versions 4 and 5.
Minimum log size is 256K

VEA:
Highlight a file system
Select Actions -> Set Intent Log Options

CLI:
fsadm [-F vxfs] –o log=size [,logdev=device] mount_point


Logging mount Options

mount –F vxfs [-o specific_options] …

-o log = Better integrity through logging all structural changes. If a system failure occurs, fsck replays recent changes so that they are not lost.

-o delaylog = (default) Improved performance due to some logging being delayed

-o tmplog = Best performance due to all logging being delayed. but some changes could be lost on a system failure.