debugfs
[ -f cmd_file ] [ -R command ] [ -V ] [ -w [device ] ]
Examine and debug an ext2 filesystem. Note that this is an interactive command; once invoked, you get a debugfs prompt that can be fiddled with indefinitely. The filesystem should be unmounted before you run debugfs. Use debugfs with extreme caution; you can destroy the filesystem with this command. Note that the default if for debugfs to be run in read-only mode.
Example: To run debugfs on the filesystem in /dev/hda6 in read/ write mode, use
debugfs -w /dev/hda6
Example: To use debugfs to display the contents of the superblock of /dev/hda6 and exit, enter
debugfs -R show_super_stats /dev/hda6
To get block numbers and other information prior to invoking debugfs, run dumpe2fs. |
-w | Open the filesystem in read/write mode. device is the device file corresponding to the ext2 filesystem (e.g., /dev/hdXX). |
-fcmd_file | Execute commands in cmd_file. |
-Rrequest | Execute command, then exit. |
-V | Print version number. |
Once invoked, debugfs uses the command subset shown next. Note that in many cases, files may be specified either by pathname or inode number. (The inode is the low-level Linux representation for all types of files, including directories.) Inodes are input as decimal numbers surrounded by angle brackets ("<", ">").
catfilespec | Dump the contents of the inode filespec to stdout. |
cdfilespec | Change the current working directory to filespec. |
chrootfilespec | Change the root directory to be the directory filespec. |
Close | Close the currently open filesystem. |
clrifilespec | Clear the contents of the inode filespec. |
dump [-p]inode outfile | Dump the contents of the file specified by inode outfile. If the -p option is used, debugfs sets the file permissions of outfile to match filespec. |
expand_dir directory | Expand the directory. |
find_free_block[goal] | Starting at goal, find and allocate the first free block. |
find_free_inode[dir [mode]] | Find a free inode and allocate it. dir specifies the inode number of the directory which is to be allocated. mode specifies the permissions of the new inode. |
freebblock | Mark the block number block as not allocated. |
freeifilespec | Free the inode specified by filespec. |
help | Print a list of commands understood by debugfs(8). |
icheckblock ... | Print a listing of the inodes that use the one or more blocks specified on the command line. |
initializedevice blocksize | Create an ext2 file system on device with device size blocksize. |
kill_filefilespec | Deallocate the inode filespec and its blocks. |
lnfilespec dest_file | Create a link named dest_file, which is a link to filespec. Does not adjust the inode reference counts. |
ls [-l]filespec | Print a listing of the files in the directory filespec. |
modify_inodefilespec | Modify the contents of the inode structure in the inode filespec. |
mkdirfilespec | Make a directory. |
mknodfilespec [p|[[c|b] major minor]] | Create a special device file. If a character or block device is to be made, the major and minor device numbers must be specified. |
ncheckinode_num ... | Take the requested list of inode numbers, and print a listing of pathnames to those inodes. |
open [-w]device | Open a filesystem for editing. |
pwd | Print the current working directory. |
quit | Quit debugfs. |
rmpathname | Delete pathname. |
rmdirfilespec | Remove the directory filespec. This function is currently not implemented. |
setbblock | Mark the block number block as allocated. |
setifilespec | Mark inode filespec as in use in the inode bitmap. |
show_super_stats | List the contents of the superblock. |
statfilespec | Display the contents of the inode structure of the file specified by filespec. |
testbblock | Test if the block number block is marked as allocated in the block bitmap. |
testifilespec | Test if the inode filespec is marked as allocated in the inode bitmap. |
unlinkpathname | Remove the link specified by pathname to an inode. Note this does not adjust the inode reference counts. |
writesource destination | Copy the contents of source to destination. |
df
[option, ] [file, ]
Report the amount of space used and available on filesystem(s).
Example: To print out the current state of the filesystems with size in megabytes (-h option), use
df -h
This will produce output similar to the following:
Filesystem | Size | Used | Available | Capacity | Mounted on |
/dev/hda5 | 167M | 45M | 114M | 28% | / |
/dev/hda7 | 402M | 2.9M | 379M | 1% | /home |
/dev/hda6 | 1.6G | 815M | 703M | 54% | /usr |
where Filesystem is the disk partition corresponding to the mounted filesystem. Mounted on gives the entry in /etc/fstab corresponding to the disk partition. Size, Used, and Avail are obvious (though normally displayed by block count rather than megabytes).
You should run df every so often to get an idea of the usage of your filesystems. You want to keep it below about 90%. |
-a, --all | Also list filesystems of size 0, which are omitted by default. |
-h, -human-readable | Append letters to specify units of measurement (e.g., M=megabyte, K=kilobyte). |
--inodes | List inode usage information instead of block usage. |
-k, --kilobytes | Print size in 1024-byte blocks. |
-m, --megabytes | Print size in megabyte blocks. |
--no-sync | Do not run the sync system call before getting usage data. |
-P, --portability | Use the POSIX output format. |
--sync | Invoke the sync system call before getting usage data. |
-tFSTYPE,--type=FSTYPE | List only filesystems of type FSTYPE. |
-T,--print-type | Include the filesystem type (nfs, 4.2, ufs, efs, hsfs, cdfs, pcfs) in the listing. |
-xFSTYPE, --exclude-type=FSTYPE | Exclude from the listing filesystems of type FSTYPE. |
-v | Ignored; for compatibility with System V versions of "df". |
dumpe2fs
[ -b ] [ -V ] device
Print the superblock and blocks group information for the filesystem present on device.
Example: To print out the bad blocks on the filesystem located on /dev/sda1, enter
dumpe2fs -b /dev/sda1
To find out the devices associated with a given filesystem, use df. |
-b | Print the blocks marked as bad in the filesystem. |
-V | Print the version number of dumpe2fs and exit. |
e2fsck
[ -pacnyrdfvstFSV ] [ -b superblock ] [ -B block-size ] [ -l|-L bad_blocks_file ] [ -C fd ] device
e2fsck is used to check a Linux second extended file system for internal consistency. If errors are found, it can sometimes make repairs. If the system thinks the filesystem was unmounted cleanly, it will not perform a thorough check.
Example: To force a check of the /dev/hda2 filesystem, enter
e2fsck -f /dev/hda6
-a | Automatically repair the filesystem whenever possible. |
-bsuperblock | Use an alternative superblock specified by superblock. This option is normally used when the original superblock has been corrupted. |
-Bblocksize | Force e2fsck to search for the superblock at the specified blocksize. |
-c | Find and mark any bad blocks on the filesystem. |
-Cfd | Write completion information to the specified file descriptor so that the progress of the filesystem check can be monitored. |
-d | Print debugging output. |
-f | Force checking of the filesystem. |
-F | Flush the buffer caches before beginning check. |
-lfilename | Add the blocks listed in the file specified by filename to the list of bad blocks. |
-Lfilename | Set the bad blocks list to be the list of blocks specified by filename. |
-n | Open the filesystem read-only, and assume an answer of "no" to all questions. |
-p | Automatically repair the filesystem, if possible. |
-r | No effect; included for backward compatibility. |
-s | Force the filesystem to use little endian byte order if it isn't already. |
-S | Byte swap the filesystem, regardless of its current byte order. |
-t | Include timing statistics for e2fsck. |
-v | Verbose mode. |
-V | Print version information and exit. |
-y | Assume an answer of "yes" to all questions. |
fsck
[ -AVRTNP ] [ -s ] [ -t fstype ] [ fs-options ] filesys [ ]
Check and repair a Linux file system. filesys is either the device name or the mount point.
Example: To check the /usr/local filesystem without making any repairs, use
fsck -N /usr/local
Example: To check the filesystem on /dev/hdb2 and repair only after asking for confirmation, use
fsck -r /dev/hdb2
-A | Attempt to check all filesystems in /etc/fstab in one run. |
-R | When checking with -A flag, skip the root filesystem. |
-T | Don't show the title on startup. |
-N | Show what would be done, but don't execute. |
-P | Used with -A flag to check the root filesystem in parallel with other filesystems. |
-s | Serialize fsck operations. |
-V | Verbose. |
-tfstype | Specify the type of file system to be checked. If used with -A flag, check only filesystems that match fstype. Otherwise, check only filesystems that do not match fstype. |
-fs-options | Any options which are not understood by fsck, or which follow the -- option are treated as filesystem-specific options to be passed to the filesystem-specific checker. |
-a | Automatically repair the filesystem without prompting for confirmation. |
-r | Repair only after asking for confirmation. |
fsck.minix
[ -larvsmf ] device
Perform a consistency check on a Minix filesystem.
Example: To check the filesystem in /dev/sdb2 and include superblock information in the output, enter
fsck.minix -s /dev/sdb2
-l | List all filenames. |
-r | Repair filesystem only after prompting for confirmation. |
-a | Automatically repair filesystem without prompting for confirmation. |
-v | Run in verbose output mode. |
-s | Include super block information. |
-m | Activate MINIX-like "mode not cleared" warnings. |
-f | Force filesystem check. |
fuser
[-a|-s] [-n space] [-signal] [-kmuv] name [-] [-n space] [-signal] [-kmuv] name
fuser
-l
fuser
-V
Display the process id's of processes using the specified files or filesystems. In the default mode, the following codes are used to specify the type of access taking place:
c | Current directory. |
e | Executable being run. |
f | Open file. f is omitted in default display mode. |
r | Root directory. |
m | Mmap'ed file or shared library. |
Example: To check and kill any process accessing the /home filesystem, use
fuser -k /home
Example: To display the user names of people accessing a specified file, use
fuser -u /home/someone/file
Be sure to bookmark this page. You'll need it sooner or later. |
-a | Show all files specified on the command line. |
-k | Kill any process accessing the file. |
-l | Display list of signal names. |
-mfile | List all processes accessing files on filesystem or block device specified by name. |
-nspace | Use a different name space. |
-s | Operate silently. Overrides options a, u, and v. |
-signal | Use the specified signal instead of SIGKILL. |
-u | Append the user name of the process owner to each PID. |
-v | Run in verbose mode. |
-V | Display version information. |
- | Reset all options and set the signal back to SIGKILL. |
lsattr
[ -Radv ] [ files ]
Lists the attributes of a file on a Linux second extended file system.
Example: To recursively list the attributes in the /home filesystem, use
lsattr -R /home
-R | Recursively list attributes of directories and their contents. |
-a | List all files in directories, including those that start with a period ("."). |
-d | List any directories as if they were files, rather than listing their contents. |
-v | List the version. |
lsof
[ -?abChlnNOPRstUvVX ] [ -A A ] [ -c c ] [ -d d ] [-D D ] [ +|-f ] [ -F [f]] [ -g [s] ] [ -i [i] ] [ -k k ] [ -m m ] [ +|-M ] [ -o [o] ] [ -p s ] [ +|-r [t] ] [ -S [t] ] [ -T [t] ] [ -u s ] [ +|-w ] [ -- ] [names]
List all open files belonging to all active processes. Useful for identifying the process(es) that keep you from unmounting the filesystem that you desperately need to unmount for repairs.
Example: To list all files currently opened by user Jones, use
lsof -u jones
Example: To list the process ID's for all users accessing the /usr/local filesystem (and kill them off), enter
lsof -t /usr/local | kill -9
-? -h | Help for lsof command. |
-a | Subject list selection options to a logical AND. |
-Aalternative | Use alternative as an alternative name list file. |
-b | Skip kernel functions that might block. |
-cchar | List files for processes executing command beginning with characters specified by char. |
-C | Disable reporting of path name components from the kernel's name cache. |
-ds | List files whose file descriptors are in the set s. |
-Dfunction | Specify use of the device cache file. function is one of the following: Report device cache file paths. Build the device cache file. Ignore the device cache file. Read the device cache file. Read & update the device cache file. |
-Fchar_list | char_list select the fields to be output for processing for another program. |
-g[pgrp] | List files for processes whose process group identifiers are in the comma-separated set pgrp. |
-i[iadr] | List files whose Internet address matches the address specified in iadr. iadr is of the form: [protocol][@hostname|hostaddr][:service |port] |
-kkernel_name_list_file | Specifies a kernel name list file instead of /vmunix, /mach, etc. |
-l | Prevent conversion of user ID numbers to login names. |
-mkernel_memory_file | Allows the user to specify a kernel memory file other than the default. |
+|-M | Enable or disable the reporting of portmapper registrations for TCP and UDP ports. |
-n | Prevent the conversion of network numbers to host names for network files. |
-N | This option selects the listing of NFS files. |
-o | Display file offset at all times. |
-onum_digits | Specifies the number of decimal digits to be printed after the 0t for a file. |
-O | Do not take steps to avoid being blocked by kernel operations. |
-pprocess_id, process_id, ... | List files for processes specified by process_id. |
-P | Do not convert port numbers to port names for network files. |
+|-r [t] | Put lsof in repeat mode. lsof will list open files as specified in other options, pause for time t, and repeat. |
-R | This option directs lsof to list the Parent Process IDentification number in the PPID column. |
-s | Always display file size. |
-S[secs] | Specifies a timeout value in seconds for kernel functions that might otherwise deadlock. |
-t | Produce terse output (process id only). Useful for piping to kill(). |
-uuser, user,... | List files for users whose login names or UIDs have been specified. |
-U | List UNIX domain sockets. |
-v | Version information. |
-V | Specify files that lsof was asked to find but could not. |
+|-w | Enable or disable warning messages. |
mke2fs
[ -c | -l filename ] [ -b block-size ] [ -f fragment-size ] [ -i bytes-per-inode ] [ -m reserved-blocks-percentage ] [ -o creator-os ] [ -q ] [ -r fs-revision evel ] [ -R raid_options ] [ -s sparse-super-flag ][ -v] [ -F ] [ -L volume-label ] [ -M last-mounted-directory ] [ -S ] [ -V ] device [ blocks-count ]
Create a Linux second extended file system. device is the special file corresponding to the hardware device.
Example: To create a filesystem on /dev/hdb2, checking for bad blocks before formatting, use
mke2fs -c /dev/hdb2
Example: To re-create a damaged superblock on an already existing filesystem while (hopefully) preserving the existing files, use
mke2fs -S /dev/sda1
To create a filesystem, you must first partition out some disk space. Use fdisk or cfdisk for to partition space. |
-bblock-size | Specify the size of blocks in bytes. |
-c | Check the device for bad blocks before creating the filesystem. |
-ffragment-size | Specify the size of fragments in bytes. |
-ibytes-per-inode | Specify the bytes per inode ratio. |
-lfilename | Read the bad blocks list from filename. |
-mreserved-blocks-percentage | Specify the percentage of blocks reserved for the superuser. |
-o | Specify a creator operating system other than the default. |
-q | Supress output. |
-ssparse-super-flag | Turn on (1) or off (0) the sparse super flag. |
-v | Verbose execution. |
-F | Force mke2fs to run, even if the specified device is not a block special device. |
-L | Set the volume label for the filesystem. |
-M | Set the last directory in the new filesystem to be mounted. (Some utilities look at this value to see where the filesystem should be mounted.) |
-rrevision | Set the filesystem revision for the new filesystem. |
-Rraid_option | Set raid-related options for the filesystem. |
-S | Write superblock and group descriptors only. Useful in error recovery when you want to preserve the inode table. |
-V | Print version number. |
mkfs
[ -V ] [ -t fstype ] [ fs-options ] filesys [ blocks ]
Create a Linux file system on a device. This command is a front end for one of several other commands (e.g., mke2fs and mkfs.minix) that do the actual work.
Example: To create a minix filesystem mounted at databases, use
mkfs -t minix /databases
-V | Verbose output. |
-tfstype | Specifies the type of filesystem to be built. |
-c | Check for bad blocks before creating the filesystem. |
-lfilename | Read the bad block list from the file specified by filename. |
-v | Produce verbose output. |
mkfs.minix
[ -c | -l filename ] [ -n namelength ] [ -i inode-count ] [ -v ] device [ size-in-blocks ]
Create a Linux MINIX filesystem on a device.
Exit Codes |
|
0 | No errors |
8 | Operational error |
16 | Usage or syntax error |
Example: To create a minix filesystem with a maximum namelength of 16 on /dev/sda1, use
mkfs.minix -n 16 /dev/sda1
-c | Check for bad blocks before creating the filesystem. |
-nnamelength | Specify the maximum length of filenames. |
-iinodecount | Specify the number of inodes for the filesystem. |
-lfilename | Read the bad blocks list from filename. |
-v | Make a minix version 2 filesystem. |
mklost+found
Create a lost+found directory in the current working directory.
Example: This command has no options:
mklost+found
mkswap
[ -c ] device [size-in-blocks]
Create a Linux swap space on a device or in a file. Swap space is disk space (or, less usefully, file space) used to augment your system's RAM. When you run out of room in memory, the kernel swaps a chunk of the data in memory out to disk. When it's needed, it's swapped back in.
Example: To create a swap area on the device /dev/hda8, use
mkswap /dev/hda8
Swap partitions are more efficient than swap devices. |
-c | When creating swap partition on a device, check for bad blocks. |
mount
[-hV]
mount
-a [-fFnrsvw] [-t vfstype]
mount
[-fnrsvw] [-o options [, ]] device | dir
mount
[-fnrsvw] [-t vfstype] [-o options] device dir
Attach a filesystem to the directory tree and thereby make it ready for use.
Example: To make the cd-rom in the drive accessible, use
mount /mnt/cdrom
Example: To make the disk space represented by /dev/hda8 accessible for read/write as the /tmp filesystem, use
mount/dev/hda8 /tmp
The filesystems in /etc/fstab can be mounted automatically at boot time, so if you don't want to have to remount a new filesystem manually, include a line for it in /etc/fstab. |
Example: To mount all filesystems listed in the /etc/fstab file, enter
mount -a
-V | Display version. |
-h | Display help message. |
-v | Run in verbose mode |
-a | Mount all filesystems (of the given types specified in /etc/fstab.) |
-F | Used with -a. Fork off a new incarnation of mount for each device. Used for mounting across different devices/different NFSs. |
-f | Do everything except for actually executing the system call that mounts the filesystem. Useful in debugging. |
-n | Execute without writing in /etc/mtab. |
-s | Tolerate sloppy mount options rather than failing. |
-r | Mount the filesystem in read-only mode. |
-w | Mount the filesystem read/write. |
-tvfstype | Specifies the filesystem type. |
-o | Allows the user to specify one or more of the following list of options: |
| async All I/O to the file system should be done asynchronously. |
| atime Update inode access time for each access. This is the default. |
| auto Can be mounted with the -a option. |
| defaults Use default options: rw, suid, dev, exec, auto, nouser, and async. |
| dev Interpret character or block special devices on the file system. |
| exec Permit execution of binaries. |
| noatime Do not update inode access times on this file system. |
| noauto Can only be mounted explicitly (i.e., the -a option will not cause the file system to be mounted). |
| nodev Do not interpret character or block special devices on the filesystem. |
| noexec Do not permit execution of code on the mounted filesystem. |
| nosuid Do not allow set-user-identifier or set-group-identifier bits to take effect. |
| nouserForbid an ordinary (i.e., nonroot) user to mount the filesystem. This is the default. |
| remount Attempt to remount an already mounted filesystem. |
| ro Mount the filesystem in read-only mode. |
| rw Mount the filesystem in read-write mode. |
| suid Allow set-useridentifier or set-group-identifier bits to take effect. |
| sync All I/O to the file system should be done synchronously. |
| user Allow an ordinary user to mount the filesystem. |
Some options to the -o flag are specific to the filesystem. An incomplete list of those options follows:
Mount options for affs |
|
uid=valueand gid=value | Set owner and group of the root of the file system. |
setuid=valueand setgid=value | Set the owner and group of all files. |
mode=value | Set mode of all files to value && 0777 regardless of original permissions. |
Protect | Do not allow any changes to the protection bits on the filesystem. |
Usemp | Set uid and gid of the root of the filesystem to the uid and gid of the mount point. |
verbose | Print an informational message for each successful mount. |
prefix=string | Prefix used before volume name, when following a link. |
volume=string | Prefix (of length at most 30) used before "/" when following a symbolic link. |
reserved=value | Number of unused blocks at the start of the device. |
root=value | Use this option to explicitly specify the location of the root block. |
bs=value | Specify value for blocksize. |
Mount options for ext2 |
|
bsddf / minixdf | Set the behavior for the statfs system call to one of the two options. |
check / check=normal / check=strict | Set checking level. |
check=none / nocheck | Turn off checking. |
debug | Print debugging info when invoked. |
errors=continue / errors=remount-ro / errors=panic | Define the behavior when an error is encountered. |
grpid or bsdgroups / nogrpid or sysvgroups | Specify what group id a newly created file gets. |
resgid=n and resuid=n | Specify who benefits from reserved blocks. |
sb=n | Specify a block other than 1 as the superblock. Useful when filesystem has been damaged. |
Mount options for FAT, the MS-DOS filesystem. |
|
blocksize=512 / blocksize=1024 | Set blocksize (default 512). |
uid=valueand gid=value | Set the owner and group of all files. (Default: the uid and gid of the current process.) |
umask=value | Pretend the (nonexistent in FAT) file permissions are equal to value. |
check=[r | n | s] | Filename checking = relaxed, normal, or strict. Default = n. |
conv=b[inary] / conv=t[ext] / conv=a[uto] | Specifies whether or not to convert text files from MS-DOS format to UNIX format. |
debug | Turn on the debug flag. |
fat=12 / fat=16 | Specify either a 12-bit fat or a 16-bit fat. |
quiet | Turn on the quiet flag. Attempts to chown or chmod files do not return errors, although they still fail. |
Mount options for nfs |
|
rsize=8192,wsize=8192 | By resetting the buffer size, you can dramatically increase the speed of your NFS connection. |
hard | Force a program accessing a file on a NFS mounted file server to hang when the server crashes and wait until the server is back on line. |
soft | Allows the kernel to time out if the nfs server does not respond. |
nolock | Do not use locking. Do not start lockd. |
mountd
[ -f exports-file ] [ -d facility ] [ -P port ] [ -Dhnprv ] [ --debug facility ] [ --exports-file=file ] [ --help ] [ --allow-non-root ] [ --re-export ] [ --version ]
The mountd program is the NFS mount daemon. Before exporting a filesystem, it checks /etc/exports for permission. If the request is approved, it creates a file handle for the requested directory and adds an entry to /etc/rmtab. When unmounting, the entry in /etc/rmtab is removed.
Example: This daemon is usually invoked via script at boot time with a line such as:
mountd &
To startd mountd from inetd, add the following two lines to /etc/inetd.conf:
mount/1-2 dgram rpc/udp wait root /usr/sbin/rpc.mountd rpc.mountd
mount/1-2 stream rpc/tcp wait root /usr/sbin/rpc.mountd rpc.mountd
-f or --exports-file | This option specifies the exports file, which lists the clients that this server is authorized to serve, together with the parameters to apply to each mount. |
-d or --debug | Debug mode. Tells mountd to log each operation to standard error. |
-F or --foreground | Force mountd to stay attached to the terminal. |
-h or --help | Display help information. |
-n or --allow-non-root | Optionally allow mountd to serve requests that come from nonreserved IP ports. |
-P portnum or --port portnum | Specify the port for mountd to listen to. |
-p or --promiscuous | Force the server to honor requests from any client on the network. |
-r or --re-export | Allow imported file systems to be exported. |
-v or --version | Display the version number of the program. |
rdev
[ -rsvh ] [ -o offset ] [ image [ value [ offset ] ] ] rdev [ -o offset ] [ image [ root_device [ offset ] ] ]
Display the /etc/mtab line for the current root file system. Useful in scripting for identifying which device your filesystem is mounted on.
Example: To identify the device associated with the root filesystem:
rdev
-s | Causes rdev to act like swapdev. |
-r | Causes rdev to act like ramsize. |
-R | Causes rdev to act like rootflags. |
-v | Causes rdev to act like vidmode. |
-h | Provides help. |
/sbin/swapoff [-h -V]
/sbin/swapoff -a
/sbin/swapoff specialfile
When the system runs out of memory it uses disks or portions of disks that have been specially formatted (via cfdisk or fsdisk) as swap space. To disable swapping on a device or file currently being used for swapping, use
Example: To disable swapping on /dev/hd8, enter
swapoff /dev/hda8
-a | Disable swapping on all devices specified as swap devices in /etc/fstab. |
-h | Display help information. |
-V | Display version information. |
/sbin/swapon
[-h -V]
/sbin/swapon
-a [-v]
/sbin/swapon
[-v] [-p priority] specialfile
/sbin/swapon
[-s]
When the system runs out of memory it can use portions of disk space which have been specially formatted as swap space as a stand in for physical RAM. Swapon enables swapping/paging on the specified devices or files. The swapon command is typically executed during multiuser initialization.
Example: To enable swapping on /dev/hda8, use:
swapon /dev/hda8
-h | Display help information. |
-V | Display version information. |
-s | Summarize swap usage by device. |
-a | Make all devices marked "sw" in /etc/fstab available. |
-p priority | Specify priority from 0-32767 for swapon. |
sync
Write any data buffered in memory out to disk and update the superblock. Typically done before reboot to ensure disk sanity.
Example: This command has no options.
sync
tune2fs
[ -l ] [ -c max-mount-counts ] [ -e errors-behavor ] [ -i interval-between-checks ] [ -m reserved-blocks-percentage ] [ -r reserved-blocks-count ] [ -s sparse-super-flag ] [ -u user ] [ -g group ] [ -C mount-count ] [-L volume-name ] [ -M last-mounted-directory ] [ -U UUID ] device
Allows the user to adjust some parameters on the Linux second extended filesystem specified by device. Do not use on a mounted filesystem.
Example: To specify the user informix as the beneficiary of any reserved blocks, use
tune2fs -u informix /dev/hda2
Taking the time to add labels (e.g., /, /home, /usr ) to your disk partitions makes them easier to identify when partitioning new space with cfdisk. |
-cmax-mount-counts | Specify the maximum number of mounts between two filesystem checks. |
-e [continue | remount-ro | panic] | Specify the action for the kernel to take upon detection of an error. |
-ggroup | Set the user group that can benefit from the reserved blocks. group can be a numerical gid or a group name. |
-iinterval-between-checks[d|m|w] | Specify the maximum time between two filesystem checks in days, weeks, or months. A value of zero will disable checking. |
-l | Display the contents of the superblock. |
-mreserved-blocks-percentage | Specify the percentage of reserved blocks. |
-rreserved-blocks-count | Specify the count of reserved blocks. |
-ssparse_super_flag | Set or reset the sparse_superblock flag. Used to save space on enormous filesystems. |
-uuser | Specify the user who can benefit from reserved blocks. |
-Cmount-count | Specify the number of times the filesystem has been mounted. |
-Lvolume-label | Specify the volume label of the filesystem. |
-Mlast-mounted-directory | Specify the last-mounted directory for the filesystem. |
-UUUID | Specify the UUID of the filesystem. |
umount
[-hV]
umount
-a [-nrv] [-t vfstype]
umount
[-nrv] device | dir [ ]
Remove the specified filesystem from the directory hierarchy, thereby rendering it unavailable for use. Note that this command cannot be run successfully when any portion of the filesystem is in use. To identify who is using some portion of the filesystem, use the lsof command.
Example: To unmount the /home filesystem, use
umount /home
Example: To unmount all the filesystems specified in /etc/mtab, use
umount -a
-V | Version. |
-h | Help. |
-v | Verbose. |
-n | Unmount without writing in /etc/mtab. |
-r | If unmounting fails, try to remount in read-only mode. |
-a | Run umount on all filesystems listed in /etc/mtab. |
-t vfstype | Act only on filesystems of type vfstype. |