Posted on 2012/01/31 10:13
Filed Under OS/YJJ Linux

RHEL 의 Shared Memory, Semaphore, and Message Queue 참고 자료
Red Hat 자료로 RHN ID(subscription) 가 필요함.

Where are the kernel parameter for inter-process communication?
link : https://access.redhat.com/kb/docs/DOC-57643

What are the observed limits for kernel semaphore parameters?
link : https://access.redhat.com/kb/docs/DOC-61670

Are there any upper limits for msgmax, msgmni and msgmnb in the System V IPC message queue?
link : https://access.redhat.com/kb/docs/DOC-15424

Maximum number of shared memory segments limited to 32767 in the kernel. why ?
link : https://access.redhat.com/kb/docs/DOC-59803

Why are the shmmax and shmall defaults very high in Red Hat Enterprise Linux 5 and 6?
link : https://access.redhat.com/kb/docs/DOC-57569

크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기
2012/01/31 10:13 2012/01/31 10:13


Posted on 2012/01/09 17:08
Filed Under OS/YJJ Linux

LVM 작업을 할때 주의해야 될 부분이 있다.

일반적으로 LVM 을 사용할경우 LVM Filter 을 사용하게 되는데 LVM Filter 의 오류로 initrd 를 재 생성하고 LVM 을 사용하는 OS 볼륨이 mount 되지 않아 정상 부팅되지 않을 수 있다.

관련 예제

ex)

##  /etc/lvm/lvm.conf - lvm filter error ( 실제 OS 영역은 /dev/sda2 임 )
filter = [ "a|/dev/sda1|", "a|/dev/mapper/mpath.]|", "a|/dev/mpath/mpath.|", "r|.|"]

## initrd
mkblkdevs
echo Scanning and configuring dmraid supported devices
resume /dev/VolGroup00/LogVol01
echo Creating root device.
mkrootdev -t ext3 -o defaults,ro /dev/VolGroup00/LogVol00
echo Mounting root filesystem.
mount /sysroot

>> LVM 으로 할당된 OS 볼륨 mount 못 함.

##  /etc/lvm/lvm.conf - 정상 적용
filter = [ "a|/dev/sda2|", "a|/dev/mapper/mpath.
]|", "a|/dev/mpath/mpath.|", "r|.|"]

## initrd
mkblkdevs
echo Scanning and configuring dmraid supported devices
echo Scanning logical volumes
lvm vgscan --ignorelockingfailure
echo Activating logical volumes
lvm vgchange -ay --ignorelockingfailure  VolGroup00
resume /dev/VolGroup00/LogVol01
echo Creating root device.
mkrootdev -t ext3 -o defaults,ro /dev/VolGroup00/LogVol00
echo Mounting root filesystem.
mount /sysroot

위에서 보는바와 같이 LVM Filter 오류로 인하여
--------------------------------------------------------
echo Scanning logical volumes
lvm vgscan --ignorelockingfailure
echo Activating logical volumes
lvm vgchange -ay --ignorelockingfailure  VolGroup00
--------------------------------------------------------
부분이 제외되는 문제가 발생 되었다.
앞으로 LVM Filter 을 적용할때 좀더 신중하게 작업을 해야 되겠다.


크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기
2012/01/09 17:08 2012/01/09 17:08


Posted on 2012/01/08 10:37
Filed Under OS/YJJ Linux

여러가지 작업을 하다보면 initrd 파일을 재 생성 해야되는 경우가 생긴다.

modules 에 대한 options 을 추가 한다거나 modules 를 추가 할경우?

그러나 initrd 파일을 재 생성 할뿐 해당 initrd 파일에 정상적으로 적용 되었는지 여부는

좀처럼 알기가 어렵다.

그래서 initrd 해제 방법과 다시 압축하는 방법을 알아 보려고 한다.

일단 initrd 파일인 /boot/initrd-xxx.img 파일을 특정 위치로 복사해 온다.


## Test 디렉토리 생성

#mkdir /root/initrd-test

# initrd 파일 복사
#cp /boot/initrd-xxx.img /root/initrd-test

##initrd 파일의 파일 리스트 확인

#zcat /root/initrd-test/initrd-xxx.img|cpio -tiv

