Storage management, LVM, and file systems (bottom) Navigation: Managing Logical Volume file systems managing logical volumes one logical volume mapping one or more physical volumes, depending on the number of copies of data you want to maintain a single logical volume copy that represents the mapping of a logical partition to a physical partition adding a logical volume Use the MKLV command to create a logical volume that specifies the name of a logical volume and defines its characteristics, including the number of logical partitions to allocate (default is 128 logical partitions)    MKLV Command flag: - C Set the number of physical partitions per logical partition             -I read from standard input phsical The volume parameter -l sets the logical volume label. The label size is 127 characters, and if the logical volume will be used as a journaling file system (JFS), JFS will use this field to store the file system's mount point on the logical volume. -p permissions to specify special files for logical volumes (file mode)          -T sets the type of the logical volume. Standard types are JFS (file system), Jfslog (journal file System log), and paging (paging space)  -Y Specifies the name of the logical volume to use    Example: A new logical Volume NEWLV is created in ROOTVG, and the logical volume has 10 logical partitions, each of which consists of two physical partitions. mklv -y newlv -c 2 rootvg 10 or use the smit mklv command delete a logical volume Delete a logical volume using the RMLV command RMLV Command flag:             -F Delete Logical volume without requesting confirmation -p only delete logical partitions on PV. Example: Deleting a logical Volume newlv rmlv newlv or smit rmlv reduce the size of the logical volume back up all data in a logical volume, delete the logical volume, re-create a logical volume with reduced logical partition allocation, restore data increase the size of the logical volume use ExtendLV command or SMIT EXTENDLV increase the size of an existing logical volume Example: Add 3 additional partitions to the logical volume extendlv newlv 3 Copy Logical Volumes example: Copy logical volumes using the CPLV command, copy data from logical volumes OLDLV to NEWLV logical volumes in volume group MYVG cplv -v myvg -y newlv oldlv Note: If you do not specify a volume group, the default is to create a new logical volume in the OLDLV volume group Example: Copying a logical volume OLDLV to an existing logical volume existinglv cplv -e existinglv oldlv Note: If CPLV creates a new logical volume and the volume group is Varyon in concurrency mode, this command will fail; do not copy logical volumes containing large data to smaller logical volumes, which can result in corrupt file systems. Example: Change the type of logical volume to copy cplv -t copy newlv splitting a copy of a logical volume splitlvcopy splits a copy of a logical volume and creates a separate new logical volume from those replicas. You should unmount the file system and close the logical volume before splitting the logical volume Note: The splitlvcopy command splits the open logical volume. A logical volume that contains those mounted file systems. It is not recommended to do this, and if multiple processes are accessing the logical volume at the same time, the LV and NEWLV may lose consistency. Example: To split a copy of each logical partition in the logical volume OLDLV (there are currently three replicas) and create a new logical volume NEWLV splitlvcopy -y newlv oldlv 2 now each logical partition in the OLDLV contains 2 physical partitions now each logical partition in NEWLV contains 1 physical partitions listing logical volumes using commands:lsvg |lsvg -il Logical Volume Size total Logical Volume size =PP size  *  number of LP assigned to LV  * LV number of copies six, file system aix support three file systems: Journaling Log File System (JOURNALED FILE SYSTEM,JFS) native file system, each journaling file system resides in a separate logical volume, and the operating system mounts certain journaling file systems during initialization (the journaling file system necessary to start and run the system) Network File System (NFS) Distributed File system that allows users to access files and directories on remote computers. cd-rom file System (Cdrfs) allows access to the contents of the CD-ROM through a generic file system interface The journaling file system divides logical volumes into a number of fixed-size units, which are called logical blocks. Logical blocks in the file system organize: logical blocks in the following way 0 The first logical block of the file system is reserved and can be used for the boot program or other required information that the file system does not use for this block. Super Block the 1th to 31st logical block for the Super block. The Super block contains information about the total file system size, file system name, file system log device address, version number, and file system status. Distribution Groups The rest of the logical blocks in the file system are divided into allocation groups, which consist of blocks of data and index nodes, which are used to refer to the data blocks when they are assigned to a directory or file. Manage journaling file systems file systems are collections of files, directories, and other data structures. The file system maintains the relevant information and identifies the specific location of the file or directory data. The file system also contains a boot block, a super block, a bitmap, one or more allocation groups. Allocation groups include disk index nodes and fragmentation (fragment) Journaling file system features number of index nodes Allocation Group size File system fragmentation addressable Journaling file system log size   &Nbsp; maximum size of the journaling file system number of index nodes The total number of index nodes in the file system limits the total number of files and the total size of the file system. JFS provides a nbpi (number of bytes per index node) parameter that is used to change the number of index nodes in the file system. The NBPI values supported by JFS are 512, 1024, 2048, 4096, 8192, 16384, 65536, and 131072. Creating a 8M file with a NBPI of 4096 will create an index node for every 4096 bytes of data, resulting in a maximum of 2048 index nodes for the 8M file system. JFS restricts the size of all file systems to 16MB index nodes allocation groups AIX isolates file system space as an index node and a grouping of disk blocks used for user data, which become allocation groups. The size of the allocation group can be specified when the file system is created, and the allocation group size can be 8MB, 16MB, 32MB, 64mb file system segment addressable JFS supports 4 fragment sizes: 512, 1024, 2048, and 4096 bytes of contiguous disk space units. JFS maintains a 28-bit number of segmented addresses in index nodes and space blocks. Each segment must be addressable by a number of 0~2 28-square-size digits. The segment is the smallest addressable storage unit. If the file is primarily 400 bytes in size, then the fragment size of 512 will be the most efficient. journal size of the journaling file system multiple Journaling file system uses a common log to become a JFS log, and configured to a 4MB size. after initial installation, All file systems in the root volume group are hd8 as public JFS logs with logical volumes, default to 4MB, and the default log size is one partition; when the total amount of file system space using a single log exceeds 2GB, the default log size needs to be increased, and JFS logs are limited to maximum 256MB. maximum size of the journaling file system the largest JFS size is defined when the file system is created. file System size limit is (NPBI *224) or fragment size *228 minimum value Create file system use Smit crjfs Creating a Journaling file system Note: In Aix, all I/O is done in blocks of 4KB But the space is allocated in multiples of 512-byte blocks, and the smallest file system that can be created equals one pp. Example: 512 bytes = 1 block 1024 bytes = 2 blocks 1mb = 2 * 1024 pieces of xmb = x * 1024 pieces of Example: Create a 4KB dayRecord the file system and use/dummy as the mount point in the ROOTVG volume group. mount file System mount refers to enabling users to use file systems, files, directories, devices, and special files. aix the process of using a mount point to connect a newly created file system to another file tree: Note: Mount the file system to a directory where the permissions of the mounted file system root take precedence over the mount point's permissions FAQ is the PWD command failed because there is no mount point directory for the search permission to return permission denied. by setting the mount point directory's permissions at least to 111, You can avoid this problem. mount a file system using the command line (/FILESYSTEMX) mount /FileSystemX If you know the device name associated with the file system, you can use the device name to mount the newly created file system; if you want to mount all file systems:mount{-a|all}; using SMIt mounted file system:smit mount Auto Mount set mount to automatically mount during system initialization, there are two types of automatic mounts: the first type: Mount required for startup and system operation. Sections of such file systems in the/etc/filesystem file have the Mount=automatic property. When multi-user initialization, the/ETC/RC script tries to run the Mount all command, the file systems are not mounted, similar to running the Unmount all command and will not unload the file systems. Second type: User-controlled automatic mounting. A section of such a file system in a/etc/filesystem file has the Mount=true property, which is mounted during system initialization by a Mount all command issued by the/ETC/RC script. via Mount all command or/ETC/RC script that specifies that a file system is automatically mounted on initialization. Set the Mount automatically as system restart field to true by creating the file system, or by command crfs -a yes filename display mounted File system using the Mount command   &Nbsp; Deleting file systems Step 1: Viewing mounted file systems, using the Mount command. Step 2: If the file system is removed, uninstall the file system using the Unmount command, #unmount filename. Repeat step 1 to confirm whether the uninstallation was successful; If deleting the file system is not mounted, skip directly to step 3. Step 3: Use SMIT RMJFS to delete the journaling file system, if you delete the directory that mounts this file system, the remove Mount point field set to yes; Use the command #rmjfs filename if you delete the mount point plus the-r flag. increase file System size aix provides the ability to dynamically increase file system space, To ensure that the disk has sufficient space. increase file system size using the command line Step 1: Use the DF command to determine the size of the file system Step 2: Calculate the number of blocks to add         &Nbsp; Step 3: Enter the command #chfs -a size=new_size_in_512_byte_blocks filename using Smit to increase file system size Step 1:smit chfs Check File system consistency The fsck command checks the file system for consistency and interactively repairs the file system. fsck's logo: -f: Perform a quick check. The only file system that is affected when the system hangs without a graceful shutdown is the file system that is mounted when the system is stopped. -p: does not display messages for minor issues, but instead automatically fixes them. -y: A positive answer to all the questions raised by the fsck command should run the fsck command before mounting any file system. Must be able to read the device file where the file system resides. The         FSCK command only reports the number of files in the file system, blocks used, and free blocks. If the file system is inconsistent, fsck displays information about the inconsistencies that have been found and prompts you to allow them to be repaired. mounting inconsistent file systems mayCauses the system to crash, if you do not specify a file system using the filesystem parameter, the fsck command checks all file systems that have property check=true in/etc/filesystems. Note: By default, the/,/usr,/var and/tmp file systems are in their/etc/ Set the Check property to False (Check=false) in filesystem section, for the following reasons: The startup process explicitly runs the fsck command against the/,/usr,/var and/tmp files. /,/usr,/var and/tmp file systems are mounted when the/ETC/RC file is running, and fsck does not modify the mounted file system. Initialize a JFS log device The Logform command initializes a logical volume that has been used as a JFS log device that stores information about the file system metadata and can be used to roll back unfinished operations when it crashes. General syntax of the logform command:logform logname Note: The logform command is destructive; it clears all data from the logical volume. the file system should be uninstalled before running the Logform command. The Logform command destroys all log records on an existing log device, which can result in file system data loss.   Placement of JFS log devices placing a JFS log device on a physical volume that differs from the most active file system, preferably on a disk with the lowest I/O usage To increase the utilization of parallel resources. file systems that support large files in file systems that support large files, The file data stored before the 4MB file offset is allocated in a 4096-byte block, and after the 4MB file offset, the stored file data is allocated using a large disk block of 128KB size (32 4096-byte blocks). Example: A 132MB file that has 1024 4KB disk blocks and 1024 128KB disk blocks and two separate indirect blocks in a large file system. Requires 33 separate indirect blocks (1024 4KB disk addresses per block) in a normal file system identify file systems that support large files lsfs -q filesystem #lsfs -q /tmp Troubleshooting the file system recover the Super block error damage to the Super block, by restoring the Super block backup to the master Super block, To solve the problem: #dd count=1 bs=4k skip=31 seek=1 if=/dev/lvoo of=/dev/lvoo After you complete the restore process, use the fsck command to check the integrity of the file system #fsck /dev/lvoo In most cases, restoring a super block backup to the master Super block will restore the file system. If it is not valid, recreate the file system and restore the data from the backup. cannot uninstall file system If there are any active references to the file system, you cannot unmount the file system. The error message will be displayed: Device busy or a device is already mounted or cannot be Unmount. Countermeasures: These files must be closed when the file system is uninstalled. #fuer filesystem will display the file system reference that opens theThere is a process ID. Use the KILL command to terminate the process that opened the reference, and then you can complete the uninstallation work. If the file system is still busy and cannot be uninstalled, it may be because the kernel extension is loaded, but it exists in the source file system. fuser does not display references to the following file types because no user processes are involved The Genkex command will report all loaded kernel extensions. ① the file system mounts other file systems. Uninstall these file systems, and then uninstall the file system. Using the Mount command to get a list of mounted file systems, to unmount a file system, you need to unmount all of the file systems that are mounted on it. The ② process is using the directory in the file system as its current working directory. The-u flag of fuser can determine the owner of the process. #fuser -u /tmp
aix-Storage Management and logical volume management (bottom)