aix

AIX中物理卷管理

£可爱£侵袭症+ 提交于 2019-11-27 20:44:22
1、物理卷管理 1.1物理卷区域的分布 按照磁头在硬盘上的读写速率不同可以把硬盘划分成几个不同级别的区域。因此逻辑卷对应的PP在哪一个级别的区域上,对逻辑卷的读写速率影响很大。 硬盘的截面分为5个同心的区域:外边缘(outer-edge)、外中间(outer-middle)、中央(center)、内中间(Inner-Middle)、内边缘(Inner-edge)。 创建逻辑卷时默认的磁盘位置是外中间(outer-middle)区域。 1.2添加一个物理卷 在AIX系统中就是像向系统中添加一块磁盘,然后系统将其配置为物理卷,并且给该物理卷生产成一个唯一的PVID标识。 #lspv #cfgmgr -v #lspv #chdev -l hdiskn -a pv=yes //给硬盘分配一个唯一的PVID 也可以使用SMIT工具: #smit makdsk 删除物理卷设备的定义: 以下两种情况需要删除物理卷: --》需要重新扫描物理卷,以修正物理卷的磁盘设备名 --》物理设备被删除 将物理卷状态改为undefined : #rmdev -l hdisk2 彻底将物理卷从ODM库中删除其信息: #rmdev -l -d hdisk2 硬盘初始化: 有2种方法: (1 )#dd if=/dev/zero of=/dev/hdiskX(X为要格式化的硬盘) 这种方法比较慢。 (2 )diag -

AIX中逻辑卷管理

99封情书 提交于 2019-11-27 20:44:01
1、逻辑卷管理 逻辑卷的大小确定: 逻辑卷大小(MB)=PP的大小(MB)*LV包含的LP的个数 LV占用的物理空间(MB)=PP的大小(MB)*LV包含的LP的个数*LV拷贝的副本数 逻辑卷控制块(LVCB) #getlvcb -TA hd2 显示逻辑卷hd2中的LVCB信息 1.1 创建逻辑卷 AIX通过在卷组上创建逻辑卷来为文件系统、数据集裸设备提供可使用的空间。 逻辑卷可以创建文件系统,或者直接作为裸设备使用。 使用mklv指令创建逻辑卷。 mklv指令参数 -a position 设置内部物理卷分配策略(在物理卷上的逻辑分区的位置)。Position 变量可以是以下之一: m --在每个物理卷的外部中间扇区内分配逻辑分区。这是缺省的位置。 c--在每个物理卷的中间扇区内分配逻辑分区。 e--在每个物理卷的外部边缘段内分配逻辑分区。 ie--在每个物理卷的内部边缘段内分配逻辑分区。 im--在每个物理卷的内部中间段内分配逻辑分区。 -b BadBlocks 设置坏区重定位策略。Relocation 变量可以是以下之一: y--发生坏区重定位。这是缺省值。 n--防止发生坏区重定位。 -c copies 设置分配给每个逻辑分区的物理分区数。Copies 变量的值可以设置为从 1 到 3,缺省值是 1。 -d Schedule 当多于一个的逻辑分区被写入时,设置调度策略

How to return memory from process to the OS

孤街醉人 提交于 2019-11-27 16:48:37
问题 I have an issue with memory management in various operating systems. My program is a server that does some processing that could take a few GB of memory. After that, it releases most of the memory while it waits for a few hours until another request arrives. On AIX and Solaris, I observe the following behavior, When I free memory, the memory is not returned back to the operating system. The amount of virtual memory used by a process always increases - never decreases. The same is true for the

fgetc does not identify EOF [duplicate]

。_饼干妹妹 提交于 2019-11-27 15:41:34
This question already has an answer here: Difference between int and char in getchar/fgetc and putchar/fputc? 2 answers The program below runs fine on various Solaris/Linux flavours, but not on AIX. However, if I replace while(c!=EOF) with while(c!=0xff) on AIX it runs completely fine. Any thoughts? I checked the fgetc man page on AIX, and it should return the EOF constant! #include <stdio.h> #include<unistd.h> #include <string.h> int main() { char c; FILE *fp; fp = fopen("a.txt", "r"); c=fgetc(fp); while(c!=EOF) { c=fgetc(fp); printf("%d",c); } fclose(fp); return 0; } The return value of

