Veritas File System

Veritas Filesystem ( VxFS) is an extent based, intent logging file system. VxFS is geared toward Unix environments that require high performance and availability and deal with large amounts of data.

VxFS features: -

Version 4 disk Layout

The VxFS version 4 disk layout divides the entire file system space into fixed sized allocation units. The first allocation unit starts at block zero and all allocation units 32K blocks. All structural information are contained in files. So expanding the filesystem structures simply requires extending the appropriate structural files. All version 4 structural files reside in the structural fileset.

The structural files in version 4 disk layout are:

Object location Table file

Contains the object location table (OLT). The OLT, which referenced from the superblock is used to locate the other structural files.

Label File

Encapsulates the super-block and super-block replicas. Although the primary location of the super-block is known, the label file can be used to locate upper-block copies ifthere is structural damage to the filesystem.

Device File

Records device information such as volume length and volume label and contains pointers to other structural files.

Fileset Header File

Hold information on a per- fileset basis. This may include the inode of the fileset’s inode list file, the maximum number of inodes allowed, an indication of whether the filesystem supports large files and the inode number of quotas file if the filesetsupports quotas.

When a filesystem is created, there are two filesets, the structural fileset, whichdefines the file system structure and the primary fileset which contains user data.

Inode List File

Both the structural fileset and the primary fileset have their own inode lists which are stored in inode list files. Increasing the number of inodes involves increasing the size of the file after expanding the inode allocation unit file.

Inode Allocation Unit File

Hold the free inode map, extended operations map and a summary of the inode resources.

Log File Maps the block used by the filesystem intent log.
Extent Allocation Unit State File

Indicates the allocation state of each AU by defining whether each AU is free allocated as a whole (no bitmaps allocated) or expanded, in which case the bitmaps associated with each AU determine which extents are allocated.

Extent Allocation Unit Summary File

Contains the AU summary for each allocation unit, which contains the number of free extents of each size. The summary for an extent is created only when an allocation unit is expanded for use.

Free Extent Map File Contains the free extent maps for each of the allocation units.
Quotas File

If the filesystem supports quotas, there is a quotas file, which is used to track the resources allocated to each user.

Creating a Filesystem

The mkfs command creates veritas filesystems by writing to a special character device.


mkfs –F vxfs –o largefiles /dev/vx/rdsk/appdg/samba_vol

mkfs   [-F vxfs] [ generic_option] [-o special_option] device [size]

generic_option - Options common to other filesystem types
special_option - Options specific to VxFS filesystem
device         - disk device or Veritas volume
size           - the size in sectors

Mounting/ Unmounting a Filesystem

Mount a VXFS filesystem mount –F vxfs –o largefiles /dev/vx/rdsk/appdg/samba_vol /samba
Umount a VXFS filesystem umount /samba

Displaying a Filesystem


mount -v
mount -p

How created mkfs -F vxfs -n N <filesystem>
mkfs -F vxfs -m <character device>

Identifying Filesystem types

Identify filesystem type

fstyp -v /dev/vx/dsk/appdg/samba_vol       (block device)
fstyp -v /dev/vx/rdsk/appdg/samba_vol      (raw device)

Shrink/grow a Filesystem

Shrink a filesystem /usr/lib/vxfs/fsadm -b 102400 /samba
Grow a filesystem /usr/lib/vxfs/fsadm -b 204800 /samba

Reorganise a Filesystem

Use the fsadm ro reorganise (defrag) a filesystem:

Report on extent fragmentation: /usr/lib/fs/vxfs/fsadm -E /samba
Report on directory fragmentation: /usr/lib/fs/vxfs/fsadm -D /samba
Reorganise extents: /usr/lib/fs/vxfs/fsadm -e /samba
Reorganise directories: /usr/lib/fs/vxfs/fsadm -d /samba

Create and Mount a snapshot filesystem

Use the mount command to create the snap shot filesystem then use vxdump (or tar, dd, cpio) to backup the filesystem to tape:

Create the snapshot filesystem:

mount -F vxfs -o snapof=/dev/vx/dsk/appdg/samba_vol snap,size=208400 \

Backup the filesystem: vxdump -cf /dev/rmt/1cbn /snapshot
Restore the filesystem (to /restore filesystem): vxrestore -vx /restore

Using quotas

Turn on a quota for a filesystem (make sure filesystem has been mounted with quota option):

vxquotaon <mount_point>

Note: a file will be created called quotas (it's a text file)

To setup a users quota vxedquota <username>
To view a users quota: vxquota -v <username>
To turn off quota on a filesystem:

vxquotaoff <mount_point>

Note: The quota file is not removed.

VxFS consistancy

Full check fsck -F vxfs -o full,nolog <volume>
Two f/s in parallel fsck -F vxfs -o p <raw-device>,raw-device>

Intent Log

The intent log is uded to speed up recovery

Create fsadm -F vxfs -o log=size,logdevice=<device>
Mount mount -F vxfs -o log                (integrity)
mount -F vxfs -o delaylog         (performance)