EXTATTRCTL(8) | System Manager's Manual | EXTATTRCTL(8) |
extattrctl
—
manage UFS1 extended attributes
extattrctl |
start path |
extattrctl |
stop path |
extattrctl |
initattr [-f ]
[-p path]
attrsize attrfile |
extattrctl |
showattr attrfile |
extattrctl |
enable path
attrnamespace attrname
attrfile |
extattrctl |
disable path
attrnamespace attrname |
The extattrctl
utility is the management
utility for extended attributes over the UFS1 file system. It allows the
starting and stopping of extended attributes on a file system, as well as
initialization of attribute backing files, and enabling and disabling of
specific extended attributes on a file system.
The first argument on the command line indicates the operation to be performed. Operation must be one of the following:
start
pathUFS_EXTATTR
kernel option must have been
enabled. If .attribute/user and
.attribute/system exist at the filesystem root,
extended attributes backed by files in these directories will be
automatically enabled. Note that extended attributes can be automatically
started at mount time by using the -o extattr
option to mount(8).stop
pathinitattr
[-f
] [-p
path] attrsize attrfileThe -f
argument may be used to
indicate that it is alright to overwrite an existing attribute backing
file; otherwise, if the target file exists, an error will be
returned.
The -p
path
argument may be used to preallocate space for all attributes rather than
relying on sparse files to conserve space. This has the advantage of
guaranteeing that space will be available for attributes when they are
written, preventing low disk space conditions from denying attribute
service.
This file should not exist before running
initattr
.
When a user attempts to set a “user” or “system” extended attribute that lacks a backing file, the kernel will attempt to automatically create it, provided .attribute/user or .attribute/system exist and are writable by the requesting user.
showattr
attrfileenable
path attrnamespace attrname attrfileinitattr
before its
first use. Attributes must have been started on the file system prior to
the enabling of any attributes.disable
path attrnamespace attrnameenable
.extattrctl start /
Start extended attributes on the root file system.
extattrctl initattr 17
/.attribute/system/md5
Create an attribute backing file in /.attribute/system/md5, and set the maximum size of each attribute to 17 bytes, with a sparse file used for storing the attributes.
extattrctl enable / system md5
/.attribute/system/md5
Enable an attribute named md5 on the root file system, backed from the file /.attribute/system/md5.
extattrctl disable / system
md5
Disable the attribute named md5 on the root file system.
extattrctl stop /
Stop extended attributes on the root file system.
getextattr(1), extattr_get_file(2), extattrctl(2), extattr(9)
Extended attribute support was developed as part of the TrustedBSD Project, and introduced in FreeBSD 5.0 and NetBSD 4.0. It was developed to support security extensions requiring additional labels to be associated with each file or directory. Backing file autocreation was added in NetBSD 6.0.
Robert N M Watson
extattrctl
works only on UFS1 file
systems. The kernel support for extended attribute backing files and this
control program should be generalized for any file system that lacks native
extended attribute support.
March 10, 2025 | NetBSD 10.99 |