User Tools

Site Tools


devices-and-file-system

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
devices-and-file-system [2019/05/09 16:10]
Miroslav Bernát
devices-and-file-system [2019/09/17 23:22] (current)
Miroslav Bernát
Line 8: Line 8:
 | **lsscsi** | prints information about SCSI buses and devices connected to them, **-s** prints the disk size, **-u** LUN (logical unit identifier),​ **-w** WWN (device identifier – similar to MAC address), **-v** detailed output\\ ''​$ lsscsi | grep tape''​\\ (lists all SCSI tape devices) | | **lsscsi** | prints information about SCSI buses and devices connected to them, **-s** prints the disk size, **-u** LUN (logical unit identifier),​ **-w** WWN (device identifier – similar to MAC address), **-v** detailed output\\ ''​$ lsscsi | grep tape''​\\ (lists all SCSI tape devices) |
 | **rescan-scsi-bus.sh** | rescans all SCSI buses, **-a** checks also for newly added devices | | **rescan-scsi-bus.sh** | rescans all SCSI buses, **-a** checks also for newly added devices |
-| **lsblk** (<​device>​) | prints information about all or specified block devices in a tree-like format (device name, major and minor number, whether or not the device is removable, size of the device, whether or not the device is read only, type of device and mount point), **-a** including empty devices, **-f** file system type, **-m** owner, group and permissions,​ **-p** full device paths, **-S** SCSI devices only, **-o** <​list>​ specifies information (columns) to be displayed, **-l** output in the form of a list\\ ''​$ lsblk -o NAME,​SIZE''​ |+| **lsblk** (<device/partition>) | prints information about all or specified block devices in a tree-like format (device name, major and minor number, whether or not the device is removable, size of the device, whether or not the device is read only, type of device and mount point), **-a** including empty devices, **-f** file system type, **-m** owner, group and permissions,​ **-p** full device paths, **-S** SCSI devices only, **-o** <​list>​ specifies information (columns) to be displayed, **-l** output in the form of a list\\ ''​$ lsblk -o NAME,​SIZE'' ​
 +| **blkid** (<​partition/​LV>​) | prints attributes of all or specified block devices (UUID, LABEL, TYPE), **-L** <​LABEL>​ prints a partition that uses the specified LABEL, **-U** <​UUID>​ prints a partition that uses the specified UUID |
 | **lsof** (<​file/​device>​) | prints information about all or specified open files/​devices – their name, the program that uses the file/​device,​ PID, user name, file descriptor, file type, major and minor number of the device, file size in B and the i-node number, **-l** prints UID, **-p** <PID> by specified process, **-u** <​user>​ by specified user, **-r** <n> refreshes the list every //n// seconds\\ ''​$ lsof /​dev/​cdrom''​\\ ''​$ lsof /​dev/​snd/​*''​\\ ''​$ lsof -p $$''​\\ (prints open files from the current shell) | | **lsof** (<​file/​device>​) | prints information about all or specified open files/​devices – their name, the program that uses the file/​device,​ PID, user name, file descriptor, file type, major and minor number of the device, file size in B and the i-node number, **-l** prints UID, **-p** <PID> by specified process, **-u** <​user>​ by specified user, **-r** <n> refreshes the list every //n// seconds\\ ''​$ lsof /​dev/​cdrom''​\\ ''​$ lsof /​dev/​snd/​*''​\\ ''​$ lsof -p $$''​\\ (prints open files from the current shell) |
 | **iotop** | displays I/O disk usage, the speed of read and written data and a detailed, interactive list of all running processes in the system (the output changes according to the current state), **-o** active processes only, **-u** <​user>​ processes of a specified user, **-p** <PID> a specified process only, **q** quits the program | | **iotop** | displays I/O disk usage, the speed of read and written data and a detailed, interactive list of all running processes in the system (the output changes according to the current state), **-o** active processes only, **-u** <​user>​ processes of a specified user, **-p** <PID> a specified process only, **q** quits the program |
Line 21: Line 22:
 | **sync** | synchronizes data buffered in memory with a disk | | **sync** | synchronizes data buffered in memory with a disk |
 | **eject** (<​device>​) | ejects a device, **-t** inserts a device\\ ''​$ eject''​ / ''​eject /​dev/​cdrom''​ | | **eject** (<​device>​) | ejects a device, **-t** inserts a device\\ ''​$ eject''​ / ''​eject /​dev/​cdrom''​ |
-| **xinput** (<​option>​) (<​device>​) | configures and tests X input devices such as mice, keyboards, and touchpads, **list** prints information about specified input devices, without ​a parameter ​all input devices are listed, **test** tests a device, in case of error an endless loop of received events is displayed\\ ''​$ xinput test 11''​ |+| **xinput** (<​option>​) (<​device>​) | configures and tests X input devices such as mice, keyboards, and touchpads, **list** prints information about specified input devices, without ​an argument ​all input devices are listed, **test** tests a device, in case of error an endless loop of received events is displayed\\ ''​$ xinput test 11''​ |
 \\ \\
 ^ FILE SYSTEM & SWAP ^ ^ ^ FILE SYSTEM & SWAP ^ ^
