반응형

출처 : google "가상 메모리 관리 (AIX Virtual Memory Management) 검색 결과의 Doc 문서.


가상 메모리 관리 (AIX Virtual Memory Management)


Virtual Address Space

Virtual address space
란 프로세스가 참조하는 어드레스 범위이며, AIX에서는 16개의 Segment와 각 segment 256MB로 구성된다. 따라서 최대 4GB virtual address space를 가지고 있다. Kernel의 경우 virtual address space를 모두 사용할 수 있지만, Process의 경우에는 제한된 공간만 참조할 수 있다.

Demand Paging

Data
는 참조되는 순간에만 실제 Page(Real Memory 최소 관린 단위)에 복사되며, Mapping은 사용자가 인식할 수 없는 순간에 수행된다.

Data
:
    A page from the page space.
    A page from a file on disk.

AIX
에서는 kernel 또한 페이징을 사용하며, 페이징되지 않는 영역을 'pinned'라고 한다. 하지만, 대부분의 Kernel 영역은 페이징 영역을 사용하고 있다. Pager daemon은 실제 Page(Real Memory 최소 관린 단위) pool로 유지하기 위해, 사용 가능한 page 개수가 high-water mark 이하이면 low-water mark에 도달할 때 까지 가장 오래된 pager를 삭제하게 된다(LRU 알고리즘).

Memory Management Definitions

  • Page - 고정된 Memory의 최소단위(Size : 4096 bytes for AIX)
  • Paging Space - Inactive 상태인 메모리 페이지를 유지하기 위해 memory manager에 의해 사용되는 disk 공간
  • Real Memory - 시스템 내부에 장착된 실제 메모리
  • Virtual Memory - system memory manager에 의해 프로그램 및 프로세스에 주어진 메모리
  • Address Space - 메모리를 접근하는 프로그램에서 활용하는 address set

Virtual Memory

Virtual Memory 개념을 도입함으로써, 연속적인 address space를 가지는 사용자 프로그램이 대용량 메모리를 사용할 수 있으며 시스템의 physical memory 크기보다 큰 공간도 할당할 수 있다.


  • Virtual Memory Mapping
    H/W에 의해 이루어지며, 보통 실 메모리와 paging space에 펼쳐진다.
  • H/W & S/W에 의해 관리되는 최소 단위는 1Page 이며, Page Fault 발생시 Virtual Memory Manager virtual memory address를 사용하는 프로그램 및 프로세스에 page fault 발생한 내용을 보내기 위해 작업을 시작한다.

Hardware Address Translation

32bit virtual address

  • Segment register : 가장 앞 단의 4 bit( segment ID를 포함 )
  • Virtual page index : segment register이후의 16bit( segment page )
  • Byte offset : 마지막 12 bit( page offset )

2^4 = 16 ( 가장 앞 단위 4bit 16개의 segment register중 하나를 선택한다. )
2^28 = 256 MB(
segment 256 MB로 구성: virtual page index + byte offset )
2^12 = 4K(
page 단위는 4K )
16 segment * 256 MB/segment = 4 GB
2^32 = 4GB( 32 bit virtual address space )


    T=0 - Always 0 for memory space
    Ks - Supervisor-state protection key
    Kp - User-state protection key
    N - No-execute protection

64-bit Segment Table




Memory Segments

1.     각각의 Segment page 단위로 분리된다.

o    Segment는 프로세스간에 공유될 수 있다.

o    추가의 virtual page Segment mapping 될 수 있다.

o    이미 사용중인 segment는 프로세스로 지정될 수 도 있고 분리될 수 도 있다.

o    신규 segment는 프로세스에 의해 할당되거나 제거된다.

 

2.     Virtual address segment register로 구성된다.

3.     Segment type

o    Working: 프로그램 실행동안 stack/data 영역으로 사용되는 temporary memory

o    Persistent: Local file system을 위해 file data를 저장하는 memory

o    Client: NFS or CD-ROM과 같이 client file system를 위해 사용되는 memory

o    Log: Journalling 작업동안 file system이 쓰고 읽는데 사용되는 memory

o    Mapping: Application이 동일한 memory segment에 여러 object를 배치하도록 mmap() interface를 지원하기 위해 사용

 

4.     Virtual Page는 실제 memory page 또는 disk drive와 같은 이차 저장매체와 연관되어 있다.

5.     Memory Segment 종류

o    Kernel

o    User Text

o    Shared Library Text

o    Shared Data

o    Process Private

o    Shared Library Data

Segment Register Map in 32-bit User Mode

Segment
-----------------------------------------------------
 0x0         Kernel Segment (only parts visible)
 0x1         User Text
 0x2         User Data, Initial User Thread Stack
 0x3         Available for User (shmat, mmap)
 0x4-0xb     Available for User (shmat, mmap)
 0xc         Available for User (shmat, mmap)
 0xd         System Shared Library Text Segment
 0xe         Available for User (shmat, mmap)
 0xf         Pre-Process Shared Library Data Segment

Large Address Space Model in 32-bit

AIX
에서는 user data 영역으로 256MB 이상을 지원하며, 이 경우 maxdata binder option을 지정하여야 한다. 또한 Large user data 프로그램은 segment 3에서 malloc를 수행하여, 최대 8개의 segments(1020*1024*256*8, 2GB) 사용할 수 있다. 하지만 이 경우에도 여전히 segment 1 user text User Stack segment 2 256MB로 제한되며, segment 11 12 large address space model에 의해 사용할 수 없다.

Large Address Model Compile Option

기본 option으로 Compile을 하는 경우 하나의 Segment가 가질 수 있는 256MB 이상을 참조할 수 없다. 그래서 Large Address가 필요한 프로그램의 경우 아래와 같은 Option을 주어야 가능하다.

cc sample.o -bmaxdata:0x80000000 ->
필요에 따라 segment 개수를 변경할 수 있으며, 최대 8개의 segment를 지정할 수 있음.




-----------------------------------------------------------------------------------------------------------------


출처 : https://www.spec.org/mpi2007/flags/IBM-AIX.html


그렇다면 AIX 관련 컴파일 옵션 및 관련 설명을 보도록 하자.

IBM AIX: Environment Settings and Utilities

IBM AIX 5L V5.3

IBM AIX V6

Last updated: 04-Aug-2008

Sections

Selecting one of the following will take you directly to that section:


Optimization Flags

    • -bdatapsize:64K
    • -bdatapsize:64K\b
    • Specifies a non-default page size of 64K for the program data segment.

    • -bstackpsize:64K
    • -bstackpsize:64K\b
    • Specifies a non-default page size of 64K for the program stack segment.

    • -btextpsize:64K
    • -btextpsize:64K\b
    • Specifies a non-default page size of 64K for the program text segment.

    • -blpdata
    • -blpdata\b
    • Sets the bit in the file's XCOFF header indicating that this executable will request the use of large pages when they are available on the system and when the user has an appropriate privilege

    • -D__IBM_FAST_VECTOR
    • -D__IBM_FAST_VECTOR\b
    • The __IBM_FAST_VECTOR macro defines a different iterator for the std::vector template class. This iterator results in faster code, but is not compatible with code using the default iterator for a std::vector template class. All uses of std::vector for a data type must use the same iterator. Add -D__IBM_FAST_VECTOR to the compile line, or "#define __IBM_FAST_VECTOR 1" to your source code to use the faster iterator for std::vector template class. You must compile all sources with this macro.

    • -D__IBM_FAST_SET_MAP_ITERATOR
    • -D__IBM_FAST_SET_MAP_ITERATOR\b
    • The __IBM_FAST_SET_MAP_ITERATOR macro defines a different iterator for the std::vector template class. This iterator results in faster code, but is not compatible with code using the default iterator for a std::vector template class. All uses of std::vector for a data type must use the same iterator. Add -D__IBM_FAST_SET_MAP_ITERATOR to the compile line, or "#define __IBM_FAST_SET_MAP_ITERATOR 1" to your source code to use the faster iterator for std::vector template class. You must compile all sources with this macro.

    • -D_ILS_MACROS
    • -D_ILS_MACROS\b
    • Causes AIX to define "ischar()" (and friends) as macro's and not subroutines.


System and Other Tuning Information

  • drmgr -r -c cpu
  • Deconfigures one core from the active partition. Use it N times to deconfigure N cores.

  • smtctl -m on|off -w now|boot

  • Controls the enabling and disabling of processor simultaneous multi-threading mode.

  • vmo -r -o lgpg_regions=n -o lgpg_size=16777216

  • Sets the size of large pages to 16M, and set the number to use, with -r, takes effect on the next IPL.

  • bosboot -q

  • Regenerates the IPL boot to set the options specified with smtctl and vmo.

  • ulimit

  • Controls resources allowed to be used by processes. All resource are set to unlimited, of primary importance is the "stack" and "data/heap" settings for SPEC CPU2006 and MPI2007.

  • chsyscfg -m system -r prof -i name=profile,lpar_name=partition,lpar_proc_compat_mode=POWER6_enhanced

  • This command enables the POWERPC architecture optional instructions supported on POWER6.

    Usage: chsyscfg -r lpar | prof | sys | sysprof | frame
                    -m <managed system> | -e <managed frame>
                    -f <configuration file> | -i "<configuration data>"
                    [--help]
    
    Changes partitions, partition profiles, system profiles, or the attributes of a
    managed system or a managed frame.
    
        -r                        - the type of resource(s) to be changed:
                                      lpar    - partition
                                      prof    - partition profile
                                      sys     - managed system
                                      sysprof - system profile
                                      frame   - managed frame
        -m <managed system>       - the managed system's name
        -e <managed frame>        - the managed frame's name
        -f <configuration file>   - the name of the file containing the
                                    configuration data for this command.
                                    The format is:
                                      attr_name1=value,attr_name2=value,...
                                    or
                                      "attr_name1=value1,value2,...",...
        -i "<configuration data>" - the configuration data for this command.
                                    The format is:
                                      "attr_name1=value,attr_name2=value,..."
                                    or
                                      ""attr_name1=value1,value2,...",..."
        --help                    - prints this help
    
    The valid attribute names for this command are:
        -r prof     required: name, lpar_id | lpar_name
                    optional: ...
                              lpar_proc_compat_mode (default | POWER6_enhanced)
    
  • bindprocessor $$ <n>

  • The next program is to be bound to the specified processor.

    Environment variables set before the run:

  • MEMORY_AFFINITY=MCM

  • Cause the OS to alloc memory "closest" to the chip that first requests it.

  • XLFRTEOPTS=intrinthrds=1

  • Causes the Fortran runtime to only use a single thread.

  • MALLOCOPTIONS=POOL

  • Selects the OS malloc option that allocates/frees small objects very quickly.

실제 옵션들을 o 파일 컴파일 시 옵션으로 넣어서 컴파일 하니 256메가에서 프로그램이 메모리 할당에 실패했던 문제가 해소되었다.



반응형
반응형

Using static and shared libraries across platforms

I produced hereafter some information about shared libraries on different systems. However, this information is probably very sparse on details and may even not be up-to-date. Actually, keeping track of changes is nearly impossible.
The definitive information usually comes from the operating system docs. (e.g. HP's "HP-UX Linker and Libraries User's Guide", Sun's "Linker and Libraries Guide", SGI's "MIPSpro Compiling and Performance Tuning Guide", IBM's "AIX Linking and Loading Mechanisms", etc.), where there is often advice on the best options for performance.
GNU libtool offers an abstraction layer to shared library management.


Feedback is welcome.


Adapted from:
Cross platform development, Using Shared Libraries across Platforms, Shah, Amal ; Xiao, Hong, C/C++ Users JournalMay 1998, Volume 16 Number 5

Shared and static libraries information
LinuxSolarisHP-UXCompaq (Digital) Tru64AIXSGIWin32MacOS XVMSOS/390
Version[kernel 2.x, GCC 2.95.x and later][2.8][11][4.x][4.3 and later][Irix 6.5][NT 4][10.x][unmaintained][unmaintained]
1compiler flag (position independent code)-fPIC-KPIC, -Kpic+z/+Zxxxxxxxx-KPIC (default)xxxx-fno-commonxxxx-DLL
2ashared library creation flag-shared-G-b-shared-bM:SRE-sharedlink /DLLcc -bundle, -dynamiclib
libtool -dynamic
/SHARExxxx
2bshared library creation (C++)g++ -fPIC -shared -oCC -G -oaCC -b -ocxx -shared -oxlC -G (or -qmkshrobj)
obsolete:/usr/vacpp/bin/makeC++SharedLib -G -o
(was in /usr/ibmcxx/bin or/usr/lpp/xlC/bin/)
CC -shared -oCL -LD -Fexxx.DLL??
libtool -dynamic
????
2cstatic archiver (C++)arCC -xar -oarararCC -ar -oLIB (avoid link /lib that creates __impl symbols)??
libtool -static
????
3alibrary name(ld option) -soname name-h name(ld option) +h name(ld option) -soname namexxxx(ld option) -soname name/OUT:name-compatibility_version, -current_version/SHARE=xxxx
3bfile extension.so.so.sl.so.so (or .a).so.DLL.dylib.EXE??
4executable link options-Bdynamic
-Lpath -lname
-Bdynamic
-Lpath -lname
-a,shared
-Lpath -name
-no_archive
-Lpath -lname
-brtl
-bdynamic
-Lpath -lname
-Bdynamic,
-Lpath -lname
Controlled by .lib files??xxxxfilename/SHAREABLE
5aruntime path specification-rpath <path>-R <pathlist>-Wl,+b <pathlist> -Wl,+s-rpath <path>-blibpath:<path>
(by default, it is set to the arguments of -L)
-rpath <path>/LIBPATH:-install_name <path>xxxxxxxx
5bDoes not build the path for shared libraries into the executabledefault-norunpathchatr +b disable <file>default-blibpath:/usr/lib:/libdefault????????
6controlling symbolsusing a script file (see "info ld")-z defs/ nodefs/ muldefs+v[no] shlibunsats-expect [error] _unresolvedxxxx-ignore[no] _unresolved/FORCE: MULTIPLE [UNRESOLVED]??xxxxxxxx
LinuxSolarisHP-UXCompaq (Digital) Tru64AIXSGIWin32MacOS XVMSOS/390
7exports file/link option
(see notes)
using a script file (see "info ld")using a script file (see "man ld")+e,symname-exported_symbol.exp-exported_symbol
-exports_file filename
.def/__declspec(dllexport)-exported_symbols_list/SYMBOL_TABLE=(...).x file/
#pragma export()
8hiding symbolsusing a script file: VERSION command (see "Version Script" section in "info ld")using a script file (see "man ld") (see this article)-h symname-hidden_symbol, -hiddenxxxx-hidden_symbol,
-hiddens_file filename
using a .def file-unexported_symbols_listxxxxxxxx
9runtime library pathLD_LIBRARY_PATHLD_LIBRARY_PATH
LD_LIBRARY_PATH_64
SHLIB_PATH
LD_LIBRARY_PATH (64 bits)
LD_LIBRARY_PATHLIBPATHLD_LIBRARY_PATH
LD_LIBRARYN32_PATH
LD_LIBRARY64_PATH
. and then PATHDYLD_LIBRARY_PATH
DYLD_FALLBACK_LIBRARY_PATH
SYS$SHARELIBPATH
10symbol binding-Bsymbolic-Bsymbolic-Bsymbolic /immediate /deferredxxxxxxxx-Bsymbolicxxxx??xxxxxxxx
11runtime debugging(c.f. man ld.so)
LD_BIND_NOW
LD_TRACE_LOADED_OBJECTS
LD_DEBUG=help
ltrace
(c.f. man ld.so.1)
LD_BIND_NOW
LD_DEBUG
ld -D help
(c.f. man dld.sl)
_HP_DLDOPTS
(c.f. man loader)
LD_BIND_NOW
_RLD_ARGS
LDR_CNTRL(c.f. man rld)
LD_BIND_NOW
_RLD_PATH, _RLD_ARGS
xxxxDYLD_BIND_AT_LAUNCH
DYLD_PRINT_LIBRARIES
DYLD_PREBIND_DEBUG
xxxxxxxx
12runtime preloadLD_PRELOADLD_PRELOADLD_PRELOAD (probably HP-UX >= 11)_RLD_LIST "xxx.so:DEFAULT"xxxx_RLD_LIST "xxx.so:DEFAULT"??DYLD_INSERT_LIBRARIES????
13loaderld.sold.sodld.slloaderxxxxrldxxxxdyldxxxxxxxx
14runtime performancexxxxxxxxfastbind tool-quickstart_infoxxxx-quickstart_info/DELAYLOADxxxxxxxxxxxx
LinuxSolarisHP-UXCompaq (Digital) Tru64AIXSGIWin32MacOS XVMSOS/390
15versioningusing a script file: VERSION command (see "info ld")using a script file (see "man ld")
-M mapfile
xxxxxxxxxxxx-set_version/-exact_version/
-ignore_version
/VERSION:major.minor??/GSMATCH=xxxx
16entry pointsxxxxxxxxxxxxxxxxxxxxxxxxDllMainxxxxxxxxxxxx
17dynamic loading /
dynamic symbol access
dlopen / dlsymdlopen / dlsymshl_load / shl_findsym
(64 bits) dlopen / dlsym
dlopen / dlsymloadquery/loadbind
(AIX 4.2) dlopen / dlsym
dlopen / dlsymLoadLibrary / GetProcAddress"man 3 dyld"lib$find_image_symboldllload / dllqueryfn/ dllqueryvar
18utilitiesldd, ldconfig, objdump, ltrace, readelfldd, elfdump, pvs, dumpstabs (compilers V.6), crle (Solaris>=8)chatr
odump
ldd, elfdump (HP-UX >= 11)
odump -Dldump -H
ldd (in AIX tools)
elfdump -Dl
pldd
ldd (IRIX >= 6.5)
DUMPBIN, depends, EXEHDR, link -dumpotoolANALYSE/IMAGExxxx
19documentationman: ld, ld.so, ldd
info: ld, gcc, binutil
HOWTO: ELF-HOWTO, GCC-HOWTO
man: ld, ld.so.1, ldd, pvsman: ld, dld.sl, chatrman: ld, loader, odumpman: ld, dumpman: dso, ld, rld, elfdump, lddMSDNman: ld, libtool, dyld, otool????
LinuxSolarisHP-UXCompaq (Digital) Tru64AIXSGIWin32MacOS XVMSOS/390

Notes:


Acknowledgments

Juan Altmayer Pizzorno, Wolfgang Haefelinger, Per Losenborg, Anil E. Sahukar, Andrew Stalewski, Pirasenna Velandai Thiyagarajan, Nathan Stratton Treadway, Stephan Weber, Bo Xie

반응형
반응형
  1. prstat -s rss

    '-s' sorts prstat output by rss column (see man page for other columns). Also try '-a' option for a per user accumulation.

  2. ps -eo pid,pmem,vsz,rss,comm | sort -rnk2 | head

    Top 10 RAM consumers. '-o pmem' displays percentage of resident memory i.e. RAM used by process.

  3. ls -lh /proc/{pid}/as

    Easy way to show total address space (vsz) of a process. Useful in combination with pgrep to accumulate by user, pattern, ... e.g.:

    for pid in `pgrep -U webserver`; do ls -lh /proc/$pid/as; done


반응형
반응형

UNIX 및 Linux 운영 체제에서 ulimit 값 설정

UNIX 또는 Linux 운영 체제에서 적절한 ulimit 값을 설정하면 IBM® Cognos® Business Intelligence가 수행하는 방식에 영향을 미칠 수 있습니다.

예를 들어, Linux 운영 체제에서는 스택 ulimit 설정이 원인이 되어 발생하는 문제점에는 대형 보고서를 처리할 때 BIBusTKServerMain의 비정상적으로 높은 메모리 사용량 또는 BIBusTKServerMain 오류가 포함됩니다.

  • Linux 운영 체제에서 32비트 보고서 서비스를 사용 중인 경우 보고서는 실패할 수 있습니다.
  • Linux 운영 체제에서 64비트 보고서 서비스를 사용 중인 경우 실행 중인 보고서 또는 유휴 BIBusTKServerMain 프로세스가 사용 가능한 모든 RAM을 사용할 수 있습니다.

반면 UNIX 운영 체제에서는 스택 ulimit 설정이 너무 낮은 경우에 문제가 발생할 수 있습니다.

스택 ulimit 설정을 올바르게 설정하면 이러한 문제점을 방지할 수 있습니다.

새 설치에 권장되는 ulimit 설정은 다음과 같습니다.

IBM AIX®
  • CPU 시간(초): ulimit -t unlimited
  • 파일 크기(블록): ulimit -f unlimited
  • 최대 메모리 크기(KB): ulimit -m unlimited
  • 최대 사용자 프로세스: ulimit -u unlimited
  • 열린 파일 수: ulimit -n 8192(최소값)
  • 스택 크기(KB): ulimit -s 8192(최소값)
  • 가상 메모리(KB): ulimit -v unlimited
Sun Solaris
  • CPU 시간(초): ulimit -t unlimited
  • 파일 크기(블록): ulimit -f unlimited
  • 최대 사용자 프로세스: ulimit -u unlimited
  • 메모리(KB): ulimit -m unlimited
  • 열린 파일 수: ulimit -n 8192(최소값)
  • 스택 크기(KB): ulimit -s 8192(최소값)
  • 가상 메모리(KB): ulimit -v unlimited
HP-UX
  • CPU 시간(초): ulimit -t unlimited
  • 파일 크기(블록): ulimit -f unlimited
  • 메모리(KB): ulimit -m unlimited
  • 파일 수(디스크립터): ulimit -n 8192(최소값)
  • 스택 크기(KB): ulimit -s 8192(최소값)
Linux(x 및 z)
  • CPU 시간(초): ulimit -t unlimited
  • 파일 크기(블록): ulimit -f unlimited
  • 최대 메모리 크기(KB): ulimit -m unlimited
  • 최대 사용자 프로세스: ulimit -u unlimited
  • 열린 파일 수: ulimit -n 8192(최소값)
  • 스택 크기(KB): ulimit -s unlimited
  • 가상 메모리(KB): ulimit -v unlimited
참고: 애플리케이션의 수명 주기 동안 이러한 설정을 환경에 맞게 조정해야 할 수 있습니다.


반응형
반응형

아래의 명령어를 쳐서 설정으로 들어가자

AIX는 smitty라는걸로 OS설정을 꽤나 많이 하는 것 같다.


#smitty  tcpip


----------------------------------------------------------

Move cursor to desired item and press Enter.


  Minimum Configuration & Startup

  Further Configuration

  Use DHCP for TCPIP Configuration & Startup

  IPV6 Configuration

  Quality of Service Configuration & Startup

  Configure IP Security (IPv4)

  Configure IP Security (IPv6)

----------------------------------------------------------

위와 같은 설정들을 할 수 있다.


ifup이나 ifdown 같은것도 안 먹고 게이트 웨이 설정이나 dns 설정 어디서 하는건지 헤매다가 찾음...

CUI로 되어 있으며 방향키와 esc+명령 등으로 손쉽게 네트워크 관련 설정을 할 수 있다.


실제로 설정하다가 esc와 6키를 누르면 실제 해당 명령은 cmd 창에서 어떻게 명령어로 처리할 수 있는지도 나온다.

친절도 하셔라.... 설정하다가 안되면 에러 내용도 다양하게 확인할 수 있으니 참고!



라우팅 테이블 정보는 아래와 같이 확인할 수 있다.


netstat -rn

[root@/etc]#netstat -rn

Routing tables

Destination        Gateway           Flags   Refs     Use  If   Exp  Groups


Route Tree for Protocol Family 2 (Internet):

default              xx.xx.xx.xx        UG        0             991 en0      -      -

xx.xx.xx.xx         xx.xx.xx.xx         UHSb      0               0 en0      -      -   =>

.

.

.


Route Tree for Protocol Family 24 (Internet v6):

::1%1               ::1%1              UH         1       71496 lo0      -      -



반응형
반응형

출처 : http://moonsungju.tistory.com/32



-----------------------------------------------------------------------------------------------

SUN Studio 12 버전 별로 정리해보았습니다. 다들 알고 있으시겠죠?? 모르시는 분들을 위해~ㅋㅋㅋㅋ

Solaris 10u10 기준이며, OS release 따라 약간 다를 수도 있습니다. 이 부분은 다들 알고 계시기 때문에 PASS~

해당 설치 방법은 제가 전에 On-site 때 실행했던 방법이며, 혹시 다른 방법으로 설치하시는 분이 있다면 그 방법으로 하시면 됩니다참고만 하시면 될 듯 싶네요.

 

1.     현재까지 나온 Sun Studio 12

l  SunStudio 12

l  SunStudio 12.1

l  SunStudio 12.2

l  SunStudio 12.3

 

2.     압축 풀기

bzcat download_directory/[File Name]-[OS]-[PLATFORM]-[FORMAT]-ML.tar.bz2 | /bin/tar -xf -

ex) bzcat SolarisStudio12.3-solaris-sparc-pkg.tar.bz2| /bin/tar -xf -

 