ex)
-rwxr-xr-x   1 root     root        14136 Sep 16 15:19 usr/bin/flock
-rwxr-xr-x   1 root     root       154536 Sep 26 22:45 usr/bin/less
drwxr-xr-x   2 root     root            0 Dec 23 20:04 pre-pivot
-rwxr-xr-x   1 root     root          183 Nov  5 00:32 pre-pivot/31crypt-cleanup.sh
-rwxr-xr-x   1 root     root          238 Jan 15  2010 pre-pivot/02multipathd-stop.sh
-rwxr-xr-x   1 root     root         1949 Nov  5 00:32 pre-pivot/50selinux-loadpolicy.sh
-rwxr-xr-x   1 root     root          183 Nov  5 00:32 pre-pivot/30crypt-cleanup.sh
-rwxr-xr-x   1 root     root           79 Jan 15  2010 pre-pivot/90plymouth-newroot.sh
drwxr-xr-x   2 root     root            0 Dec 23 20:04 sys
89417 blocks

>> 이런식으로 파일 리스트가 나온다.

##initrd 파일의 압축 해제

#zcat /root/initrd-test/initrd-xxx.img|cpio -idv

ex)
usr/share/plymouth/themes/rings/animation-02.png
usr/sbin
usr/sbin/chroot
usr/sbin/eject
usr/bin
usr/bin/mkfifo
usr/bin/bzip2
usr/bin/flock
usr/bin/less
pre-pivot
pre-pivot/31crypt-cleanup.sh
pre-pivot/02multipathd-stop.sh
pre-pivot/50selinux-loadpolicy.sh
pre-pivot/30crypt-cleanup.sh
pre-pivot/90plymouth-newroot.sh
sys
89417 blocks

##압축 해제된 내역 확인

#ls

ex)
bin                 initqueue-settled                        proc
cmdline             initqueue-timeout                        sbin
dev                 initramfs-2.6.32-220.2.1.el6.x86_64.img  sys
dracut-004-256.el6  lib                                      sysroot
emergency           lib64                                    tmp
etc                 mount                                    usr
init                pre-pivot                                var
initqueue           pre-trigger
initqueue-finished  pre-udev

##initrd 의 init 확인 하기

#cat ./init
or
#tail -n15 ./init

ex)
    exec capsh —drop=”$CAPS_INIT_DROP” — -c “exec switch_root \”$NEWROOT\” \”$INIT\” $initargs” || {
        warn “Command:”
        warn capsh —drop=$CAPS_INIT_DROP — -c “’“exec switch_root “$NEWROOT” “$INIT” $initargs”’”
        warn “failed.”
        emergency_shell
    }
else
    exec switch_root “$NEWROOT” “$INIT” $initargs || {
        warn “Something went very badly wrong in the initramfs.  Please “
        warn “file a bug against dracut.”
        emergency_shell
    }
fi
# vim:ts=8:sw=4:sts=4:et


## initrd 파일 다시 압축하기 ( 적용 테스트는 아직 해보지 못 했음 참고! )

#find . -type f | cpio -o -H crc | gzip -n9 > ./initrd-xxx.img
cpio: File ./initrd-xxx.img grew, 5799936 new bytes not copied
100803 blocks


끝...

참고 사이트 :
link 1 : http://tannerjc.net/wiki/index.php?title=Kernel
link 2 : http://blog.adslweb.net/serendipity/article/273/Adding-additionalnew-modules-to-the-initial-ramdisk-on-Linux.
link 3 : http://funky-dennis.livejournal.com/3290.html
link 4 : http://quietsche-entchen.de/cgi-bin/wiki.cgi/ariane/InitialRamDisk

크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)
2012/01/08 10:37 2012/01/08 10:37


Posted on 2012/01/06 15:18
Filed Under OS/YJJ Linux

pam.d 에 들어있는 $ISA 관련 ( Instruction Set Architecture ) 는 어떤 뜻일까?

관련 내용을 첨부해 본다.

좀 더 정확한 내용이 있을경우 재보해 주세욤~!


내용 1 :

Note the $ISA
variable: this is the Instruction Set Architecture, which allows for
32-bit and 64-bit programs to co-exist. Strictly this means that if you
replace any PAM modules you should provide both 32-bit and 64-bit
versions but so far I have not found any 64-bit programs using
authentication This will probably change…