-| **cat /​proc/​partitions** | displays partitions` names, the number of physical disk blocks contained in the particular partition and the major and minor numbers of the devices | +| **cat /​proc/​partitions** | displays partitions, the number of physical disk blocks contained in the particular partition and the major and minor numbers of the devices | 
-| **fdisk** <​device/​partition>​ | prints the number of cylinders on a disk and with the option **m** displays a menu for working with the partition table: **p** prints the partition table, **n** creates a new partition, **l** prints all available types of partitions, **t** changes ​the type of partition, **d** removes a partition, **q** exit, **w** saves a new partition table + exit; **-l** lists the partition table for the specified device, if no device is given, all mounted devices are used, **-u** prints sizes in sectors ​instead of cylinders\\ ''# ​fdisk -lu /dev/sdb''​ |+| **fdisk** <​device/​partition>​ | prints the number of cylinders on a disk and with the option **m** displays a menu for working with the partition table: **p** prints the partition table, **n** creates a new partition, **l** prints all available types of partitions, **t** sets the type of partition, **d** removes a partition, **q** quits the program, **w** writes changes to the disk and quits the program; **-l** lists the partition table for the specified device, if no device is specified, all mounted devices are used\\ ''#​ fdisk -l /​dev/​sdb''​ | 
 +| **parted** <​device>​ (<​command>​) | creates/​deletes disk partitions or changes their types, **print** displays the partition table, **unit** specifies units to be diplayed (e.g. "​s",​ "​B",​ "​kB",​ "​MB",​ "​MiB",​ "​GB",​ "​GiB",​ "​TB",​ "​TiB"​),​ **mklabel** creates a new disk label (e.g. "​msdos"​ or "​gpt"​),​ **mkpart** <​partition_type / partition_name>​ <​FS_type>​ <​start>​ <end> creates a new partition, **rm** <n> deletes a partition of the specified number, **select** <​device>​ selects a device to use, **set** <n> <​flag>​ <​state>​ sets the state of the flag on the partition of the specified number, **quit** quits the program; if no command is specified, it works interactively\\ ''#​ parted /dev/vda print''​\\ (displays the partition table on the /dev/vda disk)\\ ''#​ parted /dev/vda unit s print''​\\ (displays the partition table size in sectors)\\ ''# ​parted ​/dev/vdb mklabel msdos''​\\ (writes an MBR disk label to a disk)\\ ''#​ parted /dev/vdb mkpart primary xfs 2048s 1001MB''​\\ (creates a primary partition that is 1000 MB in size)\\ ''#​ parted /dev/vdc mklabel gpt''​\\ (writes a GPT disk label to a disk)\\ ''#​ parted /dev/vdc mkpart primary 1MiB 1001MiB; parted /dev/vdc set 1 lvm on''​\\ (creates a 1000 MiB partition with type Linux LVM)\\ ''#​ parted /dev/vdc mkpart swap1 linux-swap 1001MiB 1501MiB''​\\ (creates a swap partition named "​swap1"​) ​|
 | **partprobe** | informs the OS of partition table changes, **-s** prints a summary of devices and their partitions | | **partprobe** | informs the OS of partition table changes, **-s** prints a summary of devices and their partitions |
 +| **udevadm settle**\\ (implemented from RHEL 7) | informs the OS of partition table changes |
 | **mkfs** <​partition/​LV>​ | creates a file system on a specified partition (the partition must be unmounted), **-t** <FS> specifies the type of FS, **-c** checks the device for bad blocks, **-v** detailed output\\ ''#​ mkfs -ct ext3 /​dev/​sdb2''​ | | **mkfs** <​partition/​LV>​ | creates a file system on a specified partition (the partition must be unmounted), **-t** <FS> specifies the type of FS, **-c** checks the device for bad blocks, **-v** detailed output\\ ''#​ mkfs -ct ext3 /​dev/​sdb2''​ |
 | **mke2fs** <​partition/​LV>​ | creates an ext2, ext3, ext4 file system on a specified partition (the partition must be unmounted), **-b** <n> specifies the block size in B, **-c** checks the device for bad blocks, **-i** <n> specifies the number of bytes per i-node, **-t** <FS> specifies the type of FS, **-L** <​volume_label>​ sets a volume label of the FS, **-v** detailed output\\ ''#​ mke2fs -cvt ext4 /​dev/​sdb2''​\\ ''#​ mkfs.ext4 /​dev/​mapper/​centosvg/​weblv''​ | | **mke2fs** <​partition/​LV>​ | creates an ext2, ext3, ext4 file system on a specified partition (the partition must be unmounted), **-b** <n> specifies the block size in B, **-c** checks the device for bad blocks, **-i** <n> specifies the number of bytes per i-node, **-t** <FS> specifies the type of FS, **-L** <​volume_label>​ sets a volume label of the FS, **-v** detailed output\\ ''#​ mke2fs -cvt ext4 /​dev/​sdb2''​\\ ''#​ mkfs.ext4 /​dev/​mapper/​centosvg/​weblv''​ |
Line 35: Line 38:
 | **xfs_admin** | alters parameters of an xfs filesystem, **-L** <​volume_label>​ <​partition>​ sets a volume label of the partition with an xfs file system | | **xfs_admin** | alters parameters of an xfs filesystem, **-L** <​volume_label>​ <​partition>​ sets a volume label of the partition with an xfs file system |
 | **tune2fs** <​partition>​ | alters parameters of an ext2, ext3, ext4 file system, **-l** lists the contents of the FS superblock, **-L** <​volume_label>​ changes a volume label of the FS, **-j** adds an ext3 journal to the ext2 FS (the partition must be unmounted; the permanent setup requires changing „ext2“ to „ext3“ in ///​etc/​fstab//​),​ **-O** %%(^)%%<​feature>​ sets or when using „%%^%%“ character clears a particular feature of the FS, **-o** %%(^)%%<​mount_option>​ sets or when using „%%^%%“ character clears a particular mount option of the FS\\ ''#​ tune2fs -j /​dev/​sdb1''​\\ ''#​ tune2fs -O ^has_journal /​dev/​sdb1''​\\ (converts an ext3 FS back to ext2)\\ ''#​ tune2fs -o acl /​dev/​sdb1''​ | | **tune2fs** <​partition>​ | alters parameters of an ext2, ext3, ext4 file system, **-l** lists the contents of the FS superblock, **-L** <​volume_label>​ changes a volume label of the FS, **-j** adds an ext3 journal to the ext2 FS (the partition must be unmounted; the permanent setup requires changing „ext2“ to „ext3“ in ///​etc/​fstab//​),​ **-O** %%(^)%%<​feature>​ sets or when using „%%^%%“ character clears a particular feature of the FS, **-o** %%(^)%%<​mount_option>​ sets or when using „%%^%%“ character clears a particular mount option of the FS\\ ''#​ tune2fs -j /​dev/​sdb1''​\\ ''#​ tune2fs -O ^has_journal /​dev/​sdb1''​\\ (converts an ext3 FS back to ext2)\\ ''#​ tune2fs -o acl /​dev/​sdb1''​ |
-| **resize2fs** <​partition>​ (<​size>​) | changes (enlarges or shrinks) an ext2, ext3, ext4 file system size on a specified partition to the required value (the FS must be mounted), if the size is not specified when enlarging the FS, the partition maximum size is automatically used (if the FS spreads over the whole partition and is needed to be enlarged, the underlying partition must be expanded first; if the partition is to be shrunk, it must be unmounted first, checked by „fsck“ program, the FS size reduced first and then the partition size can be finally shrunk, but it must not be smaller than the new size of the FS), **-p** prints a percentage completion bars\\ ''#​ resize2fs /dev/sdb3 500M''​\\ ''#​ resize2fs /​dev/​vg00/​homelv''​ |+| **resize2fs** <​partition/LV> (<​size>​) | changes (enlarges or shrinks) an ext2, ext3, ext4 file system size on a specified partition to the required value (the FS must be mounted), if the size is not specified when enlarging the FS, the partition maximum size is automatically used (if the FS spreads over the whole partition and is needed to be enlarged, the underlying partition must be expanded first; if the partition is to be shrunk, it must be unmounted first, checked by „fsck“ program, the FS size reduced first and then the partition size can be finally shrunk, but it must not be smaller than the new size of the FS), **-p** prints a percentage completion bars\\ ''#​ resize2fs /dev/sdb3 500M''​\\ ''#​ resize2fs /​dev/​vg00/​homelv''​ |
 | **xfs_growfs** <FS> | enlarges an xfs file system size (the FS cannot be shrunk and must be mounted), **-D** <​size>​ specifies the FS size (if the size is not specified, the partition maximum size is automatically used) | | **xfs_growfs** <FS> | enlarges an xfs file system size (the FS cannot be shrunk and must be mounted), **-D** <​size>​ specifies the FS size (if the size is not specified, the partition maximum size is automatically used) |
 | **fsck** <​partition>​ | checks a file system and possibly repairs founded errors (the FS must be unmounted, „/“ in „read-only“ mode), **-A** checks subsequently all the FS specified in ///​etc/​fstab//​ (it is executed automatically at the system startup), **-R** skips the root FS, **-a** repairs errors automatically without any confirmation,​ **-r** interactive mode, **-t** <FS> specifies the FS type, **-V** detailed output\\ ''#​ fsck (-t ext3) /​dev/​sdb1''​ | | **fsck** <​partition>​ | checks a file system and possibly repairs founded errors (the FS must be unmounted, „/“ in „read-only“ mode), **-A** checks subsequently all the FS specified in ///​etc/​fstab//​ (it is executed automatically at the system startup), **-R** skips the root FS, **-a** repairs errors automatically without any confirmation,​ **-r** interactive mode, **-t** <FS> specifies the FS type, **-V** detailed output\\ ''#​ fsck (-t ext3) /​dev/​sdb1''​ |
 | **e2fsck** <​partition>​ | checks an ext2, ext3, ext4 file system and possibly repairs founded errors (the FS must be unmounted, „/“ in „read-only“ mode), **-c** checks the device for bad blocks, **-f** forces checking even if the FS seems to be clean, **-p** repairs errors automatically without any confirmation,​ **-v** detailed output\\ ''#​ e2fsck -vc /​dev/​sdb1''​ | | **e2fsck** <​partition>​ | checks an ext2, ext3, ext4 file system and possibly repairs founded errors (the FS must be unmounted, „/“ in „read-only“ mode), **-c** checks the device for bad blocks, **-f** forces checking even if the FS seems to be clean, **-p** repairs errors automatically without any confirmation,​ **-v** detailed output\\ ''#​ e2fsck -vc /​dev/​sdb1''​ |
 | **xfs_repair** <​partition>​ | checks an xfs file system and possibly repairs founded errors (the FS must be unmounted, „/“ in „read-only“ mode), **-n** prints possible errors only (without altering the FS) | | **xfs_repair** <​partition>​ | checks an xfs file system and possibly repairs founded errors (the FS must be unmounted, „/“ in „read-only“ mode), **-n** prints possible errors only (without altering the FS) |
-| **debugfs** (<​partition>​) | interactively examines or alters an ext2, ext3, ext4 file system, **-w** opens the FS in „read-write“ mode; **open** <​partition>​ opens the FS for a check / editing, **close** leaves the FS, **icheck** <​block>​ prints an i-node number using a specified block, **ncheck** <​i-node>​ prints the path to the given i-node (file), **quit** quits the program |+| **debugfs** (<​partition>​) | interactively examines or alters an ext2, ext3, ext4 file system, **-w** opens the FS in „read-write“ mode; **open** <​partition>​ opens the FS for a check / editing, **close** leaves the FS, **icheck** <​block>​ prints an i-node number using a specified block, **ncheck** <​i-node>​ prints the path to the specified ​i-node (file), **quit** quits the program |
 | **xfs_db** <​partition>​ | interactively examines or alters an xfs file system | | **xfs_db** <​partition>​ | interactively examines or alters an xfs file system |
 | **cat /​proc/​filesystems** | displays a list of the file system types currently supported by the kernel | | **cat /​proc/​filesystems** | displays a list of the file system types currently supported by the kernel |
Line 46: Line 49:
 | **cat /etc/mtab** / **cat /​proc/​mounts** | lists currently mounted file systems | | **cat /etc/mtab** / **cat /​proc/​mounts** | lists currently mounted file systems |
 | **df** (<​directory/​partition>​) | prints capacity usage information for all currently mounted file systems or a specified FS/​partition in kB, **-m** in MB, **-i** lists inode information instead of block usage, **-h** well-arranged output, **-l** only local FS, **-T** prints the type of all FS, **-t** <SS> only FS of the specified type, **-P** uses the POSIX output format\\ ''​$ df -P | awk '+$5 >= 90 {print}'''​\\ (prints FS usage equal to or greater than 90 %) | | **df** (<​directory/​partition>​) | prints capacity usage information for all currently mounted file systems or a specified FS/​partition in kB, **-m** in MB, **-i** lists inode information instead of block usage, **-h** well-arranged output, **-l** only local FS, **-T** prints the type of all FS, **-t** <SS> only FS of the specified type, **-P** uses the POSIX output format\\ ''​$ df -P | awk '+$5 >= 90 {print}'''​\\ (prints FS usage equal to or greater than 90 %) |
-| **mkswap** <​partition>​ | creates a swap area for virtual memory, **-L** <​volume_label>​ sets a volume label | +| **mkswap** <​partition/LV> | creates a swap space for virtual memory, **-L** <​volume_label>​ sets a volume label | 
-| **swapon** <​partition>​ | activates a swap area (to ensure permanent activation, the swap partition must be specified in ///​etc/​fstab//​ with „auto“ option), **-a** activates all swap partitions specified in ///​etc/​fstab//,​ **-s** displays active swap partitions (data from ///​proc/​swaps//​),​ **-v** detailed output | +| **swapon** <​partition/LV> | activates a swap space (to ensure permanent activation, the swap partition must be specified in ///​etc/​fstab//​ with „auto“ option), **-a** activates all swap partitions specified in ///​etc/​fstab//,​ **-s** displays active swap partitions (data from ///​proc/​swaps//​),​ **-v** detailed output ​(partition name, size, usage and priority) ​
-| **swapoff** <​partition>​ | deactivates a swap area |+| **swapoff** <​partition/LV> | deactivates a swap space, **-a** deactivates all swap partitions specified in ///​etc/​fstab//,​ **-v** detailed output ​|
 | **cat /​proc/​swaps** | displays active swap partitions | | **cat /​proc/​swaps** | displays active swap partitions |
-| **mount** (<device / partition / directory / NFS_server:​FS (directory)>​) | prints currently mounted file systems (data from ///​etc/​mtab//​) or mounts a specified FS, **-a** all FS in ///​etc/​fstab//​ with „defaults“ or „auto“ option, **-L** <​label>​ according to a given label, **-U** <​UUID>​ according to a UUID, **-t** <FS> specifies the FS type, **-n** without writing in ///​etc/​mtab//​ (e.g. if /etc should be mounted as read-only FS), **-o** <​attribute>​ specifies comma separated mount options (e.g. **remount** remounts an already-mounted FS **ro** read-only, **rw** read-write, (**no**)**dev** allows (not) character and block devices to access the FS, (**a**)**sync** allows (not) a synchronous read / write access to the FS, (**no**)**auto** mounts (not) FS automatically,​ **users** any user is allowed to mount and unmount the FS, (**no**)**user** allows (not) an ordinary user to mount the FS (and only this user is allowed to unmount it again), **usrquota**/​**grpquota** allows disk usage and limits on the FS for particular users/​groups (the attribute must exist in ///​etc/​fstab//​),​ (**no**)**acl** allows (not) extended ACL permissions for ext2, ext3 or ext4 FS, (**no**)**atime** updates (not) i-node access time for each access to the FS, (**no**)**suid** allows (not) setuid and setgid permissions for executable files, (**no**)**exec** allows (not) execution of binary files on the FS, **defaults** = rw, suid, dev, exec, auto, nouser, async)\\ ''​$ mount /​dev/​fd0''​ / ''​mount /​mnt/​floppy''​\\ (mount options for the specified device/​partition must be specified in ///​etc/​fstab//​)\\ ''​$ mount -t iso9660 /dev/cdrom /​mnt/​cdrom''​\\ ''​$ mount -t vfat /dev/sdc1 /​mnt/​flash''​\\ ''#​ mount -no remount,ro /''​\\ ''#​ mount server_01:/​data /​mnt/​nfs''​ |+| **mount** (<device / partition / directory / NFS_server:​FS (directory)>​) | prints currently mounted file systems (data from ///​etc/​mtab//​) or mounts a specified FS, **-a** all FS in ///​etc/​fstab//​ with „defaults“ or „auto“ option, **-L** <​label>​ according to a specified ​label, **-U** <​UUID>​ according to a UUID, **-t** <FS> specifies the FS type, **-n** without writing in ///​etc/​mtab//​ (e.g. if /etc should be mounted as read-only FS), **-o** <​attribute>​ specifies comma separated mount options (e.g. **remount** remounts an already-mounted FS **ro** read-only, **rw** read-write, (**no**)**dev** allows (not) character and block devices to access the FS, (**a**)**sync** allows (not) a synchronous read / write access to the FS, (**no**)**auto** mounts (not) FS automatically,​ **users** any user is allowed to mount and unmount the FS, (**no**)**user** allows (not) an ordinary user to mount the FS (and only this user is allowed to unmount it again), **usrquota**/​**grpquota** allows disk usage and limits on the FS for particular users/​groups (the attribute must exist in ///​etc/​fstab//​),​ (**no**)**acl** allows (not) extended ACL permissions for ext2, ext3 or ext4 FS, (**no**)**atime** updates (not) i-node access time for each access to the FS, (**no**)**suid** allows (not) setuid and setgid permissions for executable files, (**no**)**exec** allows (not) execution of binary files on the FS, **defaults** = rw, suid, dev, exec, auto, nouser, async)\\ ''​$ mount /​dev/​fd0''​ / ''​mount /​mnt/​floppy''​\\ (mount options for the specified device/​partition must be specified in ///​etc/​fstab//​)\\ ''​$ mount -t iso9660 /dev/cdrom /​mnt/​cdrom''​\\ ''​$ mount -t vfat /dev/sdc1 /​mnt/​flash''​\\ ''#​ mount -no remount,ro /''​\\ ''#​ mount server_01:/​data /mnt/nfs''​\\ ''#​ mount LABEL="​Test Label" /​test''​\\ ''#​ mount UUID="​b3cb79b8-a8c6-f188-064b-82236deb1604"​ /test''​ |
 | **umount** <device / partition / directory>​ | unmounts a file system (must not be used by any process), **-a** all mounted FS\\ ''​$ umount /​mnt/​flash''​\\ ''​$ umount /​dev/​sdc1''​ | | **umount** <device / partition / directory>​ | unmounts a file system (must not be used by any process), **-a** all mounted FS\\ ''​$ umount /​mnt/​flash''​\\ ''​$ umount /​dev/​sdc1''​ |
-| **showmount** (<​host>​) | prints a list of all hosts (clients) which are allowed to mount a local directory via NFS from the local or specified server (data from ///​etc/​exports//​),​ **-a** prints hostnames or IP addresses of the clients and the directories that are currently exported to them, **-e** prints a list of all exported directories and clients which are allowed to mount them | +| **showmount** (<​host>​) | prints a list of all hosts (clients) which are allowed to mount a local directory via NFS from the local or specified server (data from ///​etc/​exports(.d)//), **-a** prints hostnames or IP addresses of the clients and the directories that are currently exported to them, **-e** prints a list of all exported directories and clients which are allowed to mount them | 
-| **exportfs** (<​options>​) (<​client>​**:​**<​directory>​) | defines remote hosts (clients) and local directories that are supposed to be exported to them via NFS(permanent setup in ///​etc/​exports//​),​ **-a** exports all that is written in ///​etc/​exports//,​ **-r** repeats exporting of all items from ///​etc/​exports//​ (synchronizes ///​var/​lib/​nfs/​etab//​ with ///​etc/​exports//​),​ **-i** ignores information in ///​etc/​exports//​ and uses options ​given on the command line only, **-u** <​client>​**:​**<​directory>​ cancels a specified export, with „-a“ option it cancels exports of all the items in ///​etc/​exports//,​ **-o** specifies other options for exporting a local directory (the default options are **sync,​ro,​root_squash,​wdelay**)\\ ''#​ exportfs -o rw client1:/​usr/​tmp''​\\ ''#​ exportfs -au''​ |+| **exportfs** (<​options>​) (<​client>​**:​**<​directory>​) | defines remote hosts (clients) and local directories that are supposed to be exported to them via NFS (permanent setup in ///​etc/​exports(.d)//), **-a** exports all that is written in ///​etc/​exports(.d)//, **-r** repeats exporting of all items from ///​etc/​exports(.d)// (synchronizes ///​var/​lib/​nfs/​etab//​ with ///​etc/​exports(.d)//), **-i** ignores information in ///​etc/​exports(.d)// and uses options ​specified ​on the command line only, **-u** <​client>​**:​**<​directory>​ cancels a specified export, with „-a“ option it cancels exports of all the items in ///​etc/​exports(.d)//, **-o** specifies other options for exporting a local directory (the default options are **sync,​ro,​root_squash,​wdelay**), **-s** prints a list of all exported directories\\ ''#​ exportfs -s''​\\ ''#​ exportfs -o rw client1:/​usr/​tmp''​\\ ''#​ exportfs -au''​ |
 | **quota** | displays current user's disk usage and limits (quotas) on all mounted FS, **-u** <​user>​ for a specified user, **-g** <​group>​ for a specified group, **-v** detailed output | | **quota** | displays current user's disk usage and limits (quotas) on all mounted FS, **-u** <​user>​ for a specified user, **-g** <​group>​ for a specified group, **-v** detailed output |
 | **repquota** <FS> | prints a summary of the disk usage and quotas for the specified FS, **-a** on all mounted FS, **-u** reports quotas for users (by default), **-g** reports quotas for groups, **-v** detailed output | | **repquota** <FS> | prints a summary of the disk usage and quotas for the specified FS, **-a** on all mounted FS, **-u** reports quotas for users (by default), **-g** reports quotas for groups, **-v** detailed output |
-| **quotacheck** <FS> | checks quota information (maximum size of available disk space in i-nodes or in 1-kB blocks for users or groups) on the given FS with „usrquota“ or „grpquota“ attribute in ///​etc/​fstab//​ (before the scan the FS is mounted in „read-only“ mode, then again in „read-write“ mode), **-a** checks all mounted FS except for NFS, **-c** performs a new scan and creates //​aquota.user//​ / //​aquota.group//​ files (ignores existing quota files), **-u** checks user quotas (by default), **-g** checks group quotas, **-v** detailed output, **-i** interactive mode\\ ''#​ quotacheck -cvug /​home''​\\ (activates quotas on a specified FS) | +| **quotacheck** <FS> | checks quota information (maximum size of available disk space in i-nodes or in 1-kB blocks for users or groups) on the specified ​FS with „usrquota“ or „grpquota“ attribute in ///​etc/​fstab//​ (before the scan the FS is mounted in „read-only“ mode, then again in „read-write“ mode), **-a** checks all mounted FS except for NFS, **-c** performs a new scan and creates //​aquota.user//​ / //​aquota.group//​ files (ignores existing quota files), **-u** checks user quotas (by default), **-g** checks group quotas, **-v** detailed output, **-i** interactive mode\\ ''#​ quotacheck -cvug /​home''​\\ (activates quotas on a specified FS) | 
-| **edquota** <​user/​group>​ | sets quotas by editing //​aquota.user//​ or //​aquota.group//​ files, **-u** edits user quotas, **-g** edits group quotas, **-p** <​example>​ according to an example (user), **-f** <FS> only for the given FS, **-t** sets a maximum period (in units of seconds, minutes, hours or days), during of which a „soft limit“ can be exceeded up to the value called a „hard limit“ (if this period is not specified, the maximum value = „soft limit“)\\ ''#​ edquota -p tim `awk -F: '$3 > 499 {print $1}' /​etc/​passwd`''​ |+| **edquota** <​user/​group>​ | sets quotas by editing //​aquota.user//​ or //​aquota.group//​ files, **-u** edits user quotas, **-g** edits group quotas, **-p** <​example>​ according to an example (user), **-f** <FS> only for the specified ​FS, **-t** sets a maximum period (in units of seconds, minutes, hours or days), during of which a „soft limit“ can be exceeded up to the value called a „hard limit“ (if this period is not specified, the maximum value = „soft limit“)\\ ''#​ edquota -p tim `awk -F: '$3 > 499 {print $1}' /​etc/​passwd`''​ |
 | **setquota** <​user/​group>​ | sets quotas directly from the command line, **-u** edits user quotas, **-g** edits group quotas, **-p** <​example>​ according to an example (user), **-a** for all mounted FS with a parameter „usrquota“ / „grpquota“ set up, **-t** sets a maximum period (in units of seconds, minutes, hours or days), during of which a „soft limit“ can be exceeded up to the value called a „hard limit“ (if this period is not specified, the maximum value = „soft limit“)\\ ''#​ setquota -u tim 512 1024 0 0 /​home''​ | | **setquota** <​user/​group>​ | sets quotas directly from the command line, **-u** edits user quotas, **-g** edits group quotas, **-p** <​example>​ according to an example (user), **-a** for all mounted FS with a parameter „usrquota“ / „grpquota“ set up, **-t** sets a maximum period (in units of seconds, minutes, hours or days), during of which a „soft limit“ can be exceeded up to the value called a „hard limit“ (if this period is not specified, the maximum value = „soft limit“)\\ ''#​ setquota -u tim 512 1024 0 0 /​home''​ |
 | **quotaon** / **quotaoff** <FS> | turns quotas on/off on a specified FS, **-a** on all mounted FS, **-u** for user quotas, **-g** for group quotas | | **quotaon** / **quotaoff** <FS> | turns quotas on/off on a specified FS, **-a** on all mounted FS, **-u** for user quotas, **-g** for group quotas |
Line 64: Line 67:
 | **photorec** | recovers lost data from a HDD or portable media of various types of FS; it works interactively and automatically detects the FS, a particular data format can also be recovered | | **photorec** | recovers lost data from a HDD or portable media of various types of FS; it works interactively and automatically detects the FS, a particular data format can also be recovered |
 \\ \\
-^ LVM (logical volume manager) ^ dynamic ​partitions ​management ^+^ LVM (Logical Volume Manager) ^ dynamic ​disk partition ​management ^
 | **pvcreate** <PV> | initializes a PV (physical disk or partition) for use by LVM\\ ''#​ pvcreate /​dev/​sda4''​ | | **pvcreate** <PV> | initializes a PV (physical disk or partition) for use by LVM\\ ''#​ pvcreate /​dev/​sda4''​ |
 | **pvs** | prints information about all PVs in the system, their name, VG, attributes, size and free space | | **pvs** | prints information about all PVs in the system, their name, VG, attributes, size and free space |
 | **pvdisplay** (<​PV>​) | prints detailed information about all or specified PVs, **-m** displays the mapping of physical extents (PEs) to logical volumes (LVs) and logical extents (LEs) | | **pvdisplay** (<​PV>​) | prints detailed information about all or specified PVs, **-m** displays the mapping of physical extents (PEs) to logical volumes (LVs) and logical extents (LEs) |
-| **pvchange** <PV> | changes attributes of a PV, **-x** ​{**y**/**n**enables/​disables allocation of physical extents on the PV |+| **pvchange** <PV> | changes attributes of a PV, **-x** ​<**y**/**n**enables/​disables allocation of physical extents on the PV |
 | **pvresize** <PV> | resizes a PV\\ ''#​ pvresize --setphysicalvolumesize 40G /​dev/​sda1''​\\ ''#​ pvresize /​dev/​sda4''​\\ (expands the PV to get all free space on /dev/sda4) | | **pvresize** <PV> | resizes a PV\\ ''#​ pvresize --setphysicalvolumesize 40G /​dev/​sda1''​\\ ''#​ pvresize /​dev/​sda4''​\\ (expands the PV to get all free space on /dev/sda4) |
 | **pvmove** <​source_PV>​ (<​target_PV>​) | moves data from one PV to another, if the target PV is not specified, data are moved to any free space within the particular VG | | **pvmove** <​source_PV>​ (<​target_PV>​) | moves data from one PV to another, if the target PV is not specified, data are moved to any free space within the particular VG |
Line 75: Line 78:
 | **vgs** | prints information about all VGs in the system, their name, number of PVs/LVs, number of copies, size and free space | | **vgs** | prints information about all VGs in the system, their name, number of PVs/LVs, number of copies, size and free space |
 | **vgdisplay** (<​VG>​) | prints detailed information about all or specified VGs, **-v** including all the contained PVs and LVs | | **vgdisplay** (<​VG>​) | prints detailed information about all or specified VGs, **-v** including all the contained PVs and LVs |
-| **vgchange** <VG> | changes attributes of a VG, **-a** ​{**y**/**n**activates/​deactivates the VG\\ ''#​ vgchange -a n data_vg''​ |+| **vgchange** <VG> | changes attributes of a VG, **-a** ​<**y**/**n**activates/​deactivates the VG\\ ''#​ vgchange -a n data_vg''​ |
 | **vgrename** <​old_VG>​ <​new_VG>​ | renames a VG\\ ''#​ vgrename data_vg datavg''​ | | **vgrename** <​old_VG>​ <​new_VG>​ | renames a VG\\ ''#​ vgrename data_vg datavg''​ |
 | **vgextend** <VG> <PV> | adds a PV to a VG\\ ''#​ vgextend vg00 /​dev/​sda4''​ | | **vgextend** <VG> <PV> | adds a PV to a VG\\ ''#​ vgextend vg00 /​dev/​sda4''​ |
Line 82: Line 85:
 | **vgimport** <VG> | imports a VG (makes exported VGs known to the system) | | **vgimport** <VG> | imports a VG (makes exported VGs known to the system) |
 | **vgremove** <VG> | removes a VG | | **vgremove** <VG> | removes a VG |
-| **lvcreate** <LV> <VG> | creates an LV (virtual partition), **-n** <LV> sets an LV name, **-L** <​size>​ sets an LV size, **-l** <n> sets an LV size by allocating the number of logical extents, **-m** <n> sets a number of LV copies (creates a mirror of a linear LV), **-p** ​{**r**/**w**sets read / read and write permissions\\ ''#​ lvcreate -n web_lv -L 10G datavg''​ |+| **lvcreate** <LV> <VG> | creates an LV (virtual partition), **-n** <LV> sets an LV name, **-L** <​size>​ sets an LV size, **-l** <n> sets an LV size by allocating the number of logical extents, **-m** <n> sets a number of LV copies (creates a mirror of a linear LV), **-p** ​<**r**/**w**sets read / read and write permissions\\ ''#​ lvcreate -n web_lv -L 10G datavg''​ |
 | **lvs** | prints information about all LVs in the system, their name, VG, attributes, size and other information | | **lvs** | prints information about all LVs in the system, their name, VG, attributes, size and other information |
 | **lvdisplay** (<​LV/​VG>​) |  prints detailed information about all or specified LVs or all LVs on the specified VG, **-m** displays the mapping of logical extents (LEs) to physical volumes (PVs) and physical extents (PEs) and the type of LV (linear, mirrored, snapshot) | | **lvdisplay** (<​LV/​VG>​) |  prints detailed information about all or specified LVs or all LVs on the specified VG, **-m** displays the mapping of logical extents (LEs) to physical volumes (PVs) and physical extents (PEs) and the type of LV (linear, mirrored, snapshot) |
-| **lvchange** <LV> | changes attributes of an LV, **-p** ​{**r**/**w**sets read / read and write permissions,​ **-a** ​{**y**/**n**activates/​deactivates the LV\\ ''#​ lvchange -a n datavg/​web_lv''​ |+| **lvchange** <LV> | changes attributes of an LV, **-p** ​<**r**/**w**sets read / read and write permissions,​ **-a** ​<**y**/**n**activates/​deactivates the LV\\ ''#​ lvchange -a n datavg/​web_lv''​ |
 | **lvrename** ​ <​old_LV>​ <​new_LV>​ | renames an LV\\ ''#​ lvrename datavg/​web_lv datavg/​weblv''​ | | **lvrename** ​ <​old_LV>​ <​new_LV>​ | renames an LV\\ ''#​ lvrename datavg/​web_lv datavg/​weblv''​ |
 | **lvresize** <LV> | changes an LV size, **-L** (**+**/​**-**)<​size>​ sets, enlarges or shrinks an LV size to the required value in MB (M), GB (G), TB (T), PB (P), EB (E), **-l** <n> sets an LV size by allocating the number of logical extents (if the FS spreads over the whole LV and is needed to be enlarged, the underlying LV must be expanded first; if the LV is to be shrunk, it must be unmounted first, checked by „fsck“ program, the FS size must be reduced first and then the LV size can be finally shrunk, but it must not be smaller than the new size of the FS), **-r** resizes the underlying file system\\ ''#​ lvresize -rL +200M vg00/​rootlv''​\\ ''#​ lvresize -l +100%FREE /​dev/​VolGroup00/​LogVol00''​\\ (extends the LV to occupy the remaining free space in the VG) | | **lvresize** <LV> | changes an LV size, **-L** (**+**/​**-**)<​size>​ sets, enlarges or shrinks an LV size to the required value in MB (M), GB (G), TB (T), PB (P), EB (E), **-l** <n> sets an LV size by allocating the number of logical extents (if the FS spreads over the whole LV and is needed to be enlarged, the underlying LV must be expanded first; if the LV is to be shrunk, it must be unmounted first, checked by „fsck“ program, the FS size must be reduced first and then the LV size can be finally shrunk, but it must not be smaller than the new size of the FS), **-r** resizes the underlying file system\\ ''#​ lvresize -rL +200M vg00/​rootlv''​\\ ''#​ lvresize -l +100%FREE /​dev/​VolGroup00/​LogVol00''​\\ (extends the LV to occupy the remaining free space in the VG) |
 | **lvconvert** <LV> | changes the type of LV, **-m** <n> sets a number of LV copies (creates a mirror of a linear LV), **-s** <​source_LV>​ <​target_LV>​ creates a snapshot of an LV\\ ''#​ lvconvert -s vg00/lvol1 vg00/​lvol2''​ | | **lvconvert** <LV> | changes the type of LV, **-m** <n> sets a number of LV copies (creates a mirror of a linear LV), **-s** <​source_LV>​ <​target_LV>​ creates a snapshot of an LV\\ ''#​ lvconvert -s vg00/lvol1 vg00/​lvol2''​ |
 | **lvremove** <LV> | removes an LV | | **lvremove** <LV> | removes an LV |
 +\\
 +^ ADVANCED STORAGE FEATURES ^ ^
 +| **Storage Management with Stratis**\\ (implemented from RHEL 8)  | **manages pools of physical storage devices and expands file systems when needed** |
 +| **stratis pool create** <​pool>​ <​device>​ | creates a pool of one or more block devices\\ ''#​ stratis pool create pool1 /​dev/​vdb''​ |
 +| **stratis pool list** | lists all pools on the system |
 +| **stratis pool rename** <​old_pool>​ <​new_pool>​ | renames a pool |
 +| **stratis pool destroy** <​pool>​ | removes a pool |
 +| **stratis pool add-data** <​pool>​ <​device>​ | adds additional block devices to a pool\\ ''#​ stratis pool add-data pool1 /​dev/​vdc''​ |
 +| **stratis blockdev list** (<​pool>​) | lists block devices of a specified pool; without an argument block devices of all pools are displayed |
 +| **stratis fs create** <​pool>​ <FS> | creates a dynamic and flexible file system from a pool (situated in ///​stratis/<​pool>/<​fs>//​)\\ ''#​ stratis fs create pool1 fs1''​ |
 +| **stratis fs snapshot** <​pool>​ <FS> <​snapshot>​ | creates a snapshot of a specified file system (situated in ///​stratis/<​pool>/<​fs_snap>//​)\\ ''#​ stratis fs snapshot pool1 fs1 fs1_snap''​ |
 +| **stratis fs list** (<​pool>​) | lists file systems and their snapshots of a specified pool; without an argument file systems of all pools are displayed |
 +| **stratis fs destroy** <​pool>​ <​FS/​snapshot>​ | removes a file system or snapshot of a specified pool\\ ''#​ stratis fs destroy pool1 fs1''​ / ''​fs1_snap''​ |
 +| **Compressing And Deduplicating Storage with Virtual Data Optimizer**\\ (implemented from RHEL 8)  | **reduces disk space usage on block devices and minimizes the replication of data** |
 +| **vdo create --name=**<​vdo_name>​ **--device=**<​device>​ **--vdoLogicalSize=**<​size>​ | creates a VDO volume of a device and specified size\\ ''#​ vdo create --name=vdo1 --device=/​dev/​vdd --vdoLogicalSize=500G''​ |
 +| **vdo list** | lists all active VDO volumes |
 +| **vdo status --name=**<​vdo_name>​ | prints settings for a specified VDO volume; without an argument settings for all VDO volumes are displayed |
Last modified: 2019/05/09 16:10 by Miroslav Bernát

visits: