Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > F

fstadm(1M)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

fstadm — defines and manages file system stack templates

SYNOPSIS

/usr/sbin/fstadm create [-o] -f filename [-n name]

/usr/sbin/fstadm create [-o] -t template_string -n name

/usr/sbin/fstadm list

/usr/sbin/fstadm display template_name

/usr/sbin/fstadm delete template_name

/usr/sbin/fstadm fdel template_name

/usr/sbin/fstadm help

DESCRIPTION

The fstadm command performs basic administrative operations on file system stack templates. Operations include creating and deleting templates, listing all templates on the system, and displaying the contents of templates.

File system stack templates are used to describe the structure of a file system module stack. They contain information about the modules on a stack and the mount options for each module on the stack.

All stack templates on a system reside in the system's stack template database. The only supported way to access and edit templates in the system template database is to use the fstadm command.

The fstadm command also validates all templates at the time that they are created, to make sure that any dependency and compatibility constraints for modules on a stack are not violated. Dependency and compatibility constraints are specified by individual module developers, and fstadm enforces the constraints as needed.

Note that end users do not need to be concerned about what constraints exist and how they are implemented: they only need to use fstadm to create all their templates, and fstadm will report on any problems with a user's proposed stack template. It is then easy to modify the inputs to fstadm to build a correctly validated template.

Once a stack template is created and exists in the system template database, it can be used at mount time by specifying its name as a stackfs mount option. For example, the command below will mount the desired hfs file system, with a stack described by template mytemplate built above it. The file system on /mnt will now have the features of hfs plus those of all of the modules on the stack described by mytemplate.

mount -F hfs -o largefiles,stackfs=mytemplate /dev/dsk/c2t0d0 /mnt

Note that templates do not include information about the base file system to be mounted (e.g. vxfs or hfs), so the base file system must still be specified on the mount command line in the traditional way. (Support for templates that include base file systems is not included in the current versions of HP-UX.)

fstadm can be invoked only by a user who has appropriate privileges.

The behavior of the fstadm command depends upon the command name keyword specified as the first operand.

Command Keywords and Options

The following command keywords, arguments, and options are currently supported.

create -f | -t

Creates a new template. To describe a template, this command takes two types of input:

  • a text file that describes a template, specified with the -f option, or

  • a string that describes a template directly in the command line, specified with the -t option.

The -t option cannot be used in conjunction with the -f option.

A template can contain information about the mount options to use at each level of a stack. For information about the specific mount options that are available for each stackable file system module, consult the manpage for the module itself.

The create command uses the information in its input to validate and build a new template. If the new template's structure fails validation, this command will abort and print an error message describing the problem. If validation succeeds, this command will create the template in the system template database and make it available for use with future mounts.

The arguments that can be used with the create keyword are:

-f filename

Specifies the name of a text file that describes the contents of a stack template. Information in the text file will be used as a guide to construct the desired stack template. The format of each line in the text file is:

module options

That is, each line of the text file describes one level of the desired stack. Within each line, a module and its mount options are separated by a single space character. The first line of the file represents the top of the stack, and the last line of the file represents the bottom. The format of these text files is identical to that of the output of the display command keyword.

-t template_string

Specifies the contents of a stack template. The format for this string is:

module1:options1;module2:options2;...;moduleN:optionsN

That is, an entire stack is described within the string, and each level of a stack is separated by a semicolon (;). Within a level, a module and its mount options are separated by a colon (:). (But the colon does not need to be included for modules without mount options.) The leftmost module in the string represents the top of the stack, and the right-most module represents the bottom of the stack.

-n name

Specifies the name of the template to be created. The maximum supported length for the template name is 128 characters.

This is a required argument whenever -t is used. For -f, if it is omitted, the name of the new template defaults to the name of the file specified with -f.

-o

Overwrite option. If a template with the same name as the new template being created already exists, overwrites the old template. If this option is not specified, the create command will fail whenever a template of the same name already exists.

Note however that if a template of the same name exists AND is currently in use (in /etc/fstab or /etc/mnttab), the create command will always fail, even if -o was specified. The rationale for this is that templates for stacks that are currently in use cannot be allowed to change.

list

List all the templates in the system. This command displays the names of all templates currently stored in the system template database. Each template name is listed in its own line of output.

display template_name

Displays the contents of the specified template. This command will display the contents of the named template as text output, with each level of the stack described by one line of output. That is, each line of output will contain a module name, a space, and then the module's mount options (if any). The first line displayed represents the top of the stack, and the last line represents the bottom of the stack.

Optionally, if it is redirected to a file, this output can also be used as input to fstadm create via the -f option.

delete template_name

Deletes the specified template from the system template database. If the template is currently in use (in /etc/fstab or /etc/mnttab), deletion is not allowed. In all other cases, the template will be removed from the system template database after user confirmation of the delete operation. (Template deletion is permanent and irrecoverable.)

fdel template_name

Forced delete of the specified template. Identical to delete, but performs the deletion without asking for user confirmation. This command is provided for use by non-interactive scripts.

help

Interactive help utility. Displays basic information about the various fstadm command keywords.

RETURN VALUE

fstadm exits with one of the following values:

0

Successful completion.

>0

An error condition occurred. Because fstadm is primarily an interactive command, an explanation of the error will be printed to standard error.

EXAMPLES

List all the file system stack templates currently on the system:

fstadm list

Display the contents of the stack template named mytemplate:

fstadm display mytemplate

Create a new template describing a stack that contains stacked modules named verfs and secfs (with module verfs having a mount option set to 2), and name the template myfs:

fstadm create -t verfs:option=2;secfs -n myfs

Delete the file system stack template named mytemplate:

fstadm delete mytemplate

AUTHOR

fstadm was developed by HP.

SEE ALSO

mount(1M).

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.