site link 1 : http://www.skills-1st.co.uk/papers/security-with-ldap-jan-2002/security-with-ldap.html


내용 2 :

     The ISA token  is  replaced  by  an  implementation  defined
     directory  name  which defines the path relative to the cal-
     ling program’s instruction set architecture.

site link 2: http://compute.cnr.berkeley.edu/cgi-bin/man-cgi?pam.conf+4

내용 3 :

The $ISA token is a PAM builtin that automatically looks for modules of the correct architecture, such as 32-bit or 64-bit.

site link 3: http://www.enterprisenetworkingplanet.com/netsecur/article.php/3514511/Pulling-The-Covers-Off-Linux-PAM.htm

크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기(0) 이올린에 추천하기(0)
2012/01/06 15:18 2012/01/06 15:18


Posted on 2011/11/30 17:00
Filed Under OS/YJJ Linux

—————————————————————————————————————-

### 간략 설명 ###

* Disk Dump 사전 조건

        : 디스크 덤프를위한 메모리 사이즈+alpha 만큼의 디스크 공간이 필요.
        : native Partition 만지원 (LVM 지 원 안함)
        : 특정 SCSI Device 만지원

> Disk Dump가 위해서는 Dump를 위한 특별한 파티션이 필요합니다
.
예) 시스템 메모리 4GB 이면
    기존 시스템에서 사용하는 파티션이 /dev/sda3 까지라고 하면...
    : /dev/sda5        > 4GB + alpha( 메모리 대비 약 1.2배 ) 형태로 설정합니다. diskdump 발생시에 SCSI Controller에서
직접 메모리를 여기 파티션으로 덤프합니다. 그후 시스템 재부팅시에 /var/crash에 vmcore로 덤프합니다.
    : /dev/sda6       /var/crash 메모리 대비 1.2배 * 생성 횟수 ( vmcore 가 생성되는 공간 )

### 간략 설정 방법

1. diskdumputils Packages Install

up2date diskdumputils
>>온라인 설치 ( RHN 서버 연결 필요 )

or

rpm -ivh diskdumputils-xxx.rpm
>>오프라인 설치 해당 Package 와 연관된 rpm 필요

2. # modprobe diskdump
>> diskdump 모듈 로드

3. diskdump 를 위한 native partition 준비

/etc/sysconfig/diskdump 에 명시할 메모리 대비 1.2배 정도의 partition size 필요

ex)

시스템 메모리가 4GB 면 해당 파티션은 4.8GB 로 할당


4. /etc/sysconfig/diskdump 에 3. 에서 partition 한 Device 지정

ex)

DEVICE=/dev/sda5

5. /etc/sysconfig/diskdump 에 지정한 Device initialformat

# service diskdump initialformat

6. Service 활성화

 # chkconfig diskdump on
 # service diskdump start

7. 확인 ( 아래와 같이 /etc/sysconfig/diskdump 에 명시한 Device 가 보이면 됨 )

# cat /proc/diskdump

ex)
/dev/sda5 514080 1012095

8. 테스트 방법 ( 정상 작동하면 rebooting 와 함께 /var/crash/ 에 디렉토리와 파일 생성 됨 )

Alt-SysRq-C or echo c > /proc/sysrq-trigger



### MagicKey 설정 방법

# vi /etc/sysctl.conf

kernel.sysrq = 1  ==> 0값을 1로 변경

# sysctl -p



### 자세한 설정 방법은 아래의 링크를 참고 하시면 될듯 합니다.  ( RHN ID 필요 )

* diskdump 설정 및 테스트 방법 참고
http://kbase.redhat.com/faq/docs/DOC-7075
http://kbase.redhat.com/faq/docs/DOC-4386

크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기
2011/11/30 17:00 2011/11/30 17:00


Posted on 2011/11/22 06:55
Filed Under OS/YJJ Linux

참고 : http://www.tin.org/bin/man.cgi?section=5&topic=login.defs
   
       PASS_MAX_DAYS (number)
          The maximum number of days a password may be used. If the password
          is older than this, a password change will be forced. If not
          specified, -1 will be assumed (which disables the restriction).

       PASS_MIN_DAYS (number)
          The minimum number of days allowed between password changes. Any
          password changes attempted sooner than this will be rejected. If not
          specified, -1 will be assumed (which disables the restriction).

       PASS_WARN_AGE (number)
          The number of days warning given before a password expires. A zero
          means warning is given only upon the day of expiration, a negative
          value means no warning is given. If not specified, no warning will
          be provided.

       PASS_MAX_DAYS, PASS_MIN_DAYS and PASS_WARN_AGE are only used at the
       time of account creation. Any changes to these settings won’t affect
       existing accounts.


설정 :

# Password aging controls:
#
#       PASS_MAX_DAYS   Maximum number of days a password may be used.
#       PASS_MIN_DAYS   Minimum number of days allowed between password changes.
#       PASS_MIN_LEN    Minimum acceptable password length.
#       PASS_WARN_AGE   Number of days warning given before a password expires.
#
PASS_MAX_DAYS   90  ## 패스워드 변경 없이 사용 가능한 최대 기간
PASS_MIN_DAYS   1   ## 패스워드 변경 없이 사용 가능한 최소 기간
PASS_MIN_LEN    8   ## 최소 길이
PASS_WARN_AGE   7   ## 만료되기 전 알림 주기 ( -7 )

크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기
2011/11/22 06:55 2011/11/22 06:55


Posted on 2011/11/19 07:20
Filed Under OS/YJJ Linux

기존 RHEL5 버전 같은경우 /etc/modprobe.conf 를 이용하여 ethX 가 사용하는 Modules 를 대략적인

확인은 가능 하였다.

그러나 RHEL6 로 올라오면서 /etc/modprobe.conf 가 없어지고...

ethX 가 사용하는 Modules 를 어떻게 확인 시켜줘야 될까???

란...

고민에 빠지게 되었다...

그러던중 검색을 통해 알게된 내용을 공개 한다. ( 역시... 인터넷 찬스가 짱이구만... )

# ethtool -i eth0
driver: e1000
version: 7.3.21-k6-1-NAPI
firmware-version: N/A
bus-info: 0000:02:06.0

위 명령어를 이용하면 Modules 및 Version , firmware-version, bus-info 까지도 출력이 된다.

참... 유용한 명령어~~~

아는것이 힘이다...


크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기
2011/11/19 07:20 2011/11/19 07:20


Posted on 2011/10/19 15:49
Filed Under OS/YJJ Linux

How can I extend the maximum inode count in an ext3 file system under RHEL?
https://access.redhat.com/kb/docs/DOC-34635

위 링크 내용은 사이즈당 아이노드 값 산출에 대한 내용이다.

간단한 공식을 보면

"bytes-per-inode" = "block count" x "block size" / "inode count"

이며 각 항목을 알아보는 방법은

ex)

#dumpe2fs /dev/sda10 | grep "Block count" dumpe2fs 1.39 (29-May-2006) Block count:              2443880 #dumpe2fs /dev/sda10 | grep "Block size" dumpe2fs 1.39 (29-May-2006) Block size:               4096 #dumpe2fs /dev/sda10 | grep "Inode count" dumpe2fs 1.39 (29-May-2006) Inode count:              1224000
이며 위 값으로 계산식을 만들게 되면

2443800 x 4096 / 1224000 = 8177.9450  or 8KB

으로 8177.9450 또는 8KB 당 1 Inode 가 필요 하다 라는 내용 이다.




크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기
2011/10/19 15:49 2011/10/19 15:49


Posted on 2011/10/19 13:50
Filed Under OS/YJJ Linux

RHEL5 기반 User 정보

http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/s1-users-groups-standard-groups.html#tb-users-groups-group-etc

http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Deployment_Guide/s1-users-groups-standard-users.html


크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기
2011/10/19 13:50 2011/10/19 13:50


Posted on 2011/10/19 11:48
Filed Under OS/YJJ Linux

초 간단...

/etc/grub.conf 의 kernel 라인 마지막에 ramdisk_size=$(size) 추가
ex)
ramdisk_size=128000000

그리고

/etc/rc.d/rc.local 에 아래 내용 추가

mke2fs -b 1024 /dev/ram0
mount /dev/ram0 /ramdisk_mount

그리고 재부팅 후 df 혹은 mount 로 확인


크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기
2011/10/19 11:48 2011/10/19 11:48


About

by 삐꾸강아쥐

Counter

· Total
: 137346
· Today
: 47
· Yesterday
: 0
블로그코리아에 블UP하기