Why can “%.10f” % Decimal(u) emit a string with a literal colon?

孤者浪人 提交于 2019-11-27 13:28:21
问题 When formatting a number to be printed, 12 digit numbers are being formatted with a colon immediately after the dot. Why is this happening? This is Python 2.7 on an AIX system. $ uname -a ; /opt/bin/python2.7 AIX myserver 1 6 00F6A5CC4C00 Python 2.7.12 (default, Sep 29 2016, 12:02:17) [C] on aix5 Type "help", "copyright", "credits" or "license" for more information. >>> '{0:.10f}'.format(123456789012) '123456789011.:000000000' >>> from decimal import Decimal >>> u=123456789012 >>> print "%

How to get the command line args passed to a running process on unix/linux systems?

非 Y 不嫁゛ 提交于 2019-11-27 05:50:16
On SunOS there is pargs command that prints the command line arguments passed to the running process. Is there is any similar command on other Unix environments? markus_b There are several options: ps -fp <pid> cat /proc/<pid>/cmdline | sed -e "s/\x00/ /g"; echo There is more info in /proc/<pid> on Linux, just have a look. On other Unixes things might be different. The ps command will work everywhere, the /proc stuff is OS specific. For example on AIX there is no cmdline in /proc . This will do the trick: xargs -0 < /proc/<pid>/cmdline Without the xargs, there will be no spaces between the

ksh88 changing single quotes to double quotes inside heredocs?

不问归期 提交于 2019-11-27 03:26:24
问题 I seem to be running into an issue that's specific to ksh88 that's changing single quotes to double quotes, but only under certain situations involving heredocs and command substitution. Here's an example: #!/bin/ksh # This example works correctly echo "Example 1:" cat <<EOF The 'quick' brown fox "jumped" over the lazy dog. EOF echo # This example is broken echo "Example 2:" var=$(cat <<EOF The 'quick' brown fox "jumped" over the lazy dog. EOF) echo "${var}" echo # This example works

Running UNIX commands as different user, from Java

风格不统一 提交于 2019-11-27 02:15:44
问题 Trying to write a Java program capable of running a UNIX command as a different UNIX user. I have the user's password, and I know the command I want to run, but the command has to be run as that user - so I have to login as that user first. For example: say we have a user, jim, who wants to see what's in bob's home directory, and (for whatever reason) jim has access to execute ls whereas bob does not. We are currently logged in as bob . Here is what we (could) do: bob@host$ su jim && ls ~bob

How to do remote debugging with Eclipse CDT without gdbserver?

北慕城南 提交于 2019-11-27 01:53:53
问题 We're using the Eclipse CDT 5 C++ IDE on Windows to develop a C++ application on a remote AIX host. Eclipse CDT has the ability to perform remote debugging using gdbserver. Unfortunately, gdbserver is not supported on AIX. Is anyone familiar with a way to debug remotely using Eclipse CDT without gdbserver? Perhaps using an SSH shell connection to gdb? 回答1: finally I got gdb run remotly anyhow now. At the Bug-symbol on the taskbar I took Debug Configurations - GDB Hardware Debugging. In Main C

Sed on AIX does not recognize -i flag

陌路散爱 提交于 2019-11-26 22:02:55
问题 Does sed -i work on AIX? If not, how can I edit a file "in place" on AIX? 回答1: The -i option is a GNU (non-standard) extension to the sed command. It was not part of the classic interface to sed . You can't edit in situ directly on AIX. You have to do the equivalent of: sed 's/this/that/' infile > tmp.$$ mv tmp.$$ infile You can only process one file at a time like this, whereas the -i option permits you to achieve the result for each of many files in its argument list. The -i option simply