In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Words
As you know, AIX has countless commands that enable you to perform a large number of tasks. Depending on the tasks you need to accomplish, you may only use a subset of these commands. These subsets vary with different users and needs. However, there are some core commands that you usually use. You need these commands to answer your own questions or to provide answers to questions from support staff.
In this article, I'll discuss some of these core commands. The purpose is to provide you with a list that can be used as a convenient reference. Although the behavior of these commands should be the same in all AIX versions, they were only tested under AIX 5.3.
Note:
The bootinfo discussed in the following paragraphs is not a user-level command and is not supported in AIX 4.2 or later.
Go back to the top of the page
Command
Kernel
How do you know if you are running a 32-bit kernel or a 64-bit kernel?
To show whether the kernel is 32-bit or 64-bit enabled, enter the following command:
Bootinfo-K
How do you know if you are running a single processor or a multiprocessor core?
/ unix is a symbolic link to the booted kernel. To see what kernel mode you are running, type ls-l / unix and see what file / unix links to. Here are three possible outputs of the ls-l / unix command and their corresponding kernels:
/ unix-> / usr/lib/boot/unix_up # 32 bit uniprocessor kernel / unix-> / usr/lib/boot/unix_mp # 32 bit multiprocessor kernel / unix-> / usr/lib/boot/unix_64 # 64 bit multiprocessor kernel
Note:
AIX 5L Version 5.3 does not support a single processor core.
How do I change from one kernel mode to another?
During the installation process, a kernel suitable for the hardware in the AIX version and operation is enabled by default. Let's use the method from the previous question and assume that the 32-bit kernel is enabled. We also assume that you want to start in 64-bit kernel mode. This can be achieved by executing the following commands sequentially:
Ln-sf / usr/lib/boot/unix_64 / unix ln-sf / usr/lib/boot/unix_64 / usr/lib/boot/unix bosboot-ad / dev/hdiskxx shutdown-r
The / dev/hdiskxx directory is the location where the logical volume / dev/hd5 is started. To find out which xx is in hdiskxx, run the following command:
Lslv-m hd5
Note:
In AIX 5.2, the 32-bit kernel is installed by default. In AIX 5.3, the 64-bit kernel is installed by default on 64-bit hardware and the 32-bit kernel is installed on 32-bit hardware.
Hardware
How do I know if my computer can run AIX 5L Version 5.3?
AIX 5L Version 5.3 runs on all currently supported POWER hardware based on the Common hardware reference platform (Common Hardware Reference Platform,CHRP).
How do I know if my computer is based on CHRP?
Run the prtconf command. If it is a CHRP computer, the string chrp appears on the Model Architecture line.
How do I know if my System p computer (hardware) is 32-bit or 64-bit?
To display whether the hardware is 32-bit or 64-bit, enter the following command:
Bootinfo-y
How much actual memory does my computer have?
To display the actual memory in KB, enter one of the following commands:
Bootinfo-r
Lsattr-El sys0-a realmem
Can my computer run a 64-bit kernel?
64-bit hardware is required to run the 64-bit kernel.
What are the device attribute values in my system?
To list the current attribute values for the tape device rmt0, enter the following command:
Lsattr-l rmt0-E
To list the default attribute values for the tape device rmt0, enter the following command:
Lsattr-l rmt0-D
To list the possible login attribute values for the TTY device tty0, enter the following command:
Lsattr-l tty0-a login-R
To display system-level properties, enter the following command:
Lsattr-E-l sys0
How many processors does my system have?
To display the number of processors on your system, enter the following command:
Lscfg | grep proc
How many hard drives are there on my system and which hard drives are currently in use?
To display the number of hard drives on the system, enter the following command:
Lspv
How do I list information about specific physical volumes?
For example, to learn more about hdisk1, run the following command:
Lspv hdisk1
How to get the detailed configuration of the system?
Enter the following command:
Lscfg
The following options provide specific information:
-p displays platform-specific device information. This flag applies to AIX version 4.2.1 or later. -v displays the important product database (Vital Product Database,VPD) found in the custom VPD object class.
For example, to display detailed information about the tape drive rmt0, enter the following command:
Lscfg-vl rmt0
You can get very similar information by running the prtconf command.
How to determine the chip type, system name, node name, model, and so on?
The uname command provides more information about the system.
Uname-p displays the chip type of the system. For example, PowerPC. Uname-r displays the version number of the operating system. Uname-s displays the system name. For example, AIX. Uname-n displays the node name. Uname-a displays the system name, node name, version, and computer ID. Uname-M displays the system model name. For example, IBM, 9114-275. Uname-v displays the operating system version. Uname-m displays the computer ID number of the hardware on which the system is running. Uname-u displays the system ID number.
AIX
What major, minor, and maintenance levels of AIX are running on my system?
Enter one of the following commands:
Oslevel-r
Lslpp-h bos.rte
How do I determine which fileset updates are missing at a particular AIX level?
For example, to determine which fileset updates are missing in 5300-04, run the following command:
Oslevel-rl 5300-04
What SP (Service Pack) is installed on my system?
To find out which SP is currently installed on your system, run the oslevel-s command. For an AIX 5L Version 5.3 system with TL4 and SP2 installed, the sample output is as follows:
Oslevel-s 5300-04-02
Is CSP (Concluding Service Pack) installed on my system?
To determine if a CSP is currently installed on the system, run the oslevel-s command. For an AIX 5L Version 5.3 system with TL3 and CSP installed, the sample output is as follows:
Oslevel-s 5300-03-CSP
How do I create a file system?
The following command creates a jfs file system of size 10MB and mount point / fs1 in the volume group testvg:
Crfs-v jfs-g testvg-a size=10M-m / fs1
The following command creates a jfs2 file system with 10MB size, mount point / fs2, and read-only permissions in the volume group testvg:
Crfs-v jfs2-g testvg-a size=10M-p ro-m / fs2
How do I change the size of a file system?
To increase the size of the / usr file system by 1000000 blocks of 512 bytes, enter the following command:
Chfs-a size=+1000000 / usr
Note:
In AIX 5.3, the size of the JFS2 file system can also be shrunk.
How do I install CD?
Enter the following command:
Mount-V cdrfs-o ro / dev/cd0 / cdrom
How do I install a file system?
The following command mounts the file system / dev/fslv02 in the / test directory:
Mount / dev/fslv02 / test
How do I install all the default file systems (all standard file systems marked with the mount=true attribute in the / etc/filesystems file)?
The following command mounts all such file systems:
Mount {- a | all}
How do I unmount a file system?
Unmount the / test file system by entering the following command:
Umount / test
How do I display installed file systems?
Enter the following command to display information about all currently mounted file systems:
Mount
How do I delete a file system?
Enter the following command to delete the / test file system:
Rmfs / test
How do I defragment a file system?
You can use the defragfs command to improve or report the state of contiguous space in the file system. For example, to defragment a file system / home, you can use the following command:
Defragfs / home
Which fileset contains a particular binary?
To show that / usr/bin/vmstat contains bos.acct, enter the following command:
Lslpp-w / usr/bin/vmstat
Or to show that bos.perf.tools contains / usr/bin/svmon, enter the following command:
Which_fileset svmon
How do I display information about installed filesets on my system?
Enter the following command:
Lslpp-l
How do I determine if all maintenance-level filesets are installed on my system?
Enter the following command:
Instfix-I | grep ML
How do I determine if a fix is installed on my system?
To determine if IY24043 is installed, enter the following command:
Instfix-ik IY24043
How do I press APAR to install a separate fix?
For example, to install APAR IY73748 from / dev/cd0, enter the following command:
Instfix-k IY73748-d / dev/cd0
How do I verify that the fileset has the necessary prerequisites and is fully installed?
To show which filesets need to be installed or corrected, enter the following command:
Lppchk-v
How do I get the dump of loader section headers and symbol entries in the symbol representation?
Enter the following command:
Dump-Htv
How do I determine the amount of paging space allocated and used?
Enter the following command:
Lsps-a
How to increase paging space?
You can use the chps-s command to dynamically increase the size of the paging space. For example, if you want to increase the size of the hd6 by three logical partitions, you can execute the following command:
Chps-s 3 hd6
How to reduce paging space?
You can use the chps-d command to dynamically reduce the size of paging space. For example, if you want to reduce the size of the hd6 by four logical partitions, you can execute the following command:
Chps-d 4 hd6
How do I know if my system can use synchronous multithreading (Simultaneous Multi-threading,SMT)?
If your system is a POWER5-based system running AIX 5L Version 5.3, it can use SMT.
How do I know if my system has SMT enabled?
If you run the smtctl command with no options, it will tell you whether SMT is enabled.
Does the 32-bit kernel support SMT?
Yes, both 32-bit and 64-bit kernels support SMT.
How do I enable or disable SMT?
You can enable or disable SMT by running the smtctl command. Here is the syntax of the command:
Smtctl [- m off | on [- w boot | now]]
The following options are available:
-m off sets the SMT mode to disabled. -m on sets the SMT mode to enabled. -w boot if you run the bosboot command before the next system reboot, this option causes the SMT mode change to take effect on the next and subsequent reboots. -w now causes the SMT mode change to take effect immediately, but not until the next reboot.
If neither the-w boot nor the-w now option is specified, the schema change takes effect immediately. If you run the bosboot command before the next system reboot, the changes will continue until a subsequent reboot.
How do I get partition-specific information and statistics?
The lparstat command provides partition information and utilization statistics reports. This command can also display Hypervisor information.
Volume groups and logical volumes
How do I know if my volume group is regular, high-capacity, or scalable?
Run the lsvg command on the volume group and view the value of MAX PVs. The value is 32 for regular, 128 for large capacity, and 1024 for scalable volume groups.
How do I create a volume group?
You can use the following command, where s partition_size sets the number of megabytes (MB) in each physical partition, and partition_size is a value from 1 to 1024 in MB (from 1 to 131072 for AIX 5.3). The partition_size variable must be equal to the power of 2 (for example: 1, 2, 4, 8). The default values for standard and bulk volume groups are kept within the limit of 1016 physical partitions per physical volume. The default value for an extensible volume group is the minimum value of 2040 physical partitions per physical volume.
Mkvg-y name_of_volume_group-s partition_sizelist_of_hard_disks
How do I change the characteristics of a volume group?
You can use the following command to change the characteristics of a volume group:
Chvg
How do I create a logical volume?
Enter the following command:
Mklv-y name_of_logical_volumename_of_volume_groupnumber_of_partition
How do I increase the size of a logical volume?
For example, to add three logical partitions to the logical volume represented by the lv05 directory, enter the following command:
Extendlv lv05 3
How do I display all logical volumes that belong to a volume group (for example, rootvg)?
You can display all logical volumes that belong to rootvg by entering the following command:
Lsvg-l rootvg
How do I list information about logical volumes?
You can run the following command to display information about the logical volume lv1:
Lslv lv1
How do I delete a logical volume?
You can delete the logical volume lv7 by running the following command:
Rmlv lv7
The rmlv command deletes only the logical volume, but not other entities, such as the file system or paging space that uses the logical volume.
How do I mirror logical volumes?
Mklvcopy LogicalVolumeName Numberofcopies
Syncvg VolumeGroupName
How do I delete a copy of a logical volume?
You can use the rmlvcopy command to delete a logical partition copy of a logical volume. To reduce the number of replicas per logical partition that belong to logical volume testlv, enter the following command:
Rmlvcopy testlv 2
There are now a maximum of two physical partitions per logical partition in this logical volume.
Questions about volume groups
To display the volume groups in the system, enter the following command:
Lsvg
To display all the characteristics of rootvg, enter the following command:
Lsvg rootvg
To display the disks used by rootvg, enter the following command:
Lsvg-p rootvg
How do I add a disk to a volume group?
Enter the following command:
Extendvg VolumeGroupName hdisk0 hdisk1... Hdiskn
How do I determine the maximum logical track group (LTG) size supported by my hard drive?
You can use the lquerypv command with the-M flag. The output of this command gives the LTG size in KB. For example, in the following example, the LTG size of hdisk0 is 256 KB.
/ usr/sbin/lquerypv-M hdisk0 256
You can also run lspv on your hard drive and view the value of MAX REQUEST.
What is the syncvg command for?
The syncvg command is used to synchronize outdated physical partitions. It accepts logical volume, physical volume, or volume group names as parameters.
For example, to synchronize physical partitions on physical volumes hdisk6 and hdisk7, you can use the following command:
Syncvg-p hdisk4 hdisk5
To synchronize all physical partitions in the volume group testvg, you can use the following command:
Syncvg-v testvg
How do I replace a disk?
Extendvg VolumeGroupNamehdisk_new
Migratepv hdisk_bad hdisk_new
Reducevg-d VolumeGroupNamehdisk_bad
How do I clone rootvg (create a copy of it)?
You can run the alt_disk_copy command to copy the current rootvg to an alternate disk. The following example shows how to clone rootvg to hdisk1.
Alt_disk_copy-d hdisk1
The network
How do I display or set network parameter values?
The no command sets or displays the current or next startup values of the network optimization parameters.
How do I get the IP address of my computer?
Enter one of the following commands:
Ifconfig-a host Fully_Qualified_Host_Name
For example, enter the host cyclop.austin.ibm.com.
How do I determine the network interface on the server?
Either of the following two commands displays the network interface:
Lsdev-Cc if
Ifconfig-a
To get information about a specific network interface (for example, tr0), run the following command:
Ifconfig tr0
How do I activate a network interface?
To activate the network interface tr0, you can run the following command:
Ifconfig tr0 up
How do I disable a network interface?
For example, to disable the network interface tr0, you can run the following command:
Ifconfig tr0 down
Go back to the top of the page
Concluding remarks
There is no denying that lists like this are very helpful in answering some of your own questions quickly. However, it doesn't cover everything you might need. You can make such lists more useful by adding commands that answer other questions not discussed here.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.