Linux Command Directory


Linux in a Nutshell

This directory of Linux commands is from Linux in a Nutshell, 5th Edition.

Click on any of the 687 commands below to get a description and list of available options. All links in the command summaries point to the online version of the book on Safari Bookshelf.

Buy it now, or read it online on Safari Bookshelf.



tune2fs

tune2fs [options] device

System administration command. Tune the parameters of a Linux Second Extended Filesystem by adjusting various parameters. You must specify the device on which the filesystem resides; it must not be mounted read/write when you change its parameters.

Options

-c max-mount-counts

Specify the maximum number of mount counts between two checks on the filesystem.

-C mount-count

Specify the mount count. For use with -c to force a check the next time the system boots.

-e behavior

Specify the kernel's behavior when encountering errors. behavior must be one of:

continue

Continue as usual.

remount-ro

Remount the offending filesystem in read-only mode.

panic

Cause a kernel panic.

-f

Force completion even if there are errors.

-g group

Allow group (a group ID or name) to use reserved blocks.

-i interval[d|w|m]

Specify the maximum interval between filesystem checks. Units may be in days (d), weeks (w), or months (m). If interval is 0, checking will not be time-dependent.

-j

Add an ext3 journal to the filesystem. If specified without -J, use the default journal parameters.

-J jrnl-options

Specify ext3 journal parameters as a comma-separated list of option=value pairs. The specified options override the default values. Only one size or device option can be specified for a filesystem. Possible options are:

device=ext-jrnl

Attach to the journal block device on ext-jrnl, which must exist and must have the same block size as the filesystem to be journaled. ext-jrnl can be specified by its device name, by the volume label (LABEL=label), or by the Universal Unique Identifier (UUID) stored in the journal's ext2 superblock (UUID=uuid; see uuidgen). Create the external journal with:

mke2fs -O jrnl-dev ext-jrnl

size=jrnl-size

The size of the journal in megabytes. The size must be at least equivalent to 1024 blocks and not more than 102,400 blocks.

-l

Display a list of the superblock's contents.

-L label

Specify the volume label of filesystem. The label must be no more than 16 characters.

-m percentage

Specify the percentage of blocks that will be reserved for use by privileged users.

-M dir

Specify the filesystem's last-mounted directory.

-o mount-options

Set or clear the specified default mount-options. Mount options specified in /etc/fstab or on the command line for mount will override these defaults. Specify multiple options as a comma-separated list. Prefixing an option with a caret (^) clears the option. No prefix or a plus sign (+) causes the option to be set. The following options can be cleared or set:

acl

Enable Posix Acess Control Lists.

bsdgroups

Assign new files the group-id of the directory in which they are created instead of the group-id of the process creating them.

debug

Enable debugging code.

journal_data

When journaling, commit all data to journal before writing to the filesystem.

journal_data_ordered

When journaling, force data to the filesystem before committing metadata to the journal.

journal_data_writeback

When journaling, force data to the filesystem after committing metadata to the journal.

-O option

Set or clear the specified filesystem options in the filesystem's superblock. Specify multiple options as a comma-separated list. Prefixing an option with a caret (^) clears the option. No prefix or a plus sign (+) causes the option to be set. Run e2fsck after changing filetype or sparse_super. The following options can be cleared or set:

dir_index

Use B-trees to speed up lookups on large directories.

filetype

Save file type information in directory entries.

has_journal

Create an ext3 journal. Same as the -j option.

sparse_super

Save space on large filesystems by limiting the number of backup superblocks. Same as -s.

-r num

Specify the number of blocks that will be reserved for use by privileged users.

-s [0|1]

Turn the sparse superblock feature on or off. Run e2fsck after changing this feature.

-T time

Set the time e2fsck was last run. The time specification is international date format, with the time optional—i.e., YYYYMMDD[[HHMM] SS] . If time is specified as time-last-checked, the current time is used.

-u user

Allow user (a user ID or name) to use reserved blocks.

-U uuid

Set the UUID of the filesystem to a UUID generated by uuidgen or to one of the following:

clear

Clear the existing UUID.

random

Randomly generate a new UUID.

time

Generate a new time-based UUID.


More Linux resources from O'Reilly >>

Popular Topics

Browse Books & Videos

International Sites

O'Reilly China O'Reilly Germany O'Reilly Japan