3.     설치/삭제 옵션

SunStudio Version

NON-GUI 실행 옵션

SunStudio 12

설치) nodisplay

삭제) java -cp . uninstall_Sun_Studio_12 nodisplay

     uninstaller

SunStudio 12.1

설치) --non-interactive-accept-license --create-symlinks --tempdir /tmp

삭제) uninstall.sh --non-interactive (삭제 시 설치 디렉토리도 삭제하면 좋겠죠?)

SunStudio 12.2

설치) --non-interactive --create-symlinks --tempdir /tmp

삭제) uninstall.sh --non-interactive (삭제 시 설치 디렉토리도 삭제하면 좋겠죠?)

SunStudio 12.3

 

4.     C로 컴파일 예제

#include <stdio.h>

int main(){

printf("Moonsungju, world!\n");

return 0;

}

컴파일링 하는 방법은 다들 아시죠? cc를 통해 진행하시면 됩니다굳이 여기까지 테스트는 안 하셔도 되나 그래도 심심풀이로 하시고 싶으신 분~~~ 각자의 소스코드로 진행하시면 됩니다. 위에 코드는 가장 많이 테스트 하시는 hello.c 코드 입니다. 그냥 moonsungju로 바꾼 것 외에 다른 수정사항은 없습니다.(gcc도 동일)







1.패치실행

2.스튜디오실행




output-device=virtual-console

input-device=virtual-console


eeprom "output-device=screen"

eeprom "input-device=keyboard"



/usr/dt/bin/dtlogin start


/usr/dt/bin/dtconfig -e

반응형
반응형

1. 출처 : http://www.joinc.co.kr/modules/moniwiki/wiki.php/Site/System_management/ZFS

-------------------------------------------------------


1 ZFS

유닉스의 파일 시스템을 대체하기 위해서 SUN에서 개발한 파일 시스템으로 Solaris 10에 소개된다. 기능을 보면 알겠지만 단순한 파일 시스템으로 보기는 힘들다. 모든 잡다한 관리기능까지를 포함한 볼륨메니저로 봐야 한다. 예컨데 파일 시스템과 Logical Volume manager, snapshots, copy-on-write clones, continuous integrity checking, automatic repaire, 등 무슨 기능일지도 모를 것 같은 다양한 기능들을 가지고 있는 확장된 파일 시스템이다. ZFS를 써본 사람들은 지상 최대의 파일 시스템이라는 찬사를 보낸다. 정말 그러하다.

나는 Cloud 환경에서 신뢰성과 확장성, 성능과 관리성까지 두루 갖춘 만능 File System을 찾아보자라는 목적으로 살펴보게 됐다.

ZFS의 기능을 정리했다.
  1. Data Integrigy 다른 파일 시스템과 구분되는 가장 큰 특징이다. 디스크 상의 유저 데이터를 보호준다. bit rot, cosmic radiation, current spikes, bugs in disk firmware, ghost writes 등으로 부터 데이터를 보호해 준다. 물론 Ext, XFS, JFS, ReiserFS, NTFS 등도 유저 데이터를 보호하기 위한 기능을 가지고 있기는 하지만, ZFS는 이들 보다 탁월한 성능을 보여준다.
  2. Storage Pool LVM과 마찬가지로 하나 이상의 장치를 통합해서 관리할 수 있다. 이 논리적인 Storage Pool을 zpools라고 하며, block device 처럼 작동한다. 블럭 장치들은 다양한 레벨로 조합할 수 있습니다. non-redundantly (RAID 0과 비슷), mirror ( RAID 1과 비슷 ), RAID-Z (RAID-5와 비슷), RAID-Z2 (RAID-6와 비슷) 등등이다.
  3. Capacity : ZFS는 128-bit 파일 시스템으로 용량에는 제약기 없다고 보면 되겠다. 페타바이트급 파일시스템이라고 하는 이유가 있다.
    • 2^48 개의 독립된 디렉토리를 다룰 수 있다.
    • 파일의 최대크기는 16 exabytes ( 16 X 10^18)
    • zpool의 최대 크기는 256 zettabytes (2^78)
    • 시스템에서 zpools의 갯수는 2^64
    • zpools에서 파일 시스템의 갯수 2^64

2 Linux와 ZFS

Linux에 ZFS를 이식하기 위한 노력이 진행 중이다. 이식은 두 가지 방향으로 이루어지고 있다.
  1. native ZFS
    리눅스 커널이 ZFS를 지원하도록 하는 프로젝트
  2. zfs-fuse
    fuse를 이용해서 ZFS를 지원하도록 하는 프로젝트
아직까지는 Linux에서 마음놓고 사용할 만한 수준이 아닌 것 간다. zfs-fuse 같은 경우에는 성능에 문제가 상당히 있어서 zfs란 이런 거구나를 체험하기 위한 수준 정도에서나 사용할 수 있을 것 같다. . Native ZFS는 눈여겨 볼만하다. 꾸준히 개발하고 있는 것 같기는 한데, 언제쯤 1.0이 되서 믿고 쓸만한 날이 올지 모르겠다. 1년전에 0.6.x 버전이었는데, 지금(2013년 9월)도 0.6.x 버전이다.

2.1 zfs-fuse

  1. apt-get install zfs-fuse
  2. zpoll create mypool /dev/sdb /dev/sdc /dev/sdd /dev/sde
  3. zpool status mypool
  4. zfs create mypool/testzfs
  5. FS 성능 측정 : Bonnie++

3 Solaris와 ZFS

3.1 opensolaris 설치

솔라리스는 ZFS를 기본 파일 시스템으로 하고 있다. 이렇게 된거 x86기반의 opensolaris를 설치해서 ZFS를 경험해 보기로 했다. VirtualBox를 이용 해서 가상으로 올렸다.
  • hypervisor : VirtualBox VirtualBox 와 opensolaris 모두 Oracle에서 개발하고 있으니, 궁합이 잘 맞을 거란 생각이 든다.
  • OpenSolaris
설치는 윈도우보다 간단하다. 설치 과정은 생략.

솔라리스를 마지막으로 써본게 아마 9년전 쯤인것 같다. 2002년이던가 ? 당시만 해도 상당히 투박한(하지만 왠지 멋져 보이긴 했음) CDE 화면이었는데, 지금은 gnome이 뜬다. 예쁘다.

보낸 사람 Linux

3.2 zpool

논리적 볼륨 관리자의 핵심은 장치를 아우르는 하나의 pool을 만드는 거다. 이 pool을 zpool이라고 부른다.

테스트를 위해서 SATA 2G x 2 장치를 준비했다. 리눅스에서 하던 것처럼 fdisk -l로 장치를 확인하려고 했더니, 내가 원하는 그 fdisk가 아니다. format으로 장치를 확인할 수 있다.
# format
AVAILABLE DISK SELECTIONS:
       0. c7d0 <DEFAULT cyl 2085 alt 2 hd 255 sec 63>
          /pci@0,0/pci-ide@1,1/ide@0/cmdk@0,0
       1. c9t0d0 <ATA-VBOX HARDDISK-1.0-2.00GB>
          /pci@0,0/pci8086,2829@d/disk@0,0
       2. c9t1d0 <ATA-VBOX HARDDISK-1.0-2.00GB>
          /pci@0,0/pci8086,2829@d/disk@1,0

c9t0d0, c9t1d0을 tank라는 이름의 zpool로 묶기로 했다.
# zpool create tank c9t0d0 c9t1d0

제대로 만들어 졌는지 확인.
# zpool list
NAME    SIZE   USED  AVAIL    CAP  HEALTH  ALTROOT
rpool  15.9G  3.80G  12.1G    23%  ONLINE  -
tank   3.97G   232K  3.97G     0%  ONLINE  -

zfs로 파일 시스템에 대한 상세 정보를 확인.
# zfs list
NAME                         USED  AVAIL  REFER  MOUNTPOINT
rpool                       4.16G  11.5G  77.5K  /rpool
rpool/ROOT                  3.16G  11.5G    19K  legacy
rpool/ROOT/opensolaris      3.16G  11.5G  3.02G  /
rpool/dump                   511M  11.5G   511M  -
rpool/export                5.04M  11.5G    21K  /export
rpool/export/home           5.02M  11.5G    21K  /export/home
rpool/export/home/yundream     5M  11.5G     5M  /export/home/yundream
rpool/swap                   512M  11.8G   137M  -
tank                        74.5K  3.91G    19K  /tank

zfs는 디렉토리 형태로 pool을 관리할 수 있다. tank 밑에 music, movie, source 3개의 파일 시스템을 만들어 봤다.
# zfs create tank/music
# zfs create tank/movie
# zfs create tank/source
# zfs list
NAME                         USED  AVAIL  REFER  MOUNTPOINT
...
tank                         154K  3.91G    23K  /tank
tank/movie                    19K  3.91G    19K  /tank/movie
tank/music                    19K  3.91G    19K  /tank/music
tank/source                   19K  3.91G    19K  /tank/source
3개의 파일 시스템이 추가로 만들어지긴 했지만 volume을 모두 공유해서 사용하고 있다. 내 목적은 각 파일 시스템 별로 쿼터를 정하는 거다. /tank/movie를 1G를 사용하도록 쿼터를 할당했다.
# zfs set quota=1g tank/movie
# zfs list | grep tank
tank                         154K  3.91G    23K  /tank
tank/movie                    19K  1024M    19K  /tank/movie
tank/music                    19K  3.91G    19K  /tank/music
tank/source                   19K  3.91G    19K  /tank/source

# df -h /tank/movie
Filesystem            Size  Used Avail Use% Mounted on
tank/movie            1.0G   19K  1.0G   1% /tank/movie

3.3 mirror, RAIDZ, RAIDZ2

ZFS는 mirror와 RAIDZ, RAIDZ2 3가지 RAID 레벨을 지원한다. 10G SATA Disk 6개를 추가해서 각 모드별로 테스트를 진행했다.

RAIDZ와 RAIDZ2는 각각 RAID 5와 RAID 6와 매우 유사하다. 즉
  • RAIDZ : RAID 5 처럼 블럭 기반 striped 와 하나의 분산 parity 블럭을 가진다.
  • RAIDZ2 : RAID 6 처럼 블럭 기반 striped 와 두개의 분산 parity 블럭을 가진다.


4 Native ZFS on Linux

  • Native ZFS on Linux : 앞으로 오픈 솔라리스 대신 리눅스를 이용해서 zfs를 테스트할 계획이다.

5 Nexenta

Nexenta는 opensolaris 기반의 NAS/SAN어플라이언스 제품이다. 기업환경에서 ZFS를 이용해서 안정적으로 스토리지 시스템을 구성할 수 있도록 HA(High Availability cluster), Namespace Cluster, CLI및 GUI(웹 기반의) 인터페이스를 제공한다.

6 History

  1. 작성일 : 2011년 9월 6일
  2. 수정이력
    1. 작성 : 2011/9/6
    2. 2013-08-31 : 문장을 다듬었음. 링크 추가


------------------------------------------------------------------------------------------------------------


zfs 파일 시스템의 관련 블로그들의 대부분은 

spl-0.6.0-rc6.tar.gz, zfs-0.6.0-rc6.tar.gz를 가이드했지만 내가 이 블로그를 쓰는 시점은 0.6.3을 받았다. 버전별로 리눅스 커널 지원이 다르다.

관련 패키지 정보는 ZFS 관련 공식 사이트인 아래 링크에 들어가서 받도록 하자.


http://zfsonlinux.org/


 


------------------------------------------------------------------------------------------------------------

2. 출처 : http://blog.lovetonight.net/m/post/164


ZFS on Centos6

마성민 | 2013/04/19 11:37 | Linux 앱으로 보기

약 30TB 정도의 데이터 백업을 위해 백업 서버를 한대 구성하고 XFS로 포맷하고 데이터를 저장..

파일 개수가 약 1억개 정도 되다보니.. 데이터를 백업 하는 과정에서 계속 XFS 파티션이 깨지는 현상이 발생..

거기다 설상가상으로 서버이전이다 뭐다 해서 용량이 갑자기 10TB가 추가되어버린..

ㅠ_ㅠ 아.. 서버 재구성해야 하나.. 했는데..

 

이번기회에 ZFS로 가보자 하고 결정..

아래 내용은 Onenote에 정리해둔 내용을 옮겨적음..

 

[기본환경]

  • OS : CentOS release 6.3 (Final) 64Bit
  • Kernel : 2.6.32-279.19.1.el6.x86_64

 

[설치]

  • Linux 시스템에서 ZFS 사용하기 위해서는 Native ZFS 이용하는 방법과 ZFS-FUSE 이용하는 방법이 있으며, 각각의 방법에 따라 ZFS 버전이 달라질 있습니다.

 

  1. 먼저 ZFS 구성을 위해 기본적으로 필요한 항목들을 설치 합니다.

Shell > yum install kernel-devel zlib-devel libuuid-devel libblkid-devel libselinux-devel parted lsscsi

Native ZFS Kernel 모듈 방식으로 동작 하기 때문에 위와 같이 kernel-devel 반드시 설치해 주어야 합니다.

 

  1. ZFS패키지인 SPL ZFS 패키지를 다운로드 합니다.

다운로드는 http://www.zfsonlinux.org 에서 받을 있습니다.

 

  1. 다운로드한 패키지의 압축을 해제 설치를 진행 합니다.

# spl install

Shell > tar xvfz spl-0.6.0-rc13.tar.gz

Shell > cd spl-0.6.0-rc13

Shell > ./configure && make rpm

Shell > rpm -Uvh *.x86_64.rpm

Shell > cd ..

 

# zfs install

Shell > tar xvfz zfs-0.6.0-rc13.tar.gz

Shell > cd zfs-0.6.0-rc13

Shell > ./configure && make rpm

Shell> rpm -Uvh *.x86_64.rpm

Shell > cd ..

 

  1. 설치된 zfs 커널 모듈을 인식시켜 줍니다.

Shell > modprobe zfs

Shell > lsmod | grep -i zfs

 

  1. ZFS Spool 생성 합니다.

여기서 ZFS Spool 만들때 단일 디스크를 사용할 것인지 아니면 여러 개의 단일 디스크를 소프트웨어 레이드 방식으로 구성 것인지를 결정 있습니다. ZFS Spool 생성할 때에는 zpool 명령어를 사용하며, 해당 명령어에는 다양한 기능들이 포함되어 있으므로 자세한 내용은 공식 Document 참조하시기 바랍니다.

아래에서는 단일 디스크와 2 디스크를 미러링 하는 방법, 그리고 4 이상의 디스크를 Raid5 구성하는 방법을 설명 하겠습니다.

# EX : zpool [명령어] [옵션] spool

# CREATE EX : zpool create [-f|-n] [-o property=value] [-m mountpoint] pool vdev

 

# /dev/sdb 디스크를 backup 스풀로 생성하며, compress option 기본설정 하도록 한다.

Shell > zpool create -o compress=on backup disk /dev/sdb

 

# /dev/sdb 디스크와 /dev/sdc 디스크를 Backup 스풀로 생성하며, Raid1 구성 Compress option 설정 하도록 한다.

Shell > zpool create -o compress=on backup mirror /dev/sdb /dev/sdc

 

# /dev/sd[b-f] 디스크( 5) 4개를 Raid5 (Parity Disk 1)구성하고 나머지 1개의 디스크는 Hot Spare 구성을 Backup 스풀을 구성하고 /backup_spool 이라는 디렉토리에 마운트 되도록 한다.

Shell > zpool create -m /backup_spool backup raidz1 /dev/sdb /dev/sdc /dev/sdd /dev/sde spare /dev/sdf

 

  1. ZFS Spool ZFS 파일 시스템을 생성 합니다.

ZFS Spool 공간을 이용하여 파일시스템을 생성할 있으며, 각각의 파일시스템은 Spool 적용된 property Option 상속하게 됩니다.

# EX : zfs [명령어] [옵션]

# CREATE EX : zfs create [-p] [-o] filesystem

 

# backup 스풀의 공간을 이용하여 maildata 라는 파일시스템을 생성하고 자동 압축되지 않도록 구성 한다.

Shell > zfs create -o compress=off backup/maildata

 

# Backup 스풀의 공간을 이용하여 mysql 라는 파일시스템을 생성하고 자동압축되지 않으며, /data/mysql 마운트 되도록 한다.

Shell > zfs create -o compress=off -o mountpoint=/data/mysql backup/mysql

 

# Backup 스풀의 공간을 이용하여 user 라는 파일시스템을 생성하고 자동압축되며, 500GB 쿼터를 설정하고 /home/user 디렉토리에 마운트 되도록 한다.

Shell > zfs create -o compress=on -o mountpoint=/home/user -o quota=500GB backup/user

 

ZFS로 구성한 후 Compression 옵션 덕분에 실제 8TB 정도 되는 데이터는 5.6TB 정도로 압축되어 저장되었다는 후문이...

 

ZFS 사랑해요~!


------------------------------------------------------------------------------------------------------------






------------------------------------------------------------------------------------------------------------

출처 : https://github.com/zfsonlinux/pkg-zfs/wiki/HOWTO-install-Ubuntu-to-a-Native-ZFS-Root-Filesystem


HOWTO install Ubuntu to a Native ZFS Root Filesystem


Note: These instructions were originally created for older version of Ubuntu (12.04). Some required resource (e.g. grub ppa) is not available on newer versions, thus can lead to errors. If you use Ubuntu 14.04 or newer, see this page instead, which also allows things like raidz root, boot from snapshot, zfs-only setup (no need for separate /boot/grub), and lz4 compression.


These instructions are for Ubuntu. The procedure for Debian, Mint, or other distributions in the DEB family is similar but not identical.

System Requirements

  • 64-bit Ubuntu Live CD. (Not the alternate installer, and not the 32-bit installer!)
  • AMD64 or EM64T compatible computer. (ie: x86-64)
  • 8GB disk storage available.
  • 2GB memory minimum.

Computers that have less than 2GB of memory run ZFS slowly. 4GB of memory is recommended for normal performance in basic workloads. 16GB of memory is the recommended minimum for deduplication. Enabling deduplication is a permanent change that cannot be easily reverted.

Recommended Version

  • Ubuntu 12.04 Precise Pangolin
  • spl-0.6.3
  • zfs-0.6.3

Step 1: Prepare The Install Environment

1.1 Start the Ubuntu LiveCD and open a terminal at the desktop.

1.2 Input these commands at the terminal prompt:

$ sudo -i
# apt-add-repository --yes ppa:zfs-native/stable
# apt-get update
# apt-get install debootstrap spl-dkms zfs-dkms ubuntu-zfs

1.3 Check that the ZFS filesystem is installed and available:

# modprobe zfs
# dmesg | grep ZFS:
ZFS: Loaded module v0.6.3-2~trusty, ZFS pool version 5000, ZFS filesystem version 5

Step 2: Disk Partitioning

This tutorial intentionally recommends MBR partitioning. GPT can be used instead, but beware of UEFI firmware bugs.

2.1 Run your favorite disk partitioner, like parted or cfdisk, on the primary storage device. /dev/disk/by-id/scsi-SATA_disk1 is the example device used in this document.

2.2 Create a small MBR primary partition of at least 8 megabytes. 256mb may be more realistic, unless space is tight. /dev/disk/by-id/scsi-SATA_disk1-part1 is the example boot partition used in this document.

2.3 On this first small partition, set type=BE and enable the bootable flag.

2.4 Create a large partition of at least 4 gigabytes. /dev/disk/by-id/scsi-SATA_disk1-part2 is the example system partition used in this document.

2.5 On this second large partition, set type=BF and disable the bootable flag.

The partition table should look like this:

# fdisk -l /dev/disk/by-id/scsi-SATA_disk1

Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device    Boot      Start         End      Blocks   Id  System
/dev/sda1    *          1           1        8001   be  Solaris boot
/dev/sda2               2        1305    10474380   bf  Solaris

Remember: Substitute scsi-SATA_disk1-part1 and scsi-SATA_disk1-part2 appropriately below.

Hints:

  • Are you doing this in a virtual machine? Is something in /dev/disk/by-id missing? Go read the troubleshooting section.
  • Recent GRUB releases assume that the /boot/grub/grubenv file is writable by the stage2 module. Until GRUB gets a ZFS write enhancement, the GRUB modules should be installed to a separate filesystem in a separate partition that is grub-writable.
  • If /boot/grub is in the ZFS filesystem, then GRUB will fail to boot with this message: error: sparse file not allowed. If you absolutely want only one filesystem, then remove the call to recordfail() in each grub.cfg menu stanza, and edit the /etc/grub.d/10_linux file to make the change permanent.
  • Alternatively, if /boot/grub is in the ZFS filesystem you can comment each line with the text save_env in the file /etc/grub.d/00_header and run update-grub.

Step 3: Disk Formatting

3.1 Format the small boot partition created by Step 2.2 as a filesystem that has stage1 GRUB support like this:

# mke2fs -m 0 -L /boot/grub -j /dev/disk/by-id/scsi-SATA_disk1-part1

3.2 Create the root pool on the larger partition:

# zpool create -o ashift=9 rpool /dev/disk/by-id/scsi-SATA_disk1-part2

Always use the long /dev/disk/by-id/* aliases with ZFS. Using the /dev/sd* device nodes directly can cause sporadic import failures, especially on systems that have more than one storage pool.

Warning: The grub2-1.99 package currently published in the PPA for Precise does not reliably handle a 4k block size, which is ashift=12.

Hints:

  • # ls -la /dev/disk/by-id will list the aliases.
  • The root pool can be a mirror. For example, zpool create -o ashift=9 rpool mirror /dev/disk/by-id/scsi-SATA_disk1-part2 /dev/disk/by-id/scsi-SATA_disk2-part2. Remember that the version and ashift matter for any pool that GRUB must read, and that these things are difficult to change after pool creation.
  • If you are using a mirror with a separate boot partition as described above, don't forget to edit the grub.cfg file on the second HD partition so that the "root=" partition refers to that partition on the second HD also; otherwise, if you lose the first disk, you won't be able to boot from the second because the kernel will keep trying to mount the root partition from the first disk.
  • The pool name is arbitrary. On systems that can automatically install to ZFS, the root pool is named "rpool" by default. Note that system recovery is easier if you choose a unique name instead of "rpool". Anything except "rpool" or "tank", like the hostname, would be a good choice.
  • If you want to create a mirror but only have one disk available now you can create the mirror using a sparse file as the second member then immediately off-line it so the mirror is in degraded mode. Later you can add another drive to the spool and ZFS will automatically sync them. The sparse file won't take up more than a few KB so it can be bigger than your running system. Just make sure to off-line the sparse file before writing to the pool.

3.2.1 Create a sparse file at least as big as the larger partition on your HDD:

# truncate -s 11g /tmp/sparsefile

3.2.2 Instead of the command in section 3.2 use this to create the mirror:

# zpool create -o ashift=9 rpool mirror /dev/disk/by-id/scsi-SATA_disk1-part2 /tmp/sparsefile

3.2.3 Offline the sparse file. You can delete it after this if you want.

# zpool offline rpool /tmp/sparsefile

3.2.4 Verify that the pool was created and is now degraded.

# zpool list
NAME       SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
rpool     10.5G   188K  10.5G     0%  1.00x  DEGRADED  -

3.3 Create a "ROOT" filesystem in the root pool:

# zfs create rpool/ROOT

3.4 Create a descendant filesystem for the Ubuntu system:

# zfs create rpool/ROOT/ubuntu-1

On Solaris systems, the root filesystem is cloned and the suffix is incremented for major system changes through pkg image-update or beadm. Similar functionality for APT is possible but currently unimplemented.

3.5 Dismount all ZFS filesystems.

# zfs umount -a

3.6 Set the mountpoint property on the root filesystem:

# zfs set mountpoint=/ rpool/ROOT/ubuntu-1

3.7 Set the bootfs property on the root pool.

# zpool set bootfs=rpool/ROOT/ubuntu-1 rpool

The boot loader uses these two properties to find and start the operating system. These property names are not arbitrary.

Hint: Putting rpool=MyPool or bootfs=MyPool/ROOT/system-1 on the kernel command line overrides the ZFS properties.

3.9 Export the pool:

# zpool export rpool

Don't skip this step. The system is put into an inconsistent state if this command fails or if you reboot at this point.

Step 4: System Installation

Remember: Substitute "rpool" for the name chosen in Step 3.2.

4.1 Import the pool:

# zpool import -d /dev/disk/by-id -R /mnt rpool

If this fails with "cannot import 'rpool': no such pool available", you can try import the pool without the device name eg:

    # zpool import -R /mnt rpool

4.2 Mount the small boot filesystem for GRUB that was created in step 3.1:

# mkdir -p /mnt/boot/grub
# mount /dev/disk/by-id/scsi-SATA_disk1-part1 /mnt/boot/grub

4.4 Install the minimal system:

# debootstrap trusty /mnt

The debootstrap command leaves the new system in an unconfigured state. In Step 5, we will only do the minimum amount of configuration necessary to make the new system runnable.

Step 5: System Configuration

5.1 Copy these files from the LiveCD environment to the new system:

# cp /etc/hostname /mnt/etc/
# cp /etc/hosts /mnt/etc/

5.2 The /mnt/etc/fstab file should be empty except for a comment. Add this line to the /mnt/etc/fstab file:

/dev/disk/by-id/scsi-SATA_disk1-part1  /boot/grub  auto  defaults  0  1

The regular Ubuntu desktop installer may add dev, proc, sys, or tmp lines to the /etc/fstab file, but such entries are redundant on a system that has a /lib/init/fstab file. Add them now if you want them.

5.3 Edit the /mnt/etc/network/interfaces file so that it contains something like this:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

Customize this file if the new system is not a DHCP client on the LAN.

5.4 Make virtual filesystems in the LiveCD environment visible to the new system and chroot into it:

# mount --bind /dev  /mnt/dev
# mount --bind /proc /mnt/proc
# mount --bind /sys  /mnt/sys
# chroot /mnt /bin/bash --login

5.5 Install PPA support in the chroot environment like this:

# locale-gen en_US.UTF-8
# apt-get update
# apt-get install ubuntu-minimal software-properties-common

Even if you prefer a non-English system language, always ensure that en_US.UTF-8 is available. The ubuntu-minimal package is required to use ZoL as packaged in the PPA.

5.6 Install ZFS in the chroot environment for the new system:

# apt-add-repository --yes ppa:zfs-native/stable
# apt-add-repository --yes ppa:zfs-native/grub
# apt-get update
# apt-get install --no-install-recommends linux-image-generic linux-headers-generic
# apt-get install ubuntu-zfs
# apt-get install grub2-common grub-pc
# apt-get install zfs-initramfs
# apt-get dist-upgrade

Warning: This is the second time that you must wait for the SPL and ZFS modules to compile. Do not try to skip this step by copying anything from the host environment into the chroot environment.

Note: This should install a kernel package and its headers, a patched mountall and dkms packages. Double-check that you are getting these packages from the PPA if you are deviating from these instructions in any way.

Choose /dev/disk/by-id/scsi-SATA_disk1 if prompted to install the MBR loader.

Ignore warnings that are caused by the chroot environment like:

  • Can not write log, openpty() failed (/dev/pts not mounted?)
  • df: Warning: cannot read table of mounted file systems
  • mtab is not present at /etc/mtab.

5.7 Set a root password on the new system:

# passwd root

Hint: If you want the ubuntu-desktop package, then install it after the first reboot. If you install it now, then it will start several process that must be manually stopped before dismount.

Step 6: GRUB Installation

Remember: All of Step 6 depends on Step 5.4 and must happen inside the chroot environment.

6.1 Verify that the ZFS root filesystem is recognized by GRUB:

# grub-probe /
zfs

And that the ZFS modules for GRUB are installed:

# ls /boot/grub/zfs*
/boot/grub/zfs.mod  /boot/grub/zfsinfo.mod

Note that after Ubuntu 13, these are now in /boot/grub/i386/pc/zfs*

# ls /boot/grub/i386-pc/zfs*
/boot/grub/i386-pc/zfs.mod  /boot/grub/i386-pc/zfsinfo.mod

Otherwise, check the troubleshooting notes for GRUB below.

6.2 Refresh the initrd files:

# update-initramfs -c -k all
update-initramfs: Generating /boot/initrd.img-3.2.0-40-generic

6.3 Update the boot configuration file:

# update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-40-generic
Found initrd image: /boot/initrd.img-3.2.0-40-generic
done

Verify that boot=zfs appears in the boot configuration file:

# grep boot=zfs /boot/grub/grub.cfg
linux /ROOT/ubuntu-1/@/boot/vmlinuz-3.2.0-40-generic root=/dev/sda2 ro boot=zfs $bootfs quiet splash $vt_handoff
linux /ROOT/ubuntu-1/@/boot/vmlinuz-3.2.0-40-generic root=/dev/sda2 ro single nomodeset boot=zfs $bootfs

6.4 Install the boot loader to the MBR like this:

# grub-install $(readlink -f /dev/disk/by-id/scsi-SATA_disk1)
Installation finished. No error reported.

Do not reboot the computer until you get exactly that result message. Note that you are installing the loader to the whole disk, not a partition.

Note: The readlink is required because recent GRUB releases do not dereference symlinks.

Step 7: Cleanup and First Reboot

7.1 Exit from the chroot environment back to the LiveCD environment:

# exit

7.2 Run these commands in the LiveCD environment to dismount all filesystems:

# umount /mnt/boot/grub
# umount /mnt/dev
# umount /mnt/proc
# umount /mnt/sys
# zfs umount -a
# zpool export rpool

The zpool export command must succeed without being forced or the new system will fail to start.

7.3 We're done!

# reboot

Caveats and Known Problems

This is an experimental system configuration.

This document was first published in 2010 to demonstrate that the lzfs implementation made ZoL 0.5 feature complete. Upstream integration efforts began in 2012, and it will be at least a few more years before this kind of configuration is even minimally supported.

Gentoo, and its derivatives, are the only Linux distributions that are currently mainlining support for a ZoL root filesystem.

zpool.cache inconsistencies cause random pool import failures.

The /etc/zfs/zpool.cache file embedded in the initrd for each kernel image must be the same as the /etc/zfs/zpool.cache file in the regular system. Run update-initramfs -c -k all after any /sbin/zpool command changes the /etc/zfs/zpool.cache file.

Pools do not show up in /etc/zfs/zpool.cache when imported with the -R flag.

This will be a recurring problem until issue zfsonlinux/zfs#330 is resolved.

Every upgrade can break the system.

Ubuntu systems remove old dkms modules before installing new dkms modules. If the system crashes or restarts during a ZoL module upgrade, which is a failure window of several minutes, then the system becomes unbootable and must be rescued.

This will be a recurring problem until issue zfsonlinux/pkg-zfs#12 is resolved.

When doing an upgrade remotely an extra precaution would be to use screen, this way if you get disconnected your installation will not get interrupted.

Troubleshooting

(i) MPT2SAS

Most problem reports for this tutorial involve mpt2sas hardware that does slow asynchronous drive initialization, like some IBM M1015 or OEM-branded cards that have been flashed to the reference LSI firmware.

The basic problem is that disks on these controllers are not visible to the Linux kernel until after the regular system is started, and ZoL does not hotplug pool members. See https://github.com/zfsonlinux/zfs/issues/330.

Most LSI cards are perfectly compatible with ZoL, but there is no known fix if your card has this glitch. Please use different equipment until the mpt2sas incompatibility is diagnosed and fixed, or donate an affected part if you want solution sooner.

(ii) Areca

Systems that require the arcsas blob driver should add it to the /etc/initramfs-tools/modules file and run update-initramfs -c -k all.

Upgrade or downgrade the Areca driver if something like RIP: 0010:[<ffffffff8101b316>] [<ffffffff8101b316>] native_read_tsc+0x6/0x20 appears anywhere in kernel log. ZoL is unstable on systems that emit this error message.

(iii) GRUB Installation

Verify that the PPA for the ZFS enhanced GRUB is installed:

# apt-add-repository ppa:zfs-native/grub
# apt-get update

Reinstall the zfs-grub package, which is an alias for a patched grub-common package:

# apt-get install --reinstall zfs-grub

Afterwards, this should happen:

# apt-cache search zfs-grub
grub-common - GRand Unified Bootloader (common files)

# apt-cache show zfs-grub
N: Can't select versions from package 'zfs-grub' as it is purely virtual
N: No packages found

# apt-cache policy grub-common zfs-grub
grub-common:
 Installed: 1.99-21ubuntu3.9+zfs1~precise1
 Candidate: 1.99-21ubuntu3.9+zfs1~precise1
 Version table:
*** 1.99-21ubuntu3.9+zfs1~precise1 0
      1001 http://ppa.launchpad.net/zfs-native/grub/ubuntu/precise/main amd64 Packages
       100 /var/lib/dpkg/status
    1.99-21ubuntu3 0
      1001 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
zfs-grub:
 Installed: (none)
 Candidate: (none)
 Version table:

For safety, grub modules are never updated by the packaging system after initial installation. Manually refresh them by doing this:

# cp /usr/lib/grub/i386-pc/*.mod /boot/grub/

If the problem persists, then open a bug report and attach the entire output of those apt-get commands.

Packages in the GRUB PPA are compiled against the stable PPA. Systems that run the daily PPA may experience failures if the ZoL library interface changes.

Note that GRUB does not currently dereference symbolic links in a ZFS filesystem, so you cannot use the /vmlinux or /initrd.img symlinks as GRUB command arguments.

(iv) GRUB does not support ZFS Compression

If the /boot hierarchy is in ZFS, then that pool should not be compressed. The grub packages for Ubuntu are usually incapable of loading a kernel image or initrd from a compressed dataset.

(v) VMware

  • Set disk.EnableUUID = "TRUE" in the vmx file or vsphere configuration. Doing this ensures that /dev/disk aliases are created in the guest.

(vi) QEMU/KVM/XEN

  • In the /etc/default/grub file, enable the GRUB_TERMINAL=console line and remove the splash option from the GRUB_CMDLINE_LINUX_DEFAULT line. Plymouth can cause boot errors in these virtual environments that are difficult to diagnose.

  • Set a unique serial number on each virtual disk. (eg: -drive if=none,id=disk1,file=disk1.qcow2,serial=1234567890)

(vii) Kernel Parameters

The zfs-initramfs package requires that boot=zfs always be on the kernel command line. If the boot=zfs parameter is not set, then the init process skips the ZFS routine entirely. This behavior is for safety; it makes the casual installation of the zfs-initramfs package unlikely to break a working system.

ZFS properties can be overridden on the the kernel command line with rpool and bootfs arguments. For example, at the GRUB prompt:

linux /ROOT/ubuntu-1/@/boot/vmlinuz-3.0.0-15-generic boot=zfs rpool=AltPool bootfs=AltPool/ROOT/foobar-3

(viii) System Recovery

If the system randomly fails to import the root filesystem pool, then do this at the initramfs recovery prompt:

# zpool export rpool
: now export all other pools too
# zpool import -d /dev/disk/by-id -f -N rpool
: now import all other pools too
# mount -t zfs -o zfsutil rpool/ROOT/ubuntu-1 /root
: do not mount any other filesystem
# cp /etc/zfs/zpool.cache /root/etc/zfs/zpool.cache
# exit

This refreshes the /etc/zfs/zpool.cache file. The zpool command emits spurious error messages regarding missing or corrupt vdevs if the zpool.cache file is stale or otherwise incorrect.



------------------------------------------------------------------------------------------------------------

출처 : http://www.oracle.com/technetwork/articles/servers-storage-admin/howto-build-openstack-zfs-2248817.html



About OpenStack in Oracle Solaris 11

Want to comment on this article? Post the link on Facebook's OTN Garage page.  Have a similar article to share? Bring it up on Facebook or Twitter and let's discuss.

OpenStack, a popular open source project that provides cloud management infrastructure, is integrated into Oracle Solaris 11.2. OpenStack storage features include Cinder for block storage access (see Figure 1) and Swift for object storage that also provides redundancy and replication.

ZFS, a file system that integrates volume management features, provides a simple interface for managing large amounts data. It has a robust set of data services and also supports a variety of storage protocols.

Cinder provisions a ZFS block device or a volume for your project (or tenant) instances. An Oracle Solaris Kernel Zone or a non-global zone is created and deployed for each project instance. After you create a deployable image of the zone and launch an instance of the zone image, Cinder allocates a ZFS volume to contain the instance's image as the guest's root device.

Oracle Solaris 11.2 provides additional Cinder drivers to provision the following devices:

  • iSCSI targets from a pool on a Cinder volume node
  • FC LUNs as block devices
  • iSCSI targets from an Oracle ZFS Storage Appliance

However, using these features is beyond the scope of this article.

A good way to get started with OpenStack is to run a small, all-in-one configuration where all OpenStack services are enabled, along with the Cinder volume service on the same system node, and to use ZFS as the back-end storage.

ZFS provides robust redundancy and doesn't need any special software or hardware arrays to provide data redundancy. ZFS is simple to configure and manage.

This article describes cloud storage practices for deploying a cloud infrastructure environment on Oracle Solaris and using Cinder to provide block storage devices as ZFS volumes on the same system.

This article does not describe how to set up OpenStack. For information on setting up OpenStack, see "Getting Started with OpenStack on Oracle Solaris 11.2."

Figure 1. Diagram of OpenStack Cinder Block Storage Service

Figure 1. Diagram of OpenStack Cinder Block Storage Service

OpenStack Block Storage Prerequisites and Deployment Process

The prerequisites require that Oracle Solaris 11.2 OpenStack already be running on a single SPARC or x86 system as the compute node that runs the primary OpenStack services and has multiple local or SAN-based devices.

The components of the configuration include the following:

  • Compute node (Nova): The system node where zones for tenant or project instances are managed, but zones are not installed as part of the process described in this article. The Cinder volume service runs on this node as well.
  • Volume service (Cinder): The location where the Cinder volume service allocates ZFS volumes for tenant or project instances, which is customized in this article.
  • User authorization (Keystone): Both admin and tenant user names and passwords must already have been created and can be provided to Keystone, the authentication service.

The following general steps describe how to customize a single system that runs OpenStack services and runs the Cinder volume service to deploy ZFS volumes. Data redundancy is configured and ZFS compression and encryption can also be added in this configuration.

The remaining sections of this article describe these steps in detail.

Create the ZFS Components

Oracle Solaris runs on a ZFS storage pool that is typically called rpool. This usually small pool is not an ideal environment for hosting a cloud infrastructure, because it contains the Oracle Solaris components that run the system.

A general recommendation is to keep your root pool (rpool) small and host your application, user, and cloud data in a separate pool. Mirrored pool configurations perform best for most workloads.

The following steps describe how to configure the components shown in Figure 2: a mirrored ZFS storage pool (tank), the primary file system (cinder), and the ZFS volumes that will contain the tenant (or project) cloud instances.

Figure 2. A Mirrored ZFS Storage Pool with File System Components

Figure 2. A Mirrored ZFS Storage Pool with File System Components

  1. Create a separate, mirrored ZFS storage pool that provides data redundancy and also configures two spares.

    The following example creates a mirrored storage pool called tank that contains two pairs of mirrored disks and two spare disks:

    # zpool create tank mirror c0t5000C500335F4C7Fd0 \
    c0t5000C500335F7DABd0 mirror c0t5000C500335FC6F3d0 \
    c0t5000C500336084C3d0 spare c0t5000C500335E2F03d0 \
    c0t50015179594B6F52d0
    

    Size the mirrored storage pool according to your estimated cloud data needs. You can always add another mirrored pair of devices to your mirrored ZFS storage pool if you need more space.

    For more information about ZFS administration syntax, see Managing ZFS File Systems in Oracle Solaris 11.2.

    Review your pool's current status:

    # zpool status tank
    

    Identify the pool's raw available space:

    # zpool list tank
    
  2. Create a ZFS file system:

    Note: If you want to use encryption to secure your cloud data, encryption must be enabled (as described below) when the ZFS file system is created. For more information about ZFS encryption and other encryption key methods besides being prompted for a passphrase, see see Managing ZFS File Systems in Oracle Solaris 11.2.

    # zfs create tank/cinder
    

    Review the actual available space that is available to your file system:

    # zfs list -r tank/cinder
    

    Frequently review the space available for your ZFS volumes by monitoring the USED space and the AVAIL space.

    If you want to conserve disk space, enable compression on the tank/cinder file system. ZFS volumes that are allocated for project instances are automatically compressed.

    # zfs set compression=on tank/cinder
    

    If you want to secure your cloud data, consider enabling encryption.

    # zfs create -o encryption=on tank/cinder
    Enter passphrase for 'tank/cinder': xxxxxxxx
    Enter again: xxxxxxxx
    

Customize the Cinder Storage Location

  1. Modify the zfs_volume_base parameter in /etc/cinder/cinder.conf to identify an alternate pool/file-system.

    For example, change this line:

    # zfs_volume_base = rpool/cinder 
    

    To this:

    # zfs_volume_base = tank/cinder
    
  2. Refresh the Cinder volume services:

    # svcadm restart svc:/application/openstack/cinder/cinder-volume:setup
    # svcadm restart svc:/application/openstack/cinder/cinder-volume:default
    

Test Your Cinder Configuration

  1. Set the authentication environment variables:

    Cinder expects the following Keystone authorization parameters to be presented as options on the command line, or you can set them as environment variables.

    # export OS_AUTH_URL=http://localhost:5000/v2.0 
    # export OS_USERNAME=admin-user-name 
    # export OS_PASSWORD=password 
    # export OS_TENANT_NAME=tenant-user-name 
    
  2. Create a 1-GB test volume:

    # cinder create --display_name test 1
    +---------------------+--------------------------------------+
    |       Property      |                Value                 |
    +---------------------+--------------------------------------+
    |     attachments     |                  []                  |
    |  availability_zone  |                 nova                 |
    |       bootable      |                false                 |
    |      created_at     |      2014-07-17T20:19:33.423744      |
    | display_description |                 None                 |
    |     display_name    |                 test                 |
    |          id         | 258d80e9-2ef3-eab8-fbea-96a4d176360d |
    |       metadata      |                  {}                  |
    |         size        |                  1                   |
    |     snapshot_id     |                 None                 |
    |     source_volid    |                 None                 |
    |        status       |               creating               |
    |     volume_type     |                 None                 |
    +---------------------+--------------------------------------+
    
  3. After you create a Cinder volume, confirm that it is created and the space is consumed:

    # zfs list -r tank/cinder
    NAME                             USED  AVAIL REFER MOUNTPOINT
    tank/cinder                      1.03G 547G  31K  /tank/cinder
    tank/cinder/volume-258d80e9-...  1.03G  546G 16K  -
    

    You can also confirm that the volume is visible from OpenStack's Horizon interface. When you launch a project instance through Horizon, a new Cinder volume is created automatically, so you can remove the test volume from the Horizon->volume menu by using the Delete Volume feature.

(Optional) Perform Additional Cinder Configuration Customization

The following are additional customizations you can do:

  • Monitor your ZFS pool for disk failures by setting up smtp-notify alert notifications.
  • Use ZFS snapshots to replicate ZFS volumes.
  • Create a separate archive pool with ZFS compression enabled to reduce the storage footprint when archiving tenant data.

For more information, see Managing ZFS File Systems in Oracle Solaris 11.2.

Summary

A redundant ZFS storage pool that is serving Cinder volumes for OpenStack can be hosted on any local or SAN storage to provide cloud data protection. You can also apply robust data services, such as encryption for data security or compression for data reduction, to your cloud storage.

See Also

The ZFS blog.



------------------------------------------------------------------------------------------------------------




------------------------------------------------------------------------------------------------------------

출처 : https://wiki.archlinux.org/index.php/Installing_Arch_Linux_on_ZFS


Installing ZFS on a CentOS 6 Linux server

As most of my long term readers know I am a huge Solaris fan. How can’t you love an Operating System that comes with ZFS, DTrace, Zones, FMA and Network Virtualization amongst other things? I use Linux during my day job, and I’ve been hoping for quite some time that Oracle would port one or more of these technologies to Linux. Well the first salvo has been fired, though it wasn’t from Oracle. It comes by way of the ZFS on Linux project, which is an in-kernel implementation of ZFS (this project is different from the FUSE ZFS port).

I had some free time this weekend to play around with ZFS on Linux, and my initial impressions are quite positive. The port on Linux is based on the latest version of ZFS that is part of OpenSolaris (version 28), so things like snapshots, de-duplication, improved performance and ZFS send and recv are available out of the box. There are a few missing items, but from what I can tell from the documentation there is plenty more coming.

The ZFS file system for Linux comes as source code, which you build into loadable kernel modules (this is how they get around the license incompatibilities). The implementation also contains the userland utilities (zfs, zpool, etc.) most Solaris admins are used to, and they act just like their Solaris counterparts! Nice!

My testing occurred on a CentOS 6 machine, specifically 6.2:

$ cat /etc/redhat-release
CentOS release 6.2 (Final)

The build process is quite easy. Prior to compiling source code you will need to install a few dependencies:

$ yum install kernel-devel zlib-devel libuuid-devel libblkid-devel libselinux-devel parted lsscsi

Once these are installed you can retrieve and build spl and zfs packages:

$ wget http://github.com/downloads/zfsonlinux/spl/spl-0.6.0-rc6.tar.gz

$ tar xfvz spl-0.6.0-rc6.tar.gz && cd spl*6

$ ./configure && make rpm

$ rpm -Uvh *.x86_64.rpm

Preparing...                ########################################### [100%]
   1:spl-modules-devel      ########################################### [ 33%]
   2:spl-modules            ########################################### [ 67%]
   3:spl                    ########################################### [100%]

$ wget http://github.com/downloads/zfsonlinux/zfs/zfs-0.6.0-rc6.tar.gz

$ tar xfvz zfs-0.6.0-rc6.tar.gz && cd zfs*6

$ ./configure && make rpm

$ rpm -Uvh *.x86_64.rpm

Preparing...                ########################################### [100%]
   1:zfs-test               ########################################### [ 17%]
   2:zfs-modules-devel      ########################################### [ 33%]
   3:zfs-modules            ########################################### [ 50%]
   4:zfs-dracut             ########################################### [ 67%]
   5:zfs-devel              ########################################### [ 83%]
   6:zfs                    ########################################### [100%]

If everything went as planned you now have the ZFS kernel modules and userland utilities installed! To begin using ZFS you will first need to load the kernel modules with modprobe:

$ modprobe zfs

To verify the module loaded you can tail /var/log/messages:

Feb 12 17:54:27 centos6 kernel: SPL: Loaded module v0.6.0, using hostid 0x00000000
Feb 12 17:54:27 centos6 kernel: zunicode: module license 'CDDL' taints kernel.
Feb 12 17:54:27 centos6 kernel: Disabling lock debugging due to kernel taint
Feb 12 17:54:27 centos6 kernel: ZFS: Loaded module v0.6.0, ZFS pool version 28, ZFS filesystem version 5

And run lsmod to verify they are there:

$ lsmod | grep -i zfs

zfs                  1038053  0 
zcommon                42478  1 zfs
znvpair                47487  2 zfs,zcommon
zavl                    6925  1 zfs
zunicode              323120  1 zfs
spl                   210887  5 zfs,zcommon,znvpair,zavl,zunicode

To create our first pool we can use the zpool utilities create option:

$ zpool create mysqlpool mirror sdb sdc

The example above created a mirrored pool out of the sdb and sdc block devices. We can see this layout in the output of `zpool status`:

$ zpool status -v

  pool: mysqlpool
 state: ONLINE
 scan: none requested
config:

	NAME        STATE     READ WRITE CKSUM
	mysqlpool   ONLINE       0     0     0
	  mirror-0  ONLINE       0     0     0
	    sdb     ONLINE       0     0     0
	    sdc     ONLINE       0     0     0

errors: No known data errors

Awesome! Since we are at pool version 28 lets disable atime updates and enable compression and deduplication:

$ zfs set compression=on mysqlpool

$ zfs set dedup=on mysqlpool

$ zfs set atime=off mysqlpool

For a somewhat real world test, I stopped one of my MySQL slaves, mounted the pool on /var/lib/mysql, synchronized the previous data over to the ZFS file system and then started MySQL. No errors to report, and MySQL is working just fine. Next up, I trash one side of the mirror and verified that resilvering works:

$ dd if=/dev/zero of=/dev/sdb

$ zpool scrub mysqlpool

I let this run for a few minutes then ran `zpool status` to verify the scrub fixed everything:

$ zpool status -v

  pool: mysqlpool
 state: ONLINE
status: One or more devices has experienced an unrecoverable error.  An
	attempt was made to correct the error.  Applications are unaffected.
action: Determine if the device needs to be replaced, and clear the errors
	using 'zpool clear' or replace the device with 'zpool replace'.
   see: http://www.sun.com/msg/ZFS-8000-9P
 scan: scrub repaired 966K in 0h0m with 0 errors on Sun Feb 12 18:54:51 2012
config:

	NAME        STATE     READ WRITE CKSUM
	mysqlpool   ONLINE       0     0     0
	  mirror-0  ONLINE       0     0     0
	    sdb     ONLINE       0     0   175
	    sdc     ONLINE       0     0     0

I beat on the pool pretty good and didn’t encounter any hangs or kernel oopses. The file systems port is still in its infancy, so I won’t be trusting it with production data quite yet. Hopefully it will mature in the coming months, and if we’re lucky maybe one of the major distributions will begin including it! That would be killer!!



------------------------------------------------------------------------------------------------------------


------------------------------------------------------------------------------------------------------------

출처 : http://prefetch.net/blog/index.php/2012/02/13/installing-zfs-on-a-centos-6-linux-server/



Installing Arch Linux on ZFS


This article details the steps required to install Arch Linux onto a root ZFS filesystem. This article supplements the Beginners' guide.

Installation

See ZFS#Installation for installing the ZFS packages. If installing Arch Linux onto ZFS from the archiso, it would be easier to use the demz-repo-archiso repository.

Embedding archzfs into archiso

See ZFS article.

Partition the destination drive

Review Beginners' guide#Prepare_the_storage_drive for information on determining the partition table type to use for ZFS. ZFS supports GPT and MBR partition tables.

ZFS manages its own partitions, so only a basic partition table scheme is required. The partition that will contain the ZFS filesystem should be of the type bf00, or "Solaris Root".

Partition scheme

Here is an example, using MBR, of a basic partition scheme that could be employed for your ZFS root setup:

Part     Size   Type
----     ----   -------------------------
   1     512M   Ext boot partition (8300)
   2     XXXG   Solaris Root (bf00)

Here is an example using GPT. The BIOS boot partition contains the bootloader.

Part     Size   Type
----     ----   -------------------------
   1       2M   BIOS boot partition (ef02)
   1     512M   Ext boot partition (8300)
   2     XXXG   Solaris Root (bf00)

An additional partition may be required depending on your hardware and chosen bootloader. Consult Beginners' guide#Install_and_configure_a_bootloader for more info.

Tip: Bootloaders with support for ZFS are described in #Install and configure the bootloader.
Warning: Several GRUB bugs (bug #42861, zfsonlinux/grub/issues/5) prevent or complicate installing it on ZFS partitions, use of a separate boot partition is recommended

Format the destination disk

Format the boot partition as well as any other system partitions. Do not do anything to the Solaris partition nor to the BIOS boot partition. ZFS will manage the first, and your bootloader the second.

Setup the ZFS filesystem

First, make sure the ZFS modules are loaded,

# modprobe zfs

Create the root zpool

# zpool create zroot /dev/disk/by-id/id-to-partition
Warning: Always use id names when working with ZFS, otherwise import errors will occur.

Create necessary filesystems

If so desired, sub-filesystem mount points such as /home and /root can be created with the following commands:

# zfs create zroot/home -o mountpoint=/home
# zfs create zroot/root -o mountpoint=/root

Note that if you want to use other datasets for system directories (/var or /etc included) your system will not boot unless they are listed in /etc/fstab! We will address that at the appropriate time in this tutorial.

Swap partition

See ZFS#Swap volume.

Configure the root filesystem

First, set the mount point of the root filesystem:

# zfs set mountpoint=/ zroot

and optionally, any sub-filesystems:

# zfs set mountpoint=/home zroot/home
# zfs set mountpoint=/root zroot/root

and if you have seperate datasets for system directories (ie /var or /usr)

# zfs set mountpoint=legacy zroot/usr
# zfs set mountpoint=legacy zroot/var

and put them in /etc/fstab

/etc/fstab
# <file system>        <dir>         <type>    <options>             <dump> <pass>
zroot/usr              /usr          zfs       defaults,noatime      0      0
zroot/var              /var          zfs       defaults,noatime      0      0

Set the bootfs property on the descendant root filesystem so the boot loader knows where to find the operating system.

# zpool set bootfs=zroot zroot

Export the pool,

# zpool export zroot
Warning: Do not skip this, otherwise you will be required to use -f when importing your pools. This unloads the imported pool.
Note: This might fail if you added a swap partition above. Need to turn it off with the swapoff command.

Finally, re-import the pool,

# zpool import -d /dev/disk/by-id -R /mnt zroot
Note: -d is not the actual device id, but the /dev/by-id directory containing the symbolic links.

If there is an error in this step, you can export the pool to redo the command. The ZFS filesystem is now ready to use.

Be sure to bring the zpool.cache file into your new system. This is required later for the ZFS daemon to start.

# cp /etc/zfs/zpool.cache /mnt/etc/zfs/zpool.cache

if you don't have /etc/zfs/zpool.cache, create it:

# zpool set cachefile=/etc/zfs/zpool.cache zroot

Install and configure Arch Linux

Follow the following steps using the Beginners' guide. It will be noted where special consideration must be taken for ZFSonLinux.

  • First mount any boot or system partitions using the mount command.
  • Install the base system.
  • The procedure described in Beginners' guide#Generate an fstab is usually overkill for ZFS. ZFS usually auto mounts its own partitions, so we do not need ZFS partitions in fstab file, unless the user made datasets of system directories. To generate the fstab for filesystems, use:
# genfstab -U -p /mnt | grep boot >> /mnt/etc/fstab
  • Edit the /etc/fstab:
Note:
  • If you chose to create datasets for system directories, keep them in this fstab! Comment out the lines for the '/, /root, and /home mountpoints, rather than deleting them. You may need those UUIDs later if something goes wrong.
  • Anyone who just stuck with the guide's directions can delete everything except for the swap file and the boot/EFI partition. It seems convention to replace the swap's uuid with /dev/zvol/zroot/swap.
  • When creating the initial ramdisk, first edit /etc/mkinitcpio.conf and add zfs before filesystems. Also, move keyboard hook before zfs so you can type in console if something goes wrong. You may also remove fsck (if you are not using Ext3 or Ext4). Your HOOKS line should look something like this:
HOOKS="base udev autodetect modconf block keyboard zfs filesystems"
  • Regenerate the initramfs with the command:
# mkinitcpio -p linux

Install and configure the bootloader

For BIOS motherboards

Follow GRUB#BIOS_systems_2 to install GRUB onto your disk. grub-mkconfig does not properly detect the ZFS filesystem, so it is necessary to edit grub.cfg manually:

/boot/grub/grub.cfg
set timeout=2
set default=0

# (0) Arch Linux
menuentry "Arch Linux" {
    set root=(hd0,msdos1)
    linux /vmlinuz-linux zfs=zroot rw
    initrd /initramfs-linux.img
}

if you did not create a separate /boot participation, kernel and initrd paths have to be in the following format:

 /dataset/@/actual/path  

Example:

   linux /@/boot/vmlinuz-linux zfs=zroot rw
   initrd /@/boot/initramfs-linux.img

For UEFI motherboards

Use EFISTUB and rEFInd for the UEFI boot loader. See Beginners' guide#For UEFI motherboards. The kernel parameters in refind_linux.conf for ZFS should include zfs=bootfs or zfs=zroot so the system can boot from ZFS. The root and rootfstype parameters are not needed.

Unmount and restart

We are almost done!

# exit
# umount /mnt/boot
# zfs umount -a
# zpool export zroot

Now reboot.

Warning: If you do not properly export the zpool, the pool will refuse to import in the ramdisk environment and you will be stuck at the busybox terminal.

After the first boot

If everything went fine up to this point, your system will boot. Once. For your system to be able to reboot without issues, you need to enable the zfs.target to auto mount the pools and set the hostid.

For each pool you want automatically mounted execute:

# zpool set cachefile=/etc/zfs/zpool.cache <pool>

Enable the target with systemd:

# systemctl enable zfs.target

When running ZFS on root, the machine's hostid will not be available at the time of mounting the root filesystem. There are two solutions to this. You can either place your spl hostid in the kernel parameters in your boot loader. For example, adding spl.spl_hostid=0x00bab10c, to get your number use the hostid command.

The other, and suggested, solution is to make sure that there is a hostid in /etc/hostid, and then regenerate the initramfs image. Which will copy the hostid into the initramfs image. To do write the hostid file safely you need to use a small C program:

#include <stdio.h>
#include <errno.h>
#include <unistd.h>

int main() {
    int res;
    res = sethostid(gethostid());
    if (res != 0) {
        switch (errno) {
            case EACCES:
            fprintf(stderr, "Error! No permission to write the"
                         " file used to store the host ID.\n"
                         "Are you root?\n");
            break;
            case EPERM:
            fprintf(stderr, "Error! The calling process's effective"
                            " user or group ID is not the same as"
                            " its corresponding real ID.\n");
            break;
            default:
            fprintf(stderr, "Unknown error.\n");
        }
        return 1;
    }
    return 0;
}

Copy it, save it as writehostid.c and compile it with gcc -o writehostid writehostid.c, finally execute it and regenerate the initramfs image:

# ./writehostid
# mkinitcpio -p linux

You can now delete the two files writehostid.c and writehostid. Your system should work and reboot properly now. 


------------------------------------------------------------------------------------------------------------





------------------------------------------------------------------------------------------------------------

출처 : http://blog.boxcorea.com/wp/archives/129



오랫동안 사용하던 E450이 문제가 있어서 수리를 하면서, 그동안 사용하던 solaris9를 solaris10으로 다시 설치했다. disksuit로 구성을 하려다가 오래전에 본 비디오가 생각나서 zfs로 구성을 해 보기로 했다.

개념은 굉장히 간단하며, 사용방법 또한 metadb를 구성하는 것보다 간단하다. 하지만, 아직 확실한 개념 정립이 되지 않아서…

사용하는 디스크는 모두 6개로, 9GB 3개와 18GB 3개다. 9GB 1개는 OS를 설치했고, 나머지는 모두 사용하지 않는 상태다. 디스크는 아래와 같다

bash-3.00# format
Searching for disks…done
AVAILABLE DISK SELECTIONS:
0. c0t0d0 <SUN9.0G cyl 4924 alt 2 hd 27 sec 133>
/pci@1f,4000/scsi@3/sd@0,0
1. c0t1d0 <FUJITSU-MAE3091L SUN9.0G-0706-8.43GB>
/pci@1f,4000/scsi@3/sd@1,0
2. c0t2d0 <IBM-DDRS39130SUN9.0G-S98E-8.43GB>
/pci@1f,4000/scsi@3/sd@2,0
3. c2t0d0 <FUJITSU-MAG3182L SUN18G-1111-16.87GB>
/pci@1f,4000/scsi@4/sd@0,0
4. c3t2d0 <SEAGATE-ST318203LSUN18G-034A-16.87GB>
/pci@1f,4000/scsi@4,1/sd@2,0
5. c3t3d0 <SEAGATE-ST318203LC-0002-16.96GB>
/pci@1f,4000/scsi@4,1/sd@3,0
Specify disk (enter its number):

먼저, zpool을 사용하여 디스크 풀(이름은 fox_pool로 했다)을 만든다. (18GB 짜리 3개)

#zpool create fox_pool c2t0d0 c3t2d0 c3t3d0

#zpool list
NAME                    SIZE    USED   AVAIL    CAP  HEALTH     ALTROOT
fox_pool               58.8G    102K   58.7G     0%  ONLINE     -

9GB 디스크를 하나 더 추가했다.

 #zpool add -f fox_pool c0t2d0

예전의 disk suit이 디스크 size에 민감했던 반면에, zfs는 디스크 size가 달라도 잘 추가가 된다.  상태를 확인해보면,

# zpool status
pool: fox_pool
state: ONLINE
scrub: none requested
config:

NAME        STATE     READ WRITE CKSUM
fox_pool    ONLINE       0     0     0
c2t0d0    ONLINE       0     0     0
c3t2d0    ONLINE       0     0     0
c3t3d0    ONLINE       0     0     0
c0t2d0    ONLINE       0     0     0

errors: No known data errors

이렇게  pool을 생성하면 /에 pool이름이 자동으로 마운트되어 사용가능한 상태가 된다. 이게 영 맘에 안들어서 zpool destroy로 만든 pool을 삭제하고 다시 생성했다(마운트하는 방법을 몰라서… ;ㅡㅡ)

#zpool create -f -m /export/home fox_pool c2t0d0 c3t2d0 c3t3d0 c0t2d0

그런데, 이것이 굳이 이럴 필요가 있는것인지 알 수가 없다. 왜냐하면, zfs 로  /export/home 에 zfs를 마운트할 수 있기 때문이다. 즉, 하나의 디스크 풀을 각기 다른 디렉토리에 마운트 할 수 있는것 같다. 그래서 oracle 프로그램용으로 zfs를 생성해서 마운트 해보았다.

 #zfs create fox_pool/oracle mount /oracle  —> error

#zfs create fox_pool/oracle

# zfs list
NAME              USED  AVAIL  REFER  MOUNTPOINT
fox_pool          130K  57.8G    31K  /export/home
fox_pool/oracle  24.5K  57.8G  24.5K  /export/home/oracle

생성은 잘 되었지만, 문제가 있다. 나는 oracle을 /에 마운트 하고 싶은 것이다.

# zfs destroy fox_pool/oracle
# zfs list
NAME       USED  AVAIL  REFER  MOUNTPOINT
fox_pool  99.5K  57.8G    30K  /export/home

그래서 삭제를 해 버렸다.

여기서 어떻게 해야할지 모르겠다……   자, 답을 알아냈다

#zfs create fox_pool/oracle
#zfs set mountpoint=/oracle   fox_pool/oracle

마운트 포인트를 변경하니 해결이 된다.

자, 여기서, 일부러 에러를 유발하여 복구시켜보았다.

#dd if=/dev/urandom of=/dev/c3t3d0s0 bs=1024 count=10000

s0는 디스크들의 정보가 기록되는 슬라이스로 보이는데, 이곳을 쓰레기 값으로 채워넣은 것이다.

#zpool scrub fox_pool

이 에러는 복구가 되지 않았다. 사실 내가 원하는것은 이것이 아니었다. 그 후 여러번의 시행 착오를 거쳐서 알아낸 것은, zpool 생성시 어떤 옵션도 주지 않으면 디스크들이 stripe 로 묶이는 것이며, mirror 옵션을 주던가 아니면 가장 중요한, raidz 옵션을 주는 것이다.  사실 내가 원하던 것은 Raid5 였다.  mirror도 좋지만, 디스크 두개중 한개밖에 사용할 수 없으니까.

아무튼, Raid-Z 로 디스크를 구성했다. Raid5와 다른점은 디스크 두개로도 구성이 가능하다는 점이다. 사실 이 경우는 mirror와 별 차이가 없는것 같다.

# zpool create fox_pool raidz c2t0d0 c3t2d0
# zpool status
pool: fox_pool
state: ONLINE
scrub: none requested
config:

NAME        STATE     READ WRITE CKSUM
fox_pool    ONLINE       0     0     0
raidz1    ONLINE       0     0     0
c2t0d0  ONLINE       0     0     0
c3t2d0  ONLINE       0     0     0

errors: No known data errors
# df -h

fox_pool                16G    24K    16G     1%    /fox_pool

# zpool list
NAME                    SIZE    USED   AVAIL    CAP  HEALTH     ALTROOT
fox_pool               33.5G    178K   33.5G     0%  ONLINE     -

두 개의 디스크에 다시 에러를 유발시킨다. 여기서는 두번째 디스크 c3t2d0s0에 쓰레기값을 넣었다.

# zpool scrub fox_pool
# zpool status
pool: fox_pool
state: ONLINE
status: One or more devices has experienced an unrecoverable error.  An
attempt was made to correct the error.  Applications are unaffected.
action: Determine if the device needs to be replaced, and clear the errors
using ‘zpool clear’ or replace the device with ‘zpool replace’.
see: http://www.sun.com/msg/ZFS-8000-9P
scrub: scrub completed with 0 errors on Tue May 27 22:00:49 2008
config:

NAME        STATE     READ WRITE CKSUM
fox_pool    ONLINE       0     0     0
raidz1    ONLINE       0     0     0
c2t0d0  ONLINE       0     0     0
c3t2d0  ONLINE       0     0    27

errors: No known data errors

에러를 수정하는 방법에는 두가지가 있다. clear나 replace하는 방법이다. 나는 디스크가 하나 더 있기때문에, replace했다.

#zpool replace fox_pool c3t2d0 c3t3d0
# zpool status
pool: fox_pool
state: ONLINE
scrub: resilver completed with 0 errors on Tue May 27 22:02:22 2008
config:

NAME           STATE     READ WRITE CKSUM
fox_pool       ONLINE       0     0     0
raidz1       ONLINE       0     0     0
c2t0d0     ONLINE       0     0     0
replacing  ONLINE       0     0     0
c3t2d0   ONLINE       0     0    27
c3t3d0   ONLINE       0     0     0

errors: No known data errors

잠시후 확인해보면 디스크가 바뀌어 있는것을 확인 할 수 있다.

 zpool status
pool: fox_pool
state: ONLINE
scrub: scrub completed with 0 errors on Tue May 27 22:09:20 2008
config:

NAME        STATE     READ WRITE CKSUM
fox_pool    ONLINE       0     0     0
raidz1    ONLINE       0     0     0
c2t0d0  ONLINE       0     0     0
c3t3d0  ONLINE       0     0     0

errors: No known data errors

 

fox_pool에 남은 c3t2d0를 추가하기 위하여 zpool add명령을 사용했다.

결과는 별로다. 디스크가 raidz로 추가되는 것이 아니라, 기존의 raidz1과 stripe로 묶여버린 것이다. 물론, raidz 옵션을 추가할때 넣어봤지만, 이경우역시 작동되지 않았다.

# zpool status
pool: fox_pool
state: ONLINE
scrub: none requested
config:

NAME        STATE     READ WRITE CKSUM
fox_pool    ONLINE       0     0     0
raidz1    ONLINE       0     0     0
c2t0d0  ONLINE       0     0     0
c3t3d0  ONLINE       0     0     0
c3t2d0    ONLINE       0     0     0

errors: No known data errors

그래서 다시 디스크 세개로 fox_pool을 생성하였으며, 역시 에러를 유발한 후 테스트 하였다.

# zpool scrub fox_pool
# zpool status
pool: fox_pool
state: ONLINE
status: One or more devices has experienced an unrecoverable error.  An
attempt was made to correct the error.  Applications are unaffected.
action: Determine if the device needs to be replaced, and clear the errors
using ‘zpool clear’ or replace the device with ‘zpool replace’.
see: http://www.sun.com/msg/ZFS-8000-9P
scrub: scrub completed with 0 errors on Tue May 27 21:44:42 2008
config:

NAME        STATE     READ WRITE CKSUM
fox_pool    ONLINE       0     0     0
raidz1    ONLINE       0     0     0
c2t0d0  ONLINE       0     0     0
c3t2d0  ONLINE       0     0     0
c3t3d0  ONLINE       0     0    38

errors: No known data errors

같은방식으로 에러를 유발했다. c3t3d0의 체크섬이 38이다. 이것은 아래 명령으로 수정가능하다.

bash-3.00# zpool clear fox_pool c3t3d0
bash-3.00# zpool status
pool: fox_pool
state: ONLINE
scrub: scrub completed with 0 errors on Tue May 27 21:44:42 2008
config:

NAME        STATE     READ WRITE CKSUM
fox_pool    ONLINE       0     0     0
raidz1    ONLINE       0     0     0
c2t0d0  ONLINE       0     0     0
c3t2d0  ONLINE       0     0     0
c3t3d0  ONLINE       0     0     0

errors: No known data errors

다음은 snapshot을 만들어 보았다. snapshot은 만드는 시점의 데이타를 한번만 반영하는것 같다. 말 그대로 스냅샷을 수행하던 시점의 백업을 만드는 것 같다.

fox_pool에 zfs로 화일시스템을 만들고 세개의 화일(test.txt, last.txt, words)을 생성했다.  그리고 스냅샷을 만들었다.

# ls -al
total 576
drwxr-xr-x   2 root     sys            5 May 27 22:26 .
drwxr-xr-x   3 root     sys            3 May 27 22:25 ..
-rw-r–r–   1 root     root        7105 May 27 22:26 last.txt
-rw-r–r–   1 root     root       16566 May 27 22:26 test.txt
-r–r–r–   1 root     root      206663 May 27 22:26 words

# zfs snapshot fox_pool/home@snap1
bash-3.00# zfs list
NAME                  USED  AVAIL  REFER  MOUNTPOINT
fox_pool              424K  33.1G  35.3K  /fox_pool
fox_pool/home         316K  33.1G   316K  /fox_pool/home
fox_pool/home@snap1      0      –   316K  –

# rm words
# ls -al
total 58
drwxr-xr-x   2 root     sys            4 May 27 22:37 .
drwxr-xr-x   3 root     sys            3 May 27 22:25 ..
-rw-r–r–   1 root     root        7105 May 27 22:26 last.txt
-rw-r–r–   1 root     root       16566 May 27 22:26 test.txt
bash-3.00# zfs snapshot fox_pool/home@snap2
bash-3.00# zfs list
NAME                  USED  AVAIL  REFER  MOUNTPOINT
fox_pool              467K  33.1G  35.3K  /fox_pool
fox_pool/home         348K  33.1G  57.9K  /fox_pool/home
fox_pool/home@snap1   290K      –   316K  –
fox_pool/home@snap2      0      –  57.9K  -

스냅샷은 /fox_pool/home/.zfs/snapshot/snap1 과, /fox_pool/home/.zfs/snapshot/snap2에 각각 저장되어 있다.

# pwd
/fox_pool/home/.zfs/snapshot/snap2
# ls
last.txt  test.txt
# cd ../snap2
# ls
last.txt  test.txt

snap1로 롤백을 해보았다.

# zfs rollback fox_pool/home@snap1
cannot rollback to ‘fox_pool/home@snap1′: more recent snapshots exist
use ‘-r’ to force deletion of the following snapshots:
fox_pool/home@snap2
# zfs rollback -r fox_pool/home@snap1
cannot unmount ‘/fox_pool/home': Device busy
bash-3.00# pwd
/fox_pool/home
# ls
# cd ..
# zfs rollback -r fox_pool/home@snap1
# cd home
# ls
last.txt  test.txt  words

이때, 나중에 만든 snap2는 snap1이 만들어지던 시점에는 존재하지않았기때문에, 지워져 버렸다.. :-( 그래서 경고메시지가 나왔었군…

암튼, 스냅샷은 디스크를 차지하고 있으므로, 필요가 없으면 제거해준다.

#zfs  destroy fox_pool/home@snap1

스냅샷이 저장되는 디렉토리 .zfs 는 ls -al로는 확인이 되지 않았지만, 그 이후는 확인이 가능했다. 아울러, 필요한 화일을 직접 복사하는것도 가능했다.

여기까지 사용해본 소감은, 참 편리하다는거. newfs도 필요없고, 마운트도 필요없고. 생성속도 또한 빠르다. disksuit을 사용해야할 이유를 더 이상 찾을 수가 없다.(물론, solaris10이 아니라면 선택의 여지가 없겠지만…)

마지막으로 참고사이트 : http://docs.sun.com/app/docs/doc/819-5461?l=en  너무 늦게 발견 ;ㅡㅡ




------------------------------------------------------------------------------------------------------------



반응형

'OS > LINUX Common' 카테고리의 다른 글

리눅스 프로세스별 메모리 사용량 확인  (0) 2015.09.02
리눅스 LVM 생성  (0) 2015.08.20
tmpfs 설정하는 방법  (0) 2014.04.16
GNU tar의 특이성 , 체크섬 오류  (0) 2013.07.09
리눅스 vsftpd 설치 / 설정.  (0) 2011.10.14
반응형

Note: These instructions were originally created for older version of Ubuntu (12.04). Some required resource (e.g. grub ppa) is not available on newer versions, thus can lead to errors. If you use Ubuntu 14.04 or newer, see this page instead, which also allows things like raidz root, boot from snapshot, zfs-only setup (no need for separate /boot/grub), and lz4 compression.


These instructions are for Ubuntu. The procedure for Debian, Mint, or other distributions in the DEB family is similar but not identical.

System Requirements

  • 64-bit Ubuntu Live CD. (Not the alternate installer, and not the 32-bit installer!)
  • AMD64 or EM64T compatible computer. (ie: x86-64)
  • 8GB disk storage available.
  • 2GB memory minimum.

Computers that have less than 2GB of memory run ZFS slowly. 4GB of memory is recommended for normal performance in basic workloads. 16GB of memory is the recommended minimum for deduplication. Enabling deduplication is a permanent change that cannot be easily reverted.

Recommended Version

  • Ubuntu 12.04 Precise Pangolin
  • spl-0.6.3
  • zfs-0.6.3

Step 1: Prepare The Install Environment

1.1 Start the Ubuntu LiveCD and open a terminal at the desktop.

1.2 Input these commands at the terminal prompt:

$ sudo -i
# apt-add-repository --yes ppa:zfs-native/stable
# apt-get update
# apt-get install debootstrap spl-dkms zfs-dkms ubuntu-zfs

1.3 Check that the ZFS filesystem is installed and available:

# modprobe zfs
# dmesg | grep ZFS:
ZFS: Loaded module v0.6.3-2~trusty, ZFS pool version 5000, ZFS filesystem version 5

Step 2: Disk Partitioning

This tutorial intentionally recommends MBR partitioning. GPT can be used instead, but beware of UEFI firmware bugs.

2.1 Run your favorite disk partitioner, like parted or cfdisk, on the primary storage device. /dev/disk/by-id/scsi-SATA_disk1 is the example device used in this document.

2.2 Create a small MBR primary partition of at least 8 megabytes. 256mb may be more realistic, unless space is tight. /dev/disk/by-id/scsi-SATA_disk1-part1 is the example boot partition used in this document.

2.3 On this first small partition, set type=BE and enable the bootable flag.

2.4 Create a large partition of at least 4 gigabytes. /dev/disk/by-id/scsi-SATA_disk1-part2 is the example system partition used in this document.

2.5 On this second large partition, set type=BF and disable the bootable flag.

The partition table should look like this:

# fdisk -l /dev/disk/by-id/scsi-SATA_disk1

Disk /dev/sda: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Device    Boot      Start         End      Blocks   Id  System
/dev/sda1    *          1           1        8001   be  Solaris boot
/dev/sda2               2        1305    10474380   bf  Solaris

Remember: Substitute scsi-SATA_disk1-part1 and scsi-SATA_disk1-part2 appropriately below.

Hints:

  • Are you doing this in a virtual machine? Is something in /dev/disk/by-id missing? Go read the troubleshooting section.
  • Recent GRUB releases assume that the /boot/grub/grubenv file is writable by the stage2 module. Until GRUB gets a ZFS write enhancement, the GRUB modules should be installed to a separate filesystem in a separate partition that is grub-writable.
  • If /boot/grub is in the ZFS filesystem, then GRUB will fail to boot with this message: error: sparse file not allowed. If you absolutely want only one filesystem, then remove the call to recordfail() in each grub.cfg menu stanza, and edit the /etc/grub.d/10_linux file to make the change permanent.
  • Alternatively, if /boot/grub is in the ZFS filesystem you can comment each line with the text save_env in the file /etc/grub.d/00_header and run update-grub.

Step 3: Disk Formatting

3.1 Format the small boot partition created by Step 2.2 as a filesystem that has stage1 GRUB support like this:

# mke2fs -m 0 -L /boot/grub -j /dev/disk/by-id/scsi-SATA_disk1-part1

3.2 Create the root pool on the larger partition:

# zpool create -o ashift=9 rpool /dev/disk/by-id/scsi-SATA_disk1-part2

Always use the long /dev/disk/by-id/* aliases with ZFS. Using the /dev/sd* device nodes directly can cause sporadic import failures, especially on systems that have more than one storage pool.

Warning: The grub2-1.99 package currently published in the PPA for Precise does not reliably handle a 4k block size, which is ashift=12.

Hints:

  • # ls -la /dev/disk/by-id will list the aliases.
  • The root pool can be a mirror. For example, zpool create -o ashift=9 rpool mirror /dev/disk/by-id/scsi-SATA_disk1-part2 /dev/disk/by-id/scsi-SATA_disk2-part2. Remember that the version and ashift matter for any pool that GRUB must read, and that these things are difficult to change after pool creation.
  • If you are using a mirror with a separate boot partition as described above, don't forget to edit the grub.cfg file on the second HD partition so that the "root=" partition refers to that partition on the second HD also; otherwise, if you lose the first disk, you won't be able to boot from the second because the kernel will keep trying to mount the root partition from the first disk.
  • The pool name is arbitrary. On systems that can automatically install to ZFS, the root pool is named "rpool" by default. Note that system recovery is easier if you choose a unique name instead of "rpool". Anything except "rpool" or "tank", like the hostname, would be a good choice.
  • If you want to create a mirror but only have one disk available now you can create the mirror using a sparse file as the second member then immediately off-line it so the mirror is in degraded mode. Later you can add another drive to the spool and ZFS will automatically sync them. The sparse file won't take up more than a few KB so it can be bigger than your running system. Just make sure to off-line the sparse file before writing to the pool.

3.2.1 Create a sparse file at least as big as the larger partition on your HDD:

# truncate -s 11g /tmp/sparsefile

3.2.2 Instead of the command in section 3.2 use this to create the mirror:

# zpool create -o ashift=9 rpool mirror /dev/disk/by-id/scsi-SATA_disk1-part2 /tmp/sparsefile

3.2.3 Offline the sparse file. You can delete it after this if you want.

# zpool offline rpool /tmp/sparsefile

3.2.4 Verify that the pool was created and is now degraded.

# zpool list
NAME       SIZE  ALLOC   FREE    CAP  DEDUP  HEALTH  ALTROOT
rpool     10.5G   188K  10.5G     0%  1.00x  DEGRADED  -

3.3 Create a "ROOT" filesystem in the root pool:

# zfs create rpool/ROOT

3.4 Create a descendant filesystem for the Ubuntu system:

# zfs create rpool/ROOT/ubuntu-1

On Solaris systems, the root filesystem is cloned and the suffix is incremented for major system changes through pkg image-update or beadm. Similar functionality for APT is possible but currently unimplemented.

3.5 Dismount all ZFS filesystems.

# zfs umount -a

3.6 Set the mountpoint property on the root filesystem:

# zfs set mountpoint=/ rpool/ROOT/ubuntu-1

3.7 Set the bootfs property on the root pool.

# zpool set bootfs=rpool/ROOT/ubuntu-1 rpool

The boot loader uses these two properties to find and start the operating system. These property names are not arbitrary.

Hint: Putting rpool=MyPool or bootfs=MyPool/ROOT/system-1 on the kernel command line overrides the ZFS properties.

3.9 Export the pool:

# zpool export rpool

Don't skip this step. The system is put into an inconsistent state if this command fails or if you reboot at this point.

Step 4: System Installation

Remember: Substitute "rpool" for the name chosen in Step 3.2.

4.1 Import the pool:

# zpool import -d /dev/disk/by-id -R /mnt rpool

If this fails with "cannot import 'rpool': no such pool available", you can try import the pool without the device name eg:

    # zpool import -R /mnt rpool

4.2 Mount the small boot filesystem for GRUB that was created in step 3.1:

# mkdir -p /mnt/boot/grub
# mount /dev/disk/by-id/scsi-SATA_disk1-part1 /mnt/boot/grub

4.4 Install the minimal system:

# debootstrap trusty /mnt

The debootstrap command leaves the new system in an unconfigured state. In Step 5, we will only do the minimum amount of configuration necessary to make the new system runnable.

Step 5: System Configuration

5.1 Copy these files from the LiveCD environment to the new system:

# cp /etc/hostname /mnt/etc/
# cp /etc/hosts /mnt/etc/

5.2 The /mnt/etc/fstab file should be empty except for a comment. Add this line to the /mnt/etc/fstab file:

/dev/disk/by-id/scsi-SATA_disk1-part1  /boot/grub  auto  defaults  0  1

The regular Ubuntu desktop installer may add dev, proc, sys, or tmp lines to the /etc/fstab file, but such entries are redundant on a system that has a /lib/init/fstab file. Add them now if you want them.

5.3 Edit the /mnt/etc/network/interfaces file so that it contains something like this:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

Customize this file if the new system is not a DHCP client on the LAN.

5.4 Make virtual filesystems in the LiveCD environment visible to the new system and chroot into it:

# mount --bind /dev  /mnt/dev
# mount --bind /proc /mnt/proc
# mount --bind /sys  /mnt/sys
# chroot /mnt /bin/bash --login

5.5 Install PPA support in the chroot environment like this:

# locale-gen en_US.UTF-8
# apt-get update
# apt-get install ubuntu-minimal software-properties-common

Even if you prefer a non-English system language, always ensure that en_US.UTF-8 is available. The ubuntu-minimal package is required to use ZoL as packaged in the PPA.

5.6 Install ZFS in the chroot environment for the new system:

# apt-add-repository --yes ppa:zfs-native/stable
# apt-add-repository --yes ppa:zfs-native/grub
# apt-get update
# apt-get install --no-install-recommends linux-image-generic linux-headers-generic
# apt-get install ubuntu-zfs
# apt-get install grub2-common grub-pc
# apt-get install zfs-initramfs
# apt-get dist-upgrade

Warning: This is the second time that you must wait for the SPL and ZFS modules to compile. Do not try to skip this step by copying anything from the host environment into the chroot environment.

Note: This should install a kernel package and its headers, a patched mountall and dkms packages. Double-check that you are getting these packages from the PPA if you are deviating from these instructions in any way.

Choose /dev/disk/by-id/scsi-SATA_disk1 if prompted to install the MBR loader.

Ignore warnings that are caused by the chroot environment like:

  • Can not write log, openpty() failed (/dev/pts not mounted?)
  • df: Warning: cannot read table of mounted file systems
  • mtab is not present at /etc/mtab.

5.7 Set a root password on the new system:

# passwd root

Hint: If you want the ubuntu-desktop package, then install it after the first reboot. If you install it now, then it will start several process that must be manually stopped before dismount.

Step 6: GRUB Installation

Remember: All of Step 6 depends on Step 5.4 and must happen inside the chroot environment.

6.1 Verify that the ZFS root filesystem is recognized by GRUB:

# grub-probe /
zfs

And that the ZFS modules for GRUB are installed:

# ls /boot/grub/zfs*
/boot/grub/zfs.mod  /boot/grub/zfsinfo.mod

Note that after Ubuntu 13, these are now in /boot/grub/i386/pc/zfs*

# ls /boot/grub/i386-pc/zfs*
/boot/grub/i386-pc/zfs.mod  /boot/grub/i386-pc/zfsinfo.mod

Otherwise, check the troubleshooting notes for GRUB below.

6.2 Refresh the initrd files:

# update-initramfs -c -k all
update-initramfs: Generating /boot/initrd.img-3.2.0-40-generic

6.3 Update the boot configuration file:

# update-grub
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.2.0-40-generic
Found initrd image: /boot/initrd.img-3.2.0-40-generic
done

Verify that boot=zfs appears in the boot configuration file:

# grep boot=zfs /boot/grub/grub.cfg
linux /ROOT/ubuntu-1/@/boot/vmlinuz-3.2.0-40-generic root=/dev/sda2 ro boot=zfs $bootfs quiet splash $vt_handoff
linux /ROOT/ubuntu-1/@/boot/vmlinuz-3.2.0-40-generic root=/dev/sda2 ro single nomodeset boot=zfs $bootfs

6.4 Install the boot loader to the MBR like this:

# grub-install $(readlink -f /dev/disk/by-id/scsi-SATA_disk1)
Installation finished. No error reported.

Do not reboot the computer until you get exactly that result message. Note that you are installing the loader to the whole disk, not a partition.

Note: The readlink is required because recent GRUB releases do not dereference symlinks.

Step 7: Cleanup and First Reboot

7.1 Exit from the chroot environment back to the LiveCD environment:

# exit

7.2 Run these commands in the LiveCD environment to dismount all filesystems:

# umount /mnt/boot/grub
# umount /mnt/dev
# umount /mnt/proc
# umount /mnt/sys
# zfs umount -a
# zpool export rpool

The zpool export command must succeed without being forced or the new system will fail to start.

7.3 We're done!

# reboot

Caveats and Known Problems

This is an experimental system configuration.

This document was first published in 2010 to demonstrate that the lzfs implementation made ZoL 0.5 feature complete. Upstream integration efforts began in 2012, and it will be at least a few more years before this kind of configuration is even minimally supported.

Gentoo, and its derivatives, are the only Linux distributions that are currently mainlining support for a ZoL root filesystem.

zpool.cache inconsistencies cause random pool import failures.

The /etc/zfs/zpool.cache file embedded in the initrd for each kernel image must be the same as the /etc/zfs/zpool.cache file in the regular system. Run update-initramfs -c -k all after any /sbin/zpool command changes the /etc/zfs/zpool.cache file.

Pools do not show up in /etc/zfs/zpool.cache when imported with the -R flag.

This will be a recurring problem until issue zfsonlinux/zfs#330 is resolved.

Every upgrade can break the system.

Ubuntu systems remove old dkms modules before installing new dkms modules. If the system crashes or restarts during a ZoL module upgrade, which is a failure window of several minutes, then the system becomes unbootable and must be rescued.

This will be a recurring problem until issue zfsonlinux/pkg-zfs#12 is resolved.

When doing an upgrade remotely an extra precaution would be to use screen, this way if you get disconnected your installation will not get interrupted.

Troubleshooting

(i) MPT2SAS

Most problem reports for this tutorial involve mpt2sas hardware that does slow asynchronous drive initialization, like some IBM M1015 or OEM-branded cards that have been flashed to the reference LSI firmware.

The basic problem is that disks on these controllers are not visible to the Linux kernel until after the regular system is started, and ZoL does not hotplug pool members. See https://github.com/zfsonlinux/zfs/issues/330.

Most LSI cards are perfectly compatible with ZoL, but there is no known fix if your card has this glitch. Please use different equipment until the mpt2sas incompatibility is diagnosed and fixed, or donate an affected part if you want solution sooner.

(ii) Areca

Systems that require the arcsas blob driver should add it to the /etc/initramfs-tools/modules file and run update-initramfs -c -k all.

Upgrade or downgrade the Areca driver if something like RIP: 0010:[<ffffffff8101b316>] [<ffffffff8101b316>] native_read_tsc+0x6/0x20 appears anywhere in kernel log. ZoL is unstable on systems that emit this error message.

(iii) GRUB Installation

Verify that the PPA for the ZFS enhanced GRUB is installed:

# apt-add-repository ppa:zfs-native/grub
# apt-get update

Reinstall the zfs-grub package, which is an alias for a patched grub-common package:

# apt-get install --reinstall zfs-grub

Afterwards, this should happen:

# apt-cache search zfs-grub
grub-common - GRand Unified Bootloader (common files)

# apt-cache show zfs-grub
N: Can't select versions from package 'zfs-grub' as it is purely virtual
N: No packages found

# apt-cache policy grub-common zfs-grub
grub-common:
 Installed: 1.99-21ubuntu3.9+zfs1~precise1
 Candidate: 1.99-21ubuntu3.9+zfs1~precise1
 Version table:
*** 1.99-21ubuntu3.9+zfs1~precise1 0
      1001 http://ppa.launchpad.net/zfs-native/grub/ubuntu/precise/main amd64 Packages
       100 /var/lib/dpkg/status
    1.99-21ubuntu3 0
      1001 http://us.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
zfs-grub:
 Installed: (none)
 Candidate: (none)
 Version table:

For safety, grub modules are never updated by the packaging system after initial installation. Manually refresh them by doing this:

# cp /usr/lib/grub/i386-pc/*.mod /boot/grub/

If the problem persists, then open a bug report and attach the entire output of those apt-get commands.

Packages in the GRUB PPA are compiled against the stable PPA. Systems that run the daily PPA may experience failures if the ZoL library interface changes.

Note that GRUB does not currently dereference symbolic links in a ZFS filesystem, so you cannot use the /vmlinux or /initrd.img symlinks as GRUB command arguments.

(iv) GRUB does not support ZFS Compression

If the /boot hierarchy is in ZFS, then that pool should not be compressed. The grub packages for Ubuntu are usually incapable of loading a kernel image or initrd from a compressed dataset.

(v) VMware

  • Set disk.EnableUUID = "TRUE" in the vmx file or vsphere configuration. Doing this ensures that /dev/disk aliases are created in the guest.

(vi) QEMU/KVM/XEN

  • In the /etc/default/grub file, enable the GRUB_TERMINAL=console line and remove the splash option from the GRUB_CMDLINE_LINUX_DEFAULT line. Plymouth can cause boot errors in these virtual environments that are difficult to diagnose.

  • Set a unique serial number on each virtual disk. (eg: -drive if=none,id=disk1,file=disk1.qcow2,serial=1234567890)

(vii) Kernel Parameters

The zfs-initramfs package requires that boot=zfs always be on the kernel command line. If the boot=zfs parameter is not set, then the init process skips the ZFS routine entirely. This behavior is for safety; it makes the casual installation of the zfs-initramfs package unlikely to break a working system.

ZFS properties can be overridden on the the kernel command line with rpool and bootfs arguments. For example, at the GRUB prompt:

linux /ROOT/ubuntu-1/@/boot/vmlinuz-3.0.0-15-generic boot=zfs rpool=AltPool bootfs=AltPool/ROOT/foobar-3

(viii) System Recovery

If the system randomly fails to import the root filesystem pool, then do this at the initramfs recovery prompt:

# zpool export rpool
: now export all other pools too
# zpool import -d /dev/disk/by-id -f -N rpool
: now import all other pools too
# mount -t zfs -o zfsutil rpool/ROOT/ubuntu-1 /root
: do not mount any other filesystem
# cp /etc/zfs/zpool.cache /root/etc/zfs/zpool.cache
# exit

This refreshes the /etc/zfs/zpool.cache file. The zpool command emits spurious error messages regarding missing or corrupt vdevs if the zpool.cache file is stale or otherwise incorrect.

반응형
반응형

출처 : http://ngee.tistory.com/83



안녕하세요.


리눅스에서 파일 검색을 하기 위한 명령어 find를 소개합니당.


리눅스 상에서 주로 개발을 하는 저로써는 매우 자주 사용하는 명령어 인데요.


간단하니깐 !! 바로 !! 명령어 들어갑니당.



명령어 : find 파일 찾을 위치 지정 -name 찾을 파일 이름

    ex  : find ./ -name aaa.txt


위에 ex를 설명해드리면 ./(현재 폴더 부터, 하위 폴더 포함) aaa.txt 파일을 찾아줘!!! 입니다.





다음으로 파일 내부 문자열을 검색하는 명령어 grep 입니다.


사실 grep은 여러군데서 사용하고 있는 것이기 때문에, 파일 내부 문자열 검색만을 위해서 쓰이고 있지는 않습니다.


grep의 man을 보시면 -print lines matching a pattern 으로 나와있어요.


이번 포스팅에서는 grep을 통해서 파일 내부의 문자열을 검색해서, 찾고자 하는 문자열과 동일한 문자열을 가진


파일을 찾아주는 것으로 


명령어 : grep -r "찾을 문자열" ./*

     ex : grep -r "aaa" ./*

        

위의 ex를 설명드리면 ./(현재 폴더 아래 모든 파일에서) aaa라는 문자열이 있는지 찾아라!! 단 하위 디렉토리 모두에서(-r) 입니다.


간단하죠? ^ ^ 

반응형
반응형



출처 : http://salm.pe.kr/183




시스템에 설치된 DLL 파일을 찾으려면 시작 단추를 클릭하여 검색을 하면 됩니다. 그런데 현재 사용하고 있는 DLL 파일을 찾으려면 어떻게 해야 할까요? 아, 유틸리티를 사용하면 된다고요? 물론 프로세스 익스플로러라는 걸출한 유틸리티가 있기는 합니다. 그런데 너무 자세해서 오히려 사용하기 불편할 때가 있지요.
이럴 때는 시스템 정보라는 유틸리티를 사용하면 됩니다. 이것은 윈도에 기본으로 포함되어 있는 툴입니다.

시스템 정보 실행하기

시스템 정보(msinfo32)는 어떻게 실행하는가? 이 시스템 정보를 찾으려고 해도 찾을 수가 없다는 사람이 있습니다.

우선 시작 단추에서 실행을 클릭합니다.

실행을 클릭

실행을 클릭


msinfo32를 입력하고 엔터 (또는 확인 단추를 클릭)

msinfo32를 입력하고 엔터 (또는 확인 단추를 클릭)

위와 같이 하면 아래와 같은 시스템 정보 프로그램이 실행됩니다. 이때 시작 단추 > 프로그램 > 보조 프로그램 > 시스템 도구 > 시스템 정보를 클릭하셔도 됩니다.

처음 실행하면 위와 같이 시스템 정보를 새로 읽어 옵니다.

처음 실행하면 위와 같이 시스템 정보를 새로 읽어 옵니다.

시스템 정보를 새로 고치는 시간이 조금 오래 걸릴 수도 있습니다. 보통은 5분 안에 끝납니다. msinfo32 프로그램은 그 성능은 여느 프로그램만큼 하지만, 이 "정보를 새로 고치는 중"이라는 메시지는 정말 짜증 나게 합니다. 어떤 사람은 이게 너무 오래 걸려서 쓰지 못하겠다는 사람도 있습니다.

시스템 요약 정보를 보여주는 모습

시스템 요약 정보를 보여주는 모습

시스템 정보를 읽어오면 맨 처음에는 당연히 시스템 요약 정보를 보여줍니다. 시스템 정보 프로그램을 실행하면 맨 처음에는 왼쪽 창에서 시스템 요약 부분을 선택한 상태이기 때문입니다.

소프트웨어 환경을 클릭하여, 그 하위에 있는 로드된 모듈을 클릭하면, 또 다시 시스템 정보를 다시 읽어 옵니다. 이때 모듈은 반드시 DLL 파일만 있는 것이 아닙니다. 흔히 사용하는 코덱 파일(.ax) 등도 모듈에 해당합니다.

로드된 모듈을 읽어오는 중

로드된 모듈을 읽어오는 중

역시 잠시 기다리시면 됩니다.

로드된 모듈 목록

로드된 모듈 목록


찾을 내용에 찾을 모듈 이름을 입력하고 나서 [찾기]를 클릭합니다.

찾을 내용에 찾을 모듈 이름을 입력하고 나서 [찾기]를 클릭합니다.


입력된 찾을 내용을 찾는 중

입력된 찾을 내용을 찾는 중


찾게 되면 그 위치로 이동해 줍니다.

찾게 되면 그 위치로 이동해 줍니다.

이때 자세한 정보를 보면 아래와 같습니다. 이름이나 버전은 물론이고, 크기날짜, 제조업체, 하드디스크 경로 등도 나타내 줍니다.

찾은 대상이 하나인 경우

찾은 대상이 하나인 경우


찾은 대상이 여럿인 경우

찾은 대상이 여럿인 경우 (다른 컴퓨터)

이때 로드된 모듈의 이름이 같은 여러 개를 찾을 수도 있습니다. 이때 같은 경로에 존재한다면 오직 하나의 파일만 찾지만, 여러 경로에서 발견되면 서로 다른 모듈로 판단하여 여러 개를 찾아 줍니다. 위에서도 여러 개의 usp10 모듈이 존재함을 알 수 있습니다.

추가 정보

이 프로그램은 컴퓨터에 설치한 모듈을 찾아주는 프로그램이 아닙니다. 그러므로 컴퓨터에 설치되어 있더라도 현재 그 모듈을 사용하고 있지 않다면 찾아 주지 않습니다.

반응형
반응형



출처 : http://sksstar.tistory.com/42





○ 마운트의 정의
파일시스템 구조 내에 있는 일련의 파일들을 사용자나 사용자 그룹들이 이용할 수 있도록 만드는 것
논리적으로 디스크와 디렉토리를 붙이는 것. (로컬 자원, 원격 자원 모두 마운트 가능)
시스템이나 사용자가 사용하지 않는 자원은 언마운트.



● /usr/sbin/mount
현재 마운트된 파일시스템 목록 표시
파일시스템을 마운팅할 때 사용
/etc/mnttab에 마운트포인트 추가
/etc/vfstab에 설정하면 시스템이 부팅시에 파일시스템 마운트. (리눅스는 /etc/fstab)

mount {-F fstype} {-o options} device_name mount_point

-F : 파일시스템 지정
-o : 옵션 사용시 지정

○ 옵션 종류

default option other options
-F ufs hsfs, pcfs, nfs
-o read/write ro
-o setuid nosetuid
-o logging nologging
-o largefiles nolargefiles
-o onerror=panic lock, umount




● /usr/sbin/mountall
시스템 부팅시에 /etc/vfstab 파일 read
mountall 명령 실행 시 /etc/vfstab 파일을 읽고 마운트 안되어 있는 것들을 모조리 마운트 시킴.

mountall {option}




● /usr/sbin/umount
파일시스템의 마운트 포인트를 제거
/etc/mnttab에 entry 삭제
/etc/mnttab에서 마운트 포인트를 참조하여 제거

umount {-f} [mount_point | device_name]

-f : 강제적으로 파일시스템 언마운트



● /usr/sbin/umountall
시스템 shutdown시에 /etc/mnttab 파일 read
umountall 명령 실행 시 /etc/mnttab 파일을 읽고 마운트 되어 있는 것들을 모조리 언마운트 시킴.
(단, vfstab에서 정의된 /, /usr, /proc, /dev/fd, /var, /var/run, /tmp는 제외)

umountall {option}

-r : remote 파일시스템만 언마운트



상식적으로 파일시스템이 사용 중일때는 unmount할 수 없다. 이 경우 "umount : file_system_name busy"라는 에러가 출력된다.
하지만, 파일시스템이 사용중일 때 unmount 해주는 명령어가 있다.


● fuser
파일시스템을 사용하고 있는 프로세스 표시 및 필요시 kill

# fuser -cu mount_point // 파일시스템 이름과 사용자 정보 표시
# fuser -ck mount_point // 파일시스템에 접근한 모든 프로세스 kill
# fuser -c mount_point
# fuser -fuk filename | directory
# umount mount_point


또는 위에서 보았던 umount -f 옵션을 주면 강제로 파일시스템을 unmount 한다.



■ /etc/mnttab
현재 마운트된 파일시스템 관리
마운트시 /etc/mnttab 파일에 entry 추가
언마운트시 /etc/mnttab 파일에서 entry 삭제
ASCII 파일이지만 관리자가 직접 관리할 수 없다. 커널이 직접 관리함.



■ /etc/vfstab
Virtual File System Table
부팅시에 자동으로 마운트 할 모든 파일시스템 저장
/etc/vfstab에 맵핑된 마운트 포인트는 관리자가 수동 마운트시에 사용할 수도 있다.



■ /etc/default/fs 와 /etc/dfs/fstypes

○ 마운트 명령 실행시 참조

mount {-F ufs} /dev/dsk/c0t0d0s7 /export/home
mount {-F nfs} unix200:/export/home /export/home

첫번째는 /etc/default/fs 파일 참조
두번째는 /etc/dfs/fstypes 파일 참조

○ /etc/default/fs
Default Local file system
위 파일의 내용 중 LOCAL=ufs 줄이 기본값 지정 부분임.

○ /etc/dfs/fstypes
Default Remote file system
위 파일의 내용 중 nfs NFS Utilities 부분이 기본값 지정 부분임.

○ 파일시스템 타입 찾기

# grep /export/home /etc/vfstab




■ /var/run
솔라리스8에서 추가된 tmpfs type의 파일시스템
보안적인 이유로 소유자는 루트.
쉽게 말해서 임시 디렉토리라고 생각하면 된다.
루트는 /var/run을 사용하고, 일반 사용자는 /tmp를 사용함.

반응형
반응형

작성자 : 박상수
작성일자 : 2010.12.03
작업환경 : VMware7 [ Solaris 9 ]
참고자료 : 서진수 샘




출처 : http://estenpark.tistory.com/266



굉장한 꿀자료... 감사합니다.



1. Slice(parttion) 개요

- Cylinder의 그룹
- 0~7번 Slices로 구성
- Slice 2는 전체 Disk를 표현(수정불가)
* Cylinder의 총개수
- Benefit
* Data의 조직화
* File Access 속도 감소
* I/O performance 향상

2. Disk Slice Naming Convention



3. 리부팅 하지 않고 Hard 추가 방법

[설명] Solaris에서 인식한 하드 확인
[root@calmmass:/]
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0d0 <DEFAULT cyl 44381 alt 2 hd 15 sec 63>
/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0
Specify disk (enter its number): ^D

[설명] 하드디스크 추가 합니다. VMware에서 하드를 2기가 추가하도록 하겠습니다. 아래 그림과 같이 수행 하시면 됩니다.

[설명] 명령어를 이용하여 장치를 인식하게 합니다. 보통의 경우 아래와 같이 명령어를 사용하여 인식하게 하는 방법을 많이 쓴다고 합니다. 재부팅 하게 되면 DB 서버나 WAS 서버를 모두 종료 후 내려야 하기 때문입니다.
[root@calmmass:/]
# devfsadm

[설명] 원래는 0번 하드디스크만 있었지만 devfsadm 명령어를 수행하면 1번 하드디스크를 인식 시킬 수 있습니다.
추가한 디스크를 선택 합니다.(1)
[root@calmmass:/]
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0d0 <DEFAULT cyl 44381 alt 2 hd 15 sec 63>
/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0
1. c2t0d0 <DEFAULT cyl 1021 alt 2 hd 128 sec 32>
/pci@0,0/pci15ad,1976@10/sd@0,0
Specify disk (enter its number): 1
[설명] Disk Slice name을 반드시 기억 하시기 바랍니다. /dev/dsk/ 디렉토리에 파일이 생성 됩니다.
selecting c2t0d0
.. 생략 ..

[설명] fdisk를 생성하지 않고 parttion을 하게 되면 에러가 발생 됩니다. 반드시 fdisk를 수행 후 parttion을 하시기 바랍니다.
format> fdisk
No fdisk table exists. The default partition for the disk is:
a 100% "SOLARIS System" partition
Type "y" to accept the default partition, otherwise type "n" to edit the
partition table.
y

[설명] part는 parttion의 약어로 사용 가능합니다.
format> part
.. 생략 ..

[설명] 0번 Slice를 선택 합니다.
partition> 0
[설명] 이부분은 파티션 id를 의미하며 가급적이면 설정 하지 마세요. Enter
Enter partition id tag[unassigned]:
[설명] wm(read/write mount), wu(read/write unmount), rm(read/only mount), ru(read/only unmount) 네 가지 종류가 있으며 기본적으로 설정되는 wm을 선택 하겠습니다. Enter
Enter partition permission flags[wm]:
[설명] 실린더의 번호를 넣습니다. 처음 시작하면 0부터 시작 하기때문에 Enter
Enter new starting cyl[0]:
[설명] 용량을 mb단위로 적습니다.
Enter partition size[0b, 0c, 0e, 0.00mb, 0.00gb]: 200mb
[설명] 파티셔닝을 한 내역을 보겠습니다.
partition> print
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 - 99 200.00MB (100/0/0) 409600
.. 생략 ..

[설명] 1번 Slice를 선택 하고 위와 동일합니다.
partition> 1
Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
[설명] 굉장히 중요한 부분입니다. 이것은 Cylinders의 이전 번호 마지막 번호가 99라면 100을 설정 합니다.
Enter new starting cyl[0]: 100
Enter partition size[0b, 0c, 100e, 0.00mb, 0.00gb]: 300mb
partition> print
Part Tag Flag Cylinders Size Blocks
1 unassigned wm 100 - 249 300.00MB (150/0/0) 614400
.. 생략 ..

[설명] 3번 Slice를 선택 하고 위와 동일합니다.
여기에서 2번 Slice를 선택 하지 않은 이유는 기본적으로 backup tag가 사용하고 있으며 변경 해서는 안됩니다.
partition> 3
Enter partition id tag[unassigned]:
Enter partition permission flags[wm]:
Enter new starting cyl[0]: 250
Enter partition size[0b, 0c, 250e, 0.00mb, 0.00gb]: $ // 남은 공간 모두 사용함
partition> print
Part Tag Flag Cylinders Size Blocks
3 unassigned wm 250 - 1019 1.50GB (770/0/0) 3153920

[설명] 재부팅 해도 사용할 수 있게 저장합니다.
partition> label
Ready to label disk, continue? yes

[설명] 작업 종료
partition> quit
format> quit

[설명] 그럼 위에서 기억하라고 했던 Disk Slice name를 이용해서 제대로 적용 되었는지 확인 하겠습니다.
[root@calmmass:/]
# ls /dev/dsk/c2t0d0*
/dev/dsk/c2t0d0p0@ /dev/dsk/c2t0d0s10@ /dev/dsk/c2t0d0s3@
/dev/dsk/c2t0d0p1@ /dev/dsk/c2t0d0s11@ /dev/dsk/c2t0d0s4@
/dev/dsk/c2t0d0p2@ /dev/dsk/c2t0d0s12@ /dev/dsk/c2t0d0s5@
/dev/dsk/c2t0d0p3@ /dev/dsk/c2t0d0s13@ /dev/dsk/c2t0d0s6@
/dev/dsk/c2t0d0p4@ /dev/dsk/c2t0d0s14@ /dev/dsk/c2t0d0s7@
/dev/dsk/c2t0d0s0@ /dev/dsk/c2t0d0s15@ /dev/dsk/c2t0d0s8@
/dev/dsk/c2t0d0s1@ /dev/dsk/c2t0d0s2@ /dev/dsk/c2t0d0s9@

[설명] 포멧 작업을 하겠습니다. 파일 시스템은 ufs(Unix File System)으로 만들어 집니다.
[root@calmmass:/]
# newfs /dev/dsk/c2t0d0s0
newfs: construct a new file system /dev/rdsk/c2t0d0s0: (y/n)? y
/dev/rdsk/c2t0d0s0: 409600 sectors in 100 cylinders of 128 tracks, 32 sectors
200.0MB in 7 cyl groups (16 c/g, 32.00MB/g, 15360 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 65600, 131168, 196736, 262304, 327872, 393440,

[설명] 포멧 작업을 하겠습니다. 파일 시스템은 ufs(Unix File System)으로 만들어 집니다.
[root@calmmass:/]
# newfs /dev/dsk/c2t0d0s1
newfs: construct a new file system /dev/rdsk/c2t0d0s1: (y/n)? y
/dev/rdsk/c2t0d0s1: 614400 sectors in 150 cylinders of 128 tracks, 32 sectors
300.0MB in 10 cyl groups (16 c/g, 32.00MB/g, 15360 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 65600, 131168, 196736, 262304, 327872, 393440, 459008, 524576, 590144,

[설명] 포멧 작업을 하겠습니다. 파일 시스템은 ufs(Unix File System)으로 만들어 집니다.
[root@calmmass:/]
# newfs /dev/dsk/c2t0d0s3
newfs: construct a new file system /dev/rdsk/c2t0d0s3: (y/n)? y
/dev/rdsk/c2t0d0s3: 3153920 sectors in 770 cylinders of 128 tracks, 32 sectors
1540.0MB in 34 cyl groups (23 c/g, 46.00MB/g, 11264 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 94272, 188512, 282752, 376992, 471232, 565472, 659712, 753952, 848192,
2261792, 2356032, 2450272, 2544512, 2638752, 2732992, 2827232, 2921472,
3015712, 3109952,

[설명] 파일 시스템은 ufs(Unix File System)으로 만들어 졌는지 확인 합니다.
[root@calmmass:/]
# fstyp /dev/dsk/c2t0d0s0
ufs
[root@calmmass:/]
# fstyp /dev/dsk/c2t0d0s1
ufs
[root@calmmass:/]
# fstyp /dev/dsk/c2t0d0s3
ufs

[설명] Disk를 디렉토리에 할당하기 위해서 디렉토리를 구성하고 마운트 작업을 진행 합니다.
[root@calmmass:/]
# mkdir /disk1 /disk2 /backup
[root@calmmass:/]
# mount -F ufs /dev/dsk/c2t0d0s0 /disk1
[root@calmmass:/]
# mount -F ufs /dev/dsk/c2t0d0s1 /disk2
[root@calmmass:/]
# mount -F ufs /dev/dsk/c2t0d0s3 /backup

[설명] 아래와 같이 정상적으로 마운트가 되었다면 모두 성공 하신 겁니다.
[root@calmmass:/]
# df -h
Filesystem size used avail capacity Mounted on
.. 생략 ..
/dev/dsk/c2t0d0s0 187M 1.0M 167M 1% /disk1
/dev/dsk/c2t0d0s1 281M 1.0M 252M 1% /disk2
/dev/dsk/c2t0d0s3 1.5G 1.5M 1.4G 1% /backup



+ 추가로 /etc/vfstab에 추가된 파티셔닝 재설정 해주기.



4. 재부팅 이후 hard 추가 방법

[설명] 첫번째 방법은 /root 홈디렉토리에 reconfigure 빈파일을 생성하면 부팅 할때 장치를 읽고 OS를 구동 시킵니다.
[root@calmmass:/]
# touch /reconfigure

[설명] 두번째 방법은 명령어를 이용해서 장치를 인지 할 수 있습니다.
[root@calmmass:/]
# reboot -- -r

[설명] 세번째 방법은 솔라리스 전용 키보드를 이용하는 방법입니다.
ok boot -r -> PROM

장치 인식이 완료되면 작업은 3번과 동일 합니다.



솔라리스는 리눅스보다 조금 어렵습니다.
윈도우는 C드라이브, D드라이브
리눅스는 /dev/sda, /dev/sdb
솔라리스는 /dev/dsk/c#t#d#s# 또는 /dev/dsk/c#d#s#
으로 구분 할 수 있는데 솔라리스는 sparc-IDE와 x86-IDE 많은 차이점이 발생 됩니다.
x86은 일반 컴퓨터로 사용하기 위한 방법으로 스카시 카드가 필요 없기 때문입니다.
하지만 sparc 서버같은 경우에는 스카시 카드 -> 케이블 -> 각각의 디스크로 구성 되어있기 때문입니다.

여러가지 어려운 Disk의 세계에서 조금 벗어난 기분이지만 아직 더 공부를 해야 할 것 같습니다.










반응형
반응형

출처 : http://blog.naver.com/PostView.nhn?blogId=syj0841&logNo=140046786256&widgetTypeCall=true


* depot 패키지로 소프트웨어 설치 및 삭제
1. 패키지를 적당한 곳에 두고 패키지를 등록하는 작업을 한다. 그리고 설치한다.
(내 경우는 /var/spool/sw 아래에 두고 시작한다.)
# swreg -l depot /var/spool/sw/package_name.xxx
# swinstall -s /var/spool/sw/package_name.xxx
# swremove

* depot 패키지 관련 SW List 보기
# swlist
# swlist -a state -l fileset > swlist.txt

* depot 패키지 관련 configuration
#
swconfig

* SAM (Sysam Administrator Manager)
#sam

반응형
반응형



HP-UX에서 acc 컴파일러를 사용하다가 갑자기 포맷하는 일이 생겨서 어쩔 수 없이 gcc를 설치하게 되었다.


gcc를 설치하려니 여러가지 dependencies 패키지가 발생했는데 우선 내가 설치하다가 걸린 패키지들은 아래와 같다.


gettext

libiconv

zlib

libgcc


뭐 버전에 따라서 차이가 있을 수 있지만 swinstall로 설치할때는 zlib와 libgcc만 표시가 되었는데

실제 설치해보니 libiconv, gettext가 걸렸다. 


기본적으로 /usr/gnome/lib 쪽에 설치는 되어 있는 것으로 확인되었지만 해당 부분은 내가 설치한 것도 아니고 링크를 걸어도

정상적으로 인식이 되지 않아 별도로 패키지를 구해서 설치하니 정상적으로 표시되었다.


마지막에 


/usr/lib/dld.sl: Can't open shared library: /usr/local/lib/libintl.sl
/usr/lib/dld.sl: No such file or directory
Abort(coredump)


해당 부분이 발생해서 당황했었지만 이는 gettext 라이브러리를 설치해주면 해결되는 현상.


HP-UX 설치 패키지들은 아래의 경로에서 다운 받았다.

URL : http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=2a08725cc2f02110725cc2f02110275d6e10RCRD (HP공식 - HP 가입해야합니당)

URL : http://hpux.connect.org.uk/

URL : http://mirrors.develooper.com/hpux/downloads.html

URL : http://gnu.april.org/software/gcc/gcc-4.4/buildstat.html


--------------------------------------------------------------------------------------------


위 같이... 설치해 보았지만 골 때리는 현상을 발견했다.

-m32 -m64 와 같은 비트 옵션이 먹지 않는다는 사실.


이게 왜 이런가 하고 한참 동안 삽질 하다가 HP 공식 홈페이지를 통해서 확인한 사실은 내가 영어 해석을 잘 못해서 그런데

대충 해석해보니 32비트용 gcc랑 64비트 gcc를 둘다 깔아야 한다. 라는 얘기로 보인다.


자세한 얘기는 아래의 링크...

http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=2a08725cc2f02110725cc2f02110275d6e10RCRD


There are two separate GCC packages for PA-RISC, one that generates ILP32 code, and another that generates LP64 code. The 32-bit version is installed in the /opt/hp-gcc directory, and the 64-bit version is installed in /opt/hp-gcc64.


심지어 깔리는 위치도 각각 다르다... 

일단 둘다 깔아야 겠다... 나중에 다시 한번 확인해봐야겠다 ㅠ



반응형
반응형

출처 : http://kyosi3t.tistory.com/6



Solaris에서 Package 관리 관련 명령어
 

- pkginfo 명령어

# pkginfo | more (전체 패키지 확인)

# poginfo -l SUNWab2s (SUNWab2s에 대한 상세 정보 출력)

# pkginfo | wc -l  (패키지 수 확인)

# pkginfo -d /cdrom/sol_8_u3_sparc/s0/solaris_8/Product | more

  (CD-ROM으로부터 패키지 정보 확인)

# pkginfo -d /cdrom/sol_8_u3_sparc/s0/solaris_8/Product -l SUNWaudio | more

  (CD-ROM으로부터 SUNWaudio 패키지 정보 확인)

 


- pkgadd 명령어

# pkgadd -d .  (현재 directory에서 directory형태로 되어 있는 패키지 모두 설치)

# pkgadd -d SUNWsan (현재 directory의 패키지중 SUNWsan 패키지만 설치)

# pkgadd -d /cdrom/sol_8_u3_sparc/s0/solaris_8/Product SUNWaudio

 (CD_ROM으로부터 SUNWsan 패키지 설치)

# pkgadd -d /cdrom/sol_8_u3_sparc/s0/solaris_8/Product -s spool SUNWaudio

 (/var/spool/pkg 디렉토리로 복사)

 


- pkgrm 명령어

# pkgrm SUNWsan

# pkgrm -s spool SUNWsan  (/var/spool/pkg로 제거된 패키지 저장)

# pkgrm -s /export/pkg SUNWsan  (spool 디렉토리 /export/pkg로 제거된 패키지 저장)

 


- pkgchk 명령어

 파일 정확성 검사 : 파일 퍼미션, 소유자, block or character device의 major/minor, 파일   크기, checksum, 수정날짜 등.

 (-l : 자세한 정보 제공

  -v : 검사한 파일리스트 제공

  -p path: 경로명의 정확성 검사 )

# pkgchk SUNWsan

#          <-- 아무런 message도 없으면 성공적인 설치

# pkgchk -v SUNWsan  (패키지에 포함된 file list)

 


# pkgchk -p /etc/passwd

  (설치시 /etc/passwd와 현재의 /etc/passwd의 변화된 정보를 보여줌)

# pkgchk -l -p /usr/bin/ls  (패키지 설치 정보 검사)

 


- /var/sadm/install/contents 파일

 pkgadd에 의해 패키지가 추가될 때마다 /var/sadm/install/contents에 정보 추가.

# grep pkgadd /var/sadm/install/contents  (pkgadd에 대한 정보를 출력)



출처 : http://www.ioneit.co.kr/ver1/bbs/board.php?bo_table=tiptech1_1&wr_id=46&page=2


이곳에서는 Solaris Sparc version의 Package & Patch에 관하여 설명하도록 하겟습니다.
    우리가 System으로 어떠한 일을 하는데 있어서 단순히 OS만을 설치하고 이것만을 사용하지는 않을 것 입니다.  대부분 어떤 작업을 하는데 있어서 좀더 편리하고, 좀더 좋은 부가적인 프로그램을 덧붙여 사용하겠죠. 파일을 압축하여 용량을 줄이는 압축프로그램, E-MAIL을 주고 받을 수 있는 E-MAIL프로그램, APHACHE, C compiler,.....등 사용자가 필요한 프로그램을 다운, 설치하여 사용합니다.

    과연 Solaris System에서는 어떻게 프로그램을 다운 받아, 설치하여 사용하는지 알아보기로 하겠습니다

SUN package
    MS나  리눅스등의 OS에서 응용프로그램을 설치하기 위해서 인스톨파일이나 RPM등을 사용하는데
    Solaris에서는 응용프로그램들을 그룹단위로 묶어 배포하는데 이를 Package라 칭합니다.
    먼저 가장 쉽게 Sun package를 접 할 수 있는것이, System 구입시 첨부되는 CD입니다. 그리고 웹 상에서도 이를 구할 수 있습니다
    Package식 배포에는 장점과 단점을 가지고 있는데,
  • 장 점 : 다른 OS와 달리 설치, 제거가 용이하다
              응용프로그램의 소스를 컴파일하여 설치를 할 경우 설치된 곳에 다른 응용프로그램도 
              같이 들어있을 가능성이 크다. 나중에 이러한 프로그램을 다시 삭제할 필요가 생겼을 
              때 해당 응용프로그램만 지운다는 것은 거의 불가능에 가깝다고 볼 수 있다.
  • 단 점 : 패키지의 종류가 많지 않다.
              패키지의 환경을 마음대로 바꿀 수 없다  

SUN 패키지 설치 이전에..
    1. 우선 System의 남은 용량을 확인합니다. ( df  -k )
2. System의 어느 디렉토리에 설치할 것 인지를 정한다.
    3. 웹이나 ftp를 통해서 다운을 받습니다.
    4. 일단 다운받은 패키지의 압축을 풉니다. (거의 파일이 압축되어있음.)
        - Z (uncompress 파일명), gz (gzip -d 파일명), zip (zip -d 파일명).. 이렇게들 풀면되구요
        - gzip 파일로 압축되어 있는건  먼저 gzip 패키지를 설치하셔야 합니다.
    5. pkgadd -d . 명령을 써서 패키지를 설치합니다.

     ※ 솔라리스의 패키지를 제공하는 사이트입니다.  http://www.sunfreeware.com

SUN 패키지 설치하기 

    pkgadd 명령 

    패키지를 추가하는 명령어이다. pkgadd에 대한 여러 옵션 중에서 가장 기본적이며 많이 쓰이는 것은 ‘-d’옵션이다. 이를 사용하지 않으면 패키지를 설치하지 못한다.
    아래의 예를 보면 pkgadd -d 다음에  "."을 붙이는데 이는 현재 디렉토리의 안에 있는 패키지들을 추가한다는 뜻입니다. "." 하나 땜에 애먹을 수 있습니다. 주의 하시기 바랍니다. 
    ※ 패키지를 추가할 때에는 SUPER-USER가 아니면 추가시킬 수 없슴.(root계정을 말하는 거예요)

    pkgadd [ -d [device | patname]] pkg_nmae

[leemary:/var/spool/pkg] pkgadd -d .
    다음과 같은 패키지를 사용할 수 있습니다.
      1  SUNWaudio     Audio applications
                       (sparc) 3.6.4,REV=1.98.08.13
    처리할 패키지(들)를 선택하십시오.(또는 모든 패키지를
    처리하려면'all'을 입력하십시오.) (default: all) [?,??,q]: 1
             *
             *
    ## 패키지 정보 처리 중
    ## 시스템 정보 처리 중
    ## 패키지 종속성 검증
             *
             *
    ## 1째 (전체: 1) 부분 설치
    <SUNWaudio>(이)가 성공적으로 설치되었습니다.
    다음과 같은 패키지를 사용할 수 있습니다.
      1  SUNWaudio     Audio applications
                       (sparc) 3.6.4,REV=1.98.08.13

     

SUN 패키지 삭제하기 

    pkgrm 명령

    이명령어는 현재 설치되어 있는 패키지를 삭제하고 싶을 때 사용하는 것으로, 사용법은 다음과 같습니다.
    pkgchk  package_name

# pkgrm SUNWaudio
     현재 설치되어 있는 패키지는 다음과 같습니다:
       SUNWaudio       Audio applications
                       (sparc) 3.6.4,REV=1.98.08.13
    이 패키지를 제거하겠습니까? y
    ## 설치된 패키지 예 <SUNWaudio> 제거
    ## 패키지 종속성 검증
    경고:
        <SUNWolrte> 패키지는 현재 제거되는 패키지에
        종속되어있습니다.
                       *
                       *
    이 패키지를 계속 제거하겠습니까? y
    ## 패키지 정보 처리 중
    ## 시스템 정보 갱신 중
    <SUNWaudio>(이)가 성공적으로 제거되었습니다.

패키지에관한 부가적 명령

    pkginfo 명령

    지정된 패키지의 정보를 알 수 있는 명령어로서, 일정패키지 폴더안에 pkginfo라는 file이 생성되어 있고, 안에 패키지의 정보에 대한 파라키터 값들이 저장되어있다.
    pkginfo [ -d [device | pathname] ] [ -l ] pkg_name

    -d : 패키지 소프트워에가 존재하고 있는, 장치명이나 절대디렉토리를 지정.
    - l : 지정 패키지의 세부적인 사항을 보고 싶을 때..
     
    다음은 Solaris 7 media에 있는 패키지를 사용한 예입니다.

# pkginfo -d /cdrom/cdrom0/s0/Solaris_2.7/Product |more
   system      FJSVhea        SunOS Header Files for FUJITSU platform specific
   system      FJSVvplr.u     Fujitsu platform specific symlinks (Root)
   system      FJSVvplr.us    Fujitsu platform links
   system      FJSVvplu.u     Fujitsu platform specific symlinks (user)
# pkginfo -d /cdrom/cdrom0/s0/Solaris_2.7/Product -l SUNWaudio
   PKGINST:  SUNWaudio
   NAME:  Audio applications
                    *
                    *
   VERSION:  3.6.4,REV=1.98.08.13
    FILES:      9 스풀된 경로 이름
                 2 디렉토리
                 3 실행 가능
                 4 패키지 정보 파일
               700 블록이 사용됨 (추정치)

     ※ pkginfo | wc -l : 현재 system에 install 되어있는 pkg의 숫자를 확인할 때 사용합니다.

    pkgchk 명령

    패키지 체크 명령어는 어떤 패키지의 추가 이후 system에 변경된 값을 기존과 비교하여 나타내주는 명령어입니다.
    패키지를 설치한후 지금과 변경된 값이 없을 경우 아무것도 디스플레이 하지 않는다
    pkgchk [-p path1, [path2..]]

# pkgchk -p /etc/group
 ERROR: /etc/group
    file size <278> expected <313> actual
    file cksum <23586> expected <25899> actual


참고 

Package의 유형

    아래의 예문  gawk-3.0.4-sol7-sparc-local.gz,  sunvts_40.tar.gz과 같은 두개의 패키지 파일이 있습니다
    이 파일의 압축을 풀고 내용을 보면 디스플래이 되는 화면이 다르다는 것을 느낄수 있을 것입니다.
    gawk-3.0.4-sol7-sparc-local.gz은 압축을 풀어도 하나의 파일이 생성이 되고 그 파일의 내용을 보면 
    패키지 파일의 이름이나 버젼등의 정보가 수록 되어있습니다.  달리 sunvts_40.tar.gz파일의 압축을 
    풀어보면 디렉토리가  생성이 되고 그 안에 패키지 정보나 기록위치등이 포함된 파일이 생성되어 
    있습니다. 이 두 유형의 패키지는 파일의 형태만 다를 뿐 설치하는 방법은 같습니다.

# ls
   gawk-3.0.4-sol7-sparc-local.gz

# gzip -d gawk-3.0.4-sol7-sparc-local.gz
# ls
   gawk-3.0.4-sol7-sparc-local
# more gawk-3.0.4-sol7-sparc-local
# PaCkAgE DaTaStReAm
   SMCgawk 1 3454
# end of header
gawk
NAME=gawk
ARCH=sparc
VERSION=3.0.4
CATEGORY=application
VENDOR=Free Software Foundation
EMAIL=steve@smc.vnet.net
PSTAMP=Steve Christensen
BASEDIR=/usr/local
CLASSES=none
0030939000081a40000000a0000000a0000000138ab966d00000d1b000000200000004a00
000000000000000000000f00000003SMCgawk/pkgmap: 1 3454
 

# ls
   sunvts_40.tar.gz
# gzip -d sunvts_40.tar.gz
# ls
   sunvts_40.tar
# tar xvf sunvts_40.tar
x SUNWvts, 0 bytes, 0 테이프 블록 
x SUNWvts/install, 0 bytes, 0 테이프 블록 
x SUNWvts/install/checkinstall, 4014 bytes, 8 테이프 블록 
x SUNWvts/install/copyright, 59 bytes, 1 테이프 블록 
# ls -al
drwxr-xr-x 11 root other 512 3월 25일 23:57 .
drwxrwxr-x 3 root sys 512 3월 12일 14:18 ..
drwxrwxr-x 4 root other 512 1999년 12월 23일 SUNWvts
drwxrwxr-x 3 root other 512 1999년 12월 23일 SUNWvtsmn
drwxrwxr-x 4 root other 512 1999년 12월 23일 SUNWvtsx
-rw-r--r-- 1 root other 17776128 3월 25일 23:56 sunvts_40.tar
#cd SUNWvts 
# ls
install pkginfo pkgmap reloc reloc.cpio.Z


    contents file
    /var/sadm/install/contents file은 설치된 pakage에 대한 log가 수록되어있다
    system의 패키지에 관한  정보를 알 수 있다.

 

 

SUN 패치..

    언제라도 발생할 수 있는 보안 침해나, 버그, y2k, 업그래이드 사항에 대하여 썬에서는 솔라리스 각 버전에 대해서 패치를 정기적으로 제공해준다.
    특히 y2k 패치가 안되어 있는 OS는 해당되는 패치를 해주어야 한다.

    패치 넘버
    솔라리스에서는 독특한 패치 ID를 부여한다. 예로 110281-02를 보면 패치넘버 110281의 두 번째 업그래이드 버전이라는 걸 알 수 있다

     

패치 구하기

    썬에서 제공하는 패치는 여러곳에서 구할 수 있으나, 대표적으로 http://sunsolve.sun.com/
    에서 쉽게 다운받을 수 있다. http, ftp로의 다운을 제공하며 패치에관 한 Report를 제공한다.
     

  • Patchfinder

    OS별로 추천되는 패치를 받을 수가 있다. 여기서는 사용자가 선택을 할 수가 없으며 단순히 썬에서 권고하는 여러 패치 ID가 하나의 파일로 압축되어져 있는 것을 다운 받을 수 있다. 그렇다고 이곳에서는 특정 패치 ID를 다운받을 수 없는 것은 아니다. Find Patch라는 패치 ID검색 기능이 있어서 이곳에서 원하는 패치 ID를 검색하여 다운 받을 수 있다. 

  • Recommended & Security Patches 
    OS별, 보안관련 패치로 분류되어 있다. 이중 패치하고자 하는 것을 선택하면 여러 패치 ID리스트가 나올 것입니다. 리스트에서 사용자가 원하는 것만 클릭해서 다운로드를 받을 수 있고 모두 받을 수도 있습니다. 선택한 것을 다운로드 받으면‘ Recommended.zip과 같이 하나의 압축파일 형태로 제공이 됩니다..

 

패치를 하기 이전에

    패키지를 설치하거나 패치를 하기 이전도 패키지 설치와 마찬가지 입니다.  System의 상황을 파악
    하여야 하고. 다운받을 곳의 위치와 필요 패키지의 설치 여부 등을 파악해야 됩니다.
    또한 자신의 서버에 어떤 패치가 설치되어 있는지에 대한 정보를 수집한다 이러한 설치된 패치 정보를 보기위해서 showrev라는 명령어를 사용한다. 이 명령어는 머신이나 소프트웨어의 정보를 보여주는 명령어이다. 

    showrev [-a] [-p] [-w] [-c command] 

    -a : 모든 정보를 보여준다. 
    -p : 패치에 관한 정보만을 보여준다. 
    -c command : 입력된 명령어(command)에 대한 정보를 보여준다. 

# showrev
Hostname: leemary
Hostid: 80c5575c
Release: 5.7
Kernel architecture: sun4u
Application architecture: sparc
Hardware provider: Sun_Microsystems
Kernel version: SunOS 5.7 Generic 106541-15 January 2001

     

패치 하기

    먼저 패치 파일을 다운받아야 겟죠.
    그리구 zip파일을 이용하여 압축을 풉니다.

     

    patchadd 명령

     patchadd    patch ID

    패치를 추가하는 명령어이다.  README 파일을 꼭 참조하시고 명령을 실행하시기 바랍니다.
    다음은 Solaris 7 OS 의 패치파일모음인 7-Recommended 파일을 다운받아 압축을 풀어 생성된
    7-Recommeded폴더의 내용과 인스톨 시키는 과정입니다.
    개별적인 패치와 달리 Recommended 패치는 install_cluster파일을 실행시켜 주시면 됩니다.
     

# ls
106300-09        107200-12        107794-01        108756-01
106327-08        107259-02        107834-03        108758-01
                            *
                            *
107115-07        107654-08        108662-01        CLUSTER_README
107148-08        107684-02        108721-02        copyright
107149-07        107702-07        108748-01        install_cluster
107171-08        107709-12        108750-01        patch_order
107180-27        107792-02        108754-01
# install_cluster
Patch cluster install script for Solaris 7 Recommended
*WARNING* SYSTEMS WITH LIMITED DISK SPACE SHOULD *NOT* INSTALL PATCHES:
With or without using the save option, the patch installation process
will still require some amount of disk space for installation and
administrative tasks in the /, /usr, /var, or /opt partitions where
patches are typically installed.  The exact amount of space will
depend on the machine's architecture, software packages already 
installed, and the difference in the patched objects size.  To be
safe, it is not recommended that a patch cluster be installed on a
system with less than 4 MBytes of available space in each of these
partitions.  Running out of disk space during installation may result
in only partially loaded patches.  Check and be sure adequate disk space
is available before continuing.
Are you ready to continue with install? [y/n]: y
Determining if sufficient save space exists...
Sufficient save space exists, continuing...
Installing patches located in /export/home/7_Recommended
Using patch_order file for patch installation sequence
Installing 106960-01...
  Installation of 106960-01 failed. Return code 2.
Installing 107038-01...
  Installation of 107038-01 failed. Return code 2.
Installing 107171-08...
                            *
                            *
                            *
 Interrupted ... Please wait
The following patches were not able to be installed:
        106960-01
        107038-01

For more installation messages refer to the installation logfile:
  /var/sadm/install_data/Solaris_7_Recommended_log
Use '/usr/bin/showrev -p' to verify installed patch-ids.
Refer to individual patch README files for more patch detail.
Rebooting the system is usually necessary after installation.
[leemary:/export/home/7_Recommended]

    ※ 패치시 패치실패 메시지가 나오면서 설치가 안되는 경우가 발생합니다. 이때 에러코드를 참조하시고
        대부분의 패치에러는 각 System에따라 필요하지 않은 패치들입니다.

     

패치 삭제하기


    patchrm 명령

    patchrm    patch ID

    추가되어 있는 패치를 삭제 시키는 명령어입니다.
    System에 패치를 시켰을 때 간혹 버그가 발생하는데, 이때 보조 디바이스를 사용하지 못한다거나 하는
    문제가 발생할 수 있습니다. 이럴 경우 해당 패치를 삭제시켜 주어야 합니다.

# patchrm 106300-09
Checking installed patches...
Patch 106300-09 has not been applied to this system.
Patchrm is terminating.

 


반응형
반응형

출처 : http://forum.falinux.com/zbxe/index.php?document_srl=560877&mid=lecture_tip




에프에이리눅스에서 판매하는 보드에서 루트파일 시스템을 yaffs 파일 시스템으로 설정하고, /tmp 를 tmpfs 로 설정하기 위해서는
다음과 같은 방법으로 설정하면 됩니다.

 

tmpfs는 램의 공간을 사용하기 때문에 전원이 OFF되면 저장된 데이터가 모두 삭제되는 휘발성 공간입니다.

 

1. tmpfs 파일 시스템이 존재하는지를 확인 합니다.

 

   [root@falinux ~]$ cat /proc/filesystems 
   nodev sysfs
   nodev rootfs
   nodev bdev
   nodev proc
   nodev binfmt_misc
   nodev debugfs
   nodev sockfs
   nodev usbfs
   nodev pipefs
   nodev anon_inodefs
   nodev tmpfs
   nodev devpts
   ext3
   ext2
   nodev ramfs
   vfat
   msdos
   nodev nfs
   nodev nfs4
   nodev nfsd
   nodev autofs
   yaffs
   yaffs2
   nodev mqueue
   nodev rpc_pipefs

 

 여기서 tmpfs 파일 시스템이 존재하지 않으면 커널에서 다음 옵션을 활성화 시켜야 합니다.
   
   File systems  ---> 
        Pseudo filesystems  --->
         [*] Virtual memory file system support (former shm fs)
         [*]   Tmpfs POSIX Access Control Lists 
           
    

2. mount 옵션을 사용하여 tmpfs를 사용하는 방법

 

   [root@falinux /]$ mount -t tmpfs -o size=20M tmpfs /tmp

   [root@falinux /]$ df
   Filesystem 1K-blocks Used Available Use% Mounted on
   /dev/root 506880 19836 487044 4% /
   tmpfs 20480 1164 19316 6% /tmp

   [root@falinux /]$ mount
   rootfs on / type rootfs (rw)
   /dev/root on / type yaffs2 (rw)
   /proc on /proc type proc (rw)
   /sys on /sys type sysfs (rw)
   none on /dev/pts type devpts (rw,gid=5,mode=620,ptmxmode=000)
   usbfs on /proc/bus/usb type usbfs (rw)
   tmpfs on /tmp type tmpfs (rw,size=20480k)

 

 

3. yaffs 루트파일 시스템에서 부팅시 tmpfs를 마운트하는 방법

 

   에프에이리눅스에서 제공하는 램디스크는 /etc/fstab 파일을 사용하지 않습니다. 
   따라서 /etc/rc.d/rc.sysinit 에서 마운트를 해 주어야 합니다.

  

   [root@falinux /]$ vi /etc/rc.d/rc.sysinit

    26      # mount sysfs, devpts filesystem
    27      mount -n -t sysfs /sys /sys
    28      mount /dev/pts
    29 
    30      # moout tmpfs filesystem 20Mbyte
    31      mount -t tmpfs -o size=20M tmpfs /tmp

   [root@falinux /]$ reboot -f

   [root@falinux /]$ df
   Filesystem 1K-blocks Used Available Use% Mounted on
   /dev/root 506880 19836 487044 4% /
   tmpfs 20480 1164 19316 6% /tmp

 

반응형

'OS > LINUX Common' 카테고리의 다른 글

리눅스 LVM 생성  (0) 2015.08.20
Linux에서 ZFS 파일 시스템 구축.  (0) 2015.03.25
GNU tar의 특이성 , 체크섬 오류  (0) 2013.07.09
리눅스 vsftpd 설치 / 설정.  (0) 2011.10.14
리눅스 계정관리 ----LINUX  (0) 2011.08.21
반응형



우분투 설치 후 ssh 접속 시 10초 정도 지나야 패스워드를 묻는 현상을 해결하는 방법은

/etc/ssh/ssh_config 에서 GGSAPIAuthentication 을 주석처리 하는것.


하지만 이렇게 해도 실제 로그인 시 프롬프트가 늦게 뜬다.

이때는 etc/ssh/sshd_confg 에 UseDNS no 로 설정한 뒤


/etc/init.d/ssh restart를 해주면 해결.



반응형
반응형



1. /etc/hostname 에서 원하는 호스트 이름 변경


2. hostname -F /etc/hostname 으로 적용


3. reboot

반응형
반응형

출처 : http://uiandwe.tistory.com/908



13.04 버전은 기존의 버전들과 달리 계정 설정에 대한 파일의 위치가 변경되었습니다.


1. 먼저 root 계정을 활성화 시켜야 합니다.

$ sudo passwd root

현재 계정의 비번.

root 계정의 비번

root 계정 비번 확인



2. $ sudo vi /etc/lightdm/lightdm.conf/10-ubuntu.conf

한 다음 아래를 추가 시켜 줍니다.

greeter-session=unity-greeter

greeter-show-manual-login=true

autologin-user=root (이부분은 빼도 상관없습니다. 넣으시면 부팅시 자동으로 root 로 로그인 됩니다.)



3. $ reboot


리부팅을 한 다음 로그인 창이 나올때 계정명을 root 로 한다음 설정한 비번을 넣으면 root 로 로그인 가능합니다.


반응형
반응형

[출처] 윈도우 서버를 NTP서버로 활용하는 방법|작성자 중고엑박


외부망이 연결되어 있는 경우는 큰 문제가 없겠지만...

내부망에 있는 PC들의 시간을 동기화시키는 경우에는 문제가 있습니다.


그런 경우 하나의 PC를 NTP서버로 지정하고 다른 PC를 그 PC의 시간으로 동기화 시켜주는 방법이 있는데요.

윈도우에는 내부적으로 w32time이라는 서비스를 NTP서버로 활용을 할 수 있습니다.

구글링을 해보다 Windows Server 2008 R2이상에서 사용할 수 있는 방법을 찾아서, 정리해 놓습니다.


(대부분의 자료들은 그 전버전 용이라 제대로 안되더군요.)

1. 다음의 레지스트리를 수정

HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/W32Time/Config에서

AnnounceFlags값을 5로 수정

HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/W32Time/TimeProviders/NtpServer에서

Enabled값을 1로 수정

2. Windows Time Service 재시작(제어판 -> 관리도구 -> 서비스 가서 재시작해도 되고, 다음과 같은 명령어로 재시작 가능)

net stop w32time && net start w32time


출처 : http://web-dev.tistory.com/656

AIX에서 시간 동기화 하기

 

1. TZ 설정(직접 설정)
    AIX 6.1 이상
    > smitty chtz_user
    AIX 6.1 미만
    > smitty chtz

2. 세부 설정
   # smitty chtz_date (1번 항목의 내용도 포함됨)
   Change Time Zone Using User Inputted Values

   Standard Time ID(only alphabets) : KORST
   Standard Time Offset from CUT : -9

3. 리부팅
   # rebooting

4. 시간 동기화
   # setclock time.bora.net
    - or (IP를 직접 입력) -
   # setclock  203.248.240.140



출처 : http://totoroaix.tistory.com/3

---현재시간 확인 ----
 root@node2:[/]#>date
 Wed Nov  7 13:12:18 KORST 2007
 root@node2:[/]#>date 11070101           (임의의 시간으로 변경)
 Wed Nov  7 01:01:25 KORST 2007
 root@node2:[/]#>

<시간을 동기화 합니다. DNS가 설정되어 있지 않다면 IP를 넣으셔도 무방합니다>    
   (time.nuri.net의 IP 211.115.194.21)
  root@node2:[/]#>ntpdate -u 211.115.194.21  
  7 Nov 23:05:13 ntpdate[8573]: step time server 211.115.194.21 offset -531.701132 sec
  root@node2:[/]#>date
  Wed Nov  7 23:05:18 KORST 2007

----동기화 완료!----

*  NTP 프로토콜은 Default로 UDP port 123를 사용합니다.만약 방화벽등에 의하여 포트가 막힌 경우에 다음과 같은 Error가 발생하는데 이런 경우 -u Option을 이용함으로써 다른 포트를 이용하게 할수 있습니다

   no server suitable for synchronization found
   
 root@node2:[/]#>ntpdate -u 211.115.194.21


*기타 NTP서버 리스트
우리나라에서 쓸만한 NTP 서버입니다.
ntp.ewha .net
zero.bora.net
ntp1.epidc.co.kr
ntp2. epidc.co.kr 
58.73.137.250 (kr.pool.ntp.org)
210.118.170.59 (kr.pool.ntp.org)

Stratum 1 을 써야 한다면
일본 후쿠오카에 있는 서 버를 쓰는게 좋은듯합니다.
clock.tl.fukuoka- u.ac.jp (133.100.11.8)
clock.nc.fukuoka-u.ac.jp (133.100.9.2)

-서버 리스트는 http://cafe.naver.com/fastlane/9에서 발췌하였습니다.

반응형
반응형


갑자기 AIX 5.3 이 뻗었다.




errpt로 보니 

어느날 부터 갑자기 쌓이기 시작한 BA431EB7 ...


aix53:root@/] errpt

BA431EB7   0306172114 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306172014 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306171914 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306171814 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306171714 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306171714 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306171614 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306171514 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306171414 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306171314 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306171214 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306171114 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306171014 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306171014 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306170914 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306170814 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306170714 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306170614 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306170514 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306170414 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306170314 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306170314 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306170214 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306170114 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306170014 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306165914 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306165814 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306165714 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306165614 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306165614 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306165514 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306165414 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306165314 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306165214 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306165114 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306165014 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306165014 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306164914 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306164814 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306164714 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306164614 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306164514 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306164414 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306164314 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306164314 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306164214 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306164114 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306164014 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306163914 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306163814 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306163714 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306163614 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306163614 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306163514 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306163414 P S SRC            SOFTWARE PROGRAM ERROR

BA431EB7   0306163314 P S SRC            SOFTWARE PROGRAM ERROR

.

.

.


BA431E7 에러를 확인해보니 tracelogd 라는 모듈에서 발생.

---------------------------------------------------------------------------

LABEL:          SRC_RSTRT

IDENTIFIER:     BA431EB7


Date/Time:       Thu Mar  6 17:01:29 2014

Sequence Number: 2487335

Machine Id:      00C02F6A4C00

Node Id:         aix53

Class:           S

Type:            PERM

Resource Name:   SRC


Description

SOFTWARE PROGRAM ERROR


Probable Causes

APPLICATION PROGRAM


Failure Causes

SOFTWARE PROGRAM


        Recommended Actions

        VERIFY SUBSYSTEM RESTARTED AUTOMATICALLY


Detail Data

SYMPTOM CODE

       65024

SOFTWARE ERROR CODE

       -9035

ERROR CODE

           0

DETECTING MODULE

'srchevn.c'@line:'222'

FAILING MODULE

tracelogd

---------------------------------------------------------------------------




왜 그러는지는 아직 알수가 없다.


일단 추이를 지켜보고 정 안되면 해당 부분을 삭제하던지 아니면 정기적으로 errclear 0 을 하던지 해야할 듯..

혹시 해결 방안 아시는분 계시면 댓글 좀 ㅠㅠ




해당 모듈 삭제 관련 참고.

--------------------------------------------------------------------

BA431EB7 0000009 P S SRC SOFTWARE PROGRAM ERROR

Error:

BA431EB7 0000009 P S SRC SOFTWARE PROGRAM ERROR

Server1:root errpt -a -j BA431EB7 -s 0421030109 pg
---------------------------------------------------------------------------
LABEL: SRC_RSTRT
IDENTIFIER: BA431EB7
Date/Time:
Sequence Number: 917660
Machine Id:
Node Id:
Class: S
Type: PERM
Resource Name: SRC
Description
SOFTWARE PROGRAM ERROR
Probable Causes
APPLICATION PROGRAM
Failure Causes
SOFTWARE PROGRAM
Recommended Actions
VERIFY SUBSYSTEM RESTARTED AUTOMATICALLY
Detail Data
SYMPTOM CODE
589833
SOFTWARE ERROR CODE
-9035
ERROR CODE
0
DETECTING MODULE
'srchevn.c'@line:'217'
FAILING MODULE
tracelogd

Solution:

Need to uninstall the csm.hpsnm File Set.

Server1 /-->ps -ef grep tracelogd
root 7569408 2056434 0 00:54:49 - 0:00 /opt/csm/hpsnm/bin/tracelogd
root 7831764 7630990 0 00:55:33 pts/1 0:00 grep tracelogd


Server1 /-->lslpp -w /opt/csm/hpsnm/bin/tracelogd
File Fileset Type
----------------------------------------------------------------------------
/opt/csm/hpsnm/bin/tracelogd csm.hpsnm File


lslpp -l csm.hpsnm
Fileset Level State Description
----------------------------------------------------------------------------
Path: /usr/lib/objrepos
csm.hpsnm 1.4.1.12 COMMITTED IBM Switch Network Manager
Path: /etc/objrepos
csm.hpsnm 1.4.1.12 COMMITTED IBM Switch Network Manager

installp –u csm.hpsnm

Once we unistalled this Fileset. errpt stop generatting this error.








반응형
반응형

출처 : http://blog.naver.com/wonic?Redirect=Log&logNo=29195810



errclear 명령


목적

오류 로그에서 항목을 삭제합니다.


구문

errclear [ -d ErrorClassList ] [ -i File ] [ -J ErrorLabel [ ,Errorlabel ] ] | [ -K ErrorLabel [,Errorlabel ] ] [ -l SequenceNumber ] [ -m Machine ] [ -n Node ] [ -N ResourceNameList ] [-R ResourceTypeList ] [ -S ResourceClassList ] [ -T ErrorTypeList ] [ -y FileName ] [ -jErrorID [ ,ErrorID ] ] | [ -k ErrorID [ ,ErrorID ] ] Days


설명

errclear 명령은 Days 매개변수에서 지정한 일수보다 오래된 오류 로그 항목을 삭제합니다. 모든 오류 로그 항목을 삭제하려면, Days 매개변수에 0 값을 지정하십시오.


errclear 명령을 -i 플래그와 함께 사용하지 않으면, errclear는 오류 로그 구성설정 데이터베이스에서 지정한 오류 로그 파일을 지웁니다. (오류 로그 구성설정 데이터베이스내의 정보를 열람하려면,errdemon 명령을 사용하십시오)

주: errclear 명령은 지정된 항목은 삭제하나 오류 로그 파일의 크기를 줄이지는 않습니다.



웹 기반 시스템 관리자(wsm)에 있는 시스템 응용프로그램을 사용하여 시스템 특성을 변경할 수 있습니다. SMIT(시스템 관리 인터페이스 도구) smit errclear 단축 경로를 사용하여 이 명령을 실행할 수도 있습니다.


플래그

-d ListList 변수로 지정된 오류 클래스에 있는 오류 로그를 삭제합니다.List 변수 값을 ,(쉼표)로 분리하거나 " "(큰 인용 부호)로 묶어서 쉼표 또는 공백 문자로 분리할 수 있습니다. 유효한 List 변수 값은H(하드웨어), S(소프트웨어), O(errlogger 메시지) 및 U(판별되지 않음)입니다.
-iFileFile 변수에서 지정하는 오류 로그 파일을 사용합니다. 이 플래그를 지정하지 않으면, errclear 명령은 오류 로그 구성설정 데이터베이스로부터 값을 사용합니다.
-j ErrorID[,ErrorID]ErrorID(오류 ID) 변수에서 지정하는 오류 로그 항목을 삭제합니다.ErrorID 변수 값을 ,(쉼표)로 분리하거나 " "(큰 인용 부호)로 묶어서 쉼표나 공백 문자로 분리할 수 있습니다.
-JErrorLabelErrorLabel 변수에서 지정하는 오류 로그 항목을 삭제합니다.ErrorLabel 변수 값을 ,(쉼표)로 분리하거나, " " (큰 인용 부호)로 묶어서 쉼표 또는 공백 문자로 분리할 수 있습니다.
-k ErrorID[,ErrorID]ErrorID(오류 ID) 변수가 지정하는 오류 로그 항목 외에 모든 오류 로그 항목을 삭제합니다. ErrorID 변수 값을 ,(쉼표)로 분리하거나 " "(큰 인용 부호)로 묶어서 쉼표나 공백 문자로 분리할 수 있습니다.
-KErrorLabelErrorLabel 변수가 지정하는 오류 로그 항목 외에 모든 오류 로그 항목을 삭제합니다. ErrorLabel 변수 값을 ,(쉼표)로 분리하거나, " " (큰 인용 부호)로 묶어서 쉼표 또는 공백 문자로 분리할 수 있습니다.
-lSequenceNumber지정된 일련번호의 오류 로그 항목을 삭제합니다.SequenceNumber 변수 값을 ,(쉼표)로 분리하거나 " "(이중 인용부호)로 묶어서 쉼표 또는 공백 문자로 분리할 수 있습니다.
-m MachineMachine 변수가 지정하는 시스템에 대한 오류 로그 항목을 삭제합니다. uname -m 명령이 Machine 변수 값을 리턴합니다.
-n NodeNode 변수가 지정하는 노드에 대한 오류 로그 항목을 삭제합니다.uname -m 명령이 Node 변수 값을 리턴합니다.
-N ListList 변수로 지정된 자원 이름에 대한 오류 로그 항목을 삭제합니다.List 변수는 오류를 발견한 자원의 이름 리스트입니다. 소프트웨어 오류의 경우, 이들은 오류를 검출한 자원의 이름입니다. 하드웨어 오류의 경우, 이들은 장치나 시스템 구성요소의 이름입니다. 이는 부품에 장애가 있거나 교체가 필요함을 의미하지는 않습니다. 대신 오류를 분석하는데 사용될 적당한 진단 모듈을 판별하는 데 사용됩니다. List 변수 값을 ,(쉼표)로 분리하거나 " "(큰 인용 부호)로 묶어서 쉼표 또는 공백 문자로 분리할 수 있습니다.
-R ListList 변수로 지정된 자원 유형에 대한 오류 로그 항목을 삭제합니다. 하드웨어 오류의 경우, List 변수는 장치 유형입니다. 소프트웨어 오류의 경우, List 변수의 값은 LPP입니다. List 변수 값을 ,(쉼표)로 분리하거나 " "(큰 인용 부호)로 묶어서 쉼표 또는 공백 문자로 분리할 수 있습니다.
-S ListList 변수로 지정된 자원 클래스에 대한 오류 로그 항목을 삭제합니다. 하드웨어 오류의 경우, List 변수는 장치 클래스입니다. List 변수 값을 ,(쉼표)로 분리하거나 " "(큰 인용 부호)로 묶어서 쉼표 또는 공백 문자로 분리할 수 있습니다.
-T ListList 변수가 지정하는 오류 유형에 대한 오류 로그 항목을 삭제합니다. 유효한 List 변수 값은 다음과 같습니다. PERMTEMP,PERF, PENDINFO 및 UNKNList 변수 값을 ,(쉼표)로 분리하거나 " "(큰 인용 부호)로 묶어서 쉼표 또는 공백 문자로 분리할 수 있습니다.
-yFileNameFileName 변수가 지정하는 오류 레코드 템플리트 파일을 사용합니다.


보안

액세스 제어: 루트 사용자만 이 명령을 실행할 수 있습니다.


예제

  1. 오류 로그에서 전체 항목을 삭제하려면 다음을 입력하십시오.

    errclear 0
  2. 오류 로그에서 소프트웨어 오류로 분류된 모든 항목을 삭제하려면 다음을 입력하십시오.

    errclear -d S 0
  3. 대체 오류 로그 파일 /var/adm/ras/errlog.alternate에서 모든 항목을 제거하려면 다음을 입력하십시오.

    errclear -i /var/adm/ras/errlog.alternate 0
  4. 대체 오류 로그 파일 /var/adm/ras/errlog.alternate에서 모든 하드웨어 항목을 제거하려면 다음을 입력하십시오.

    errclear -i /var/adm/ras/errlog.alternate -d H 0


파일

/etc/objrepos/SWservAt소프트웨어 서비스 지원 속성 오브젝트 계층, 즉 오류 로그 구성설정 데이터베이스를 포함합니다.


반응형

+ Recent posts