X-Window를 실행하면 기본 한글 입력이 불가합니다.

Linux 특성상 여러 종류에 한글 입력기(IME 종류 : nabi, fcitx, uim, nimf, ibus)가 존재합니다.

우리는 CentOS(RedHat)에서 기본으로 제공하는 ibus를 설치하여 운용하는걸로 하겠습니다.

 

 

** IBUS 패키지 설치(설치는 root 계정으로)

# yum install ibus* ibus-*

 

** 한글 입력 필요한 계정에 ibus 설정하기(필요한 계정마다 설정 필요)

$ ibus-setup




 

    ① 영어 - 영어(미국) ② 제거(R) 하고 ③ 추가(A) 버튼을 클릭하여 한글을 추가한다. 

   


 

   위에서 추가(A)를 클릭하면 나라별 문자 입력기를 추가할 수 있다. ①을 클릭하면 새로운 창에서 ② 한국어를 선택하고 ③ 추가(A)를 클릭하여 저장한다.

   


 

    한국어 - Hangul이 추가되었는지 확인하고 선택한다. 선택한뒤 기본 설정(P) 버튼을 클릭하여 환경설정으로 진입한다.

   


 

   한글 설정부분 창에서 화면에 내용만 남기고 모두 제거한뒤 확인 버튼을 클릭하여 저장한다.(확인 및 닫기를 모든 화면을 닫는다.)

   



 

 

** ibus 기본 환경 설정(root 권한)

# vi /etc/bashrc

    export GTK_TM_MODULE=ibus
    export QT_TM_MODULE=ibus
    export XMODIFIERS=@im=ibus
    
    if test `ps axo user:20,pid,tty,cmd | grep -v grep | grep "/usr/libexec/ibus-dconf" 2> /dev/null | grep $USER | grep "pts/" | wc -l` -eq 0;
    then
        ibus-daemon --xim &
    fi

 

** ibus 입력기 테스트
  - 해당 서버에 접속했던 모든 콘솔은 Client 툴은 접속을 종료하고 다시 접속한다.(또는 $ source /etc/bashrc)
  - MobaXterm 툴을 사용하여 또는 X-Window를 실행할 수 있는 환경(Xming, VcXsrv, XManager)으로 접속을 한다.
  - 일반계정(nextguide)으로  firefox 실행

$ firefox

파이어폭스가 X-Window환경 내에서 본인 PC에 실행되면 URL 입력란에 Shift + Space 키로 한글/영문 변환해서 입력이 가능한지 확인해 본다.









** 그냥 편하게 스크립트로 모든 계정의 적용하기

yum install ibus* ibus-*
# vi /etc/bashrc  (아래에 추가)

export GTK_TM_MODULE=ibus

export QT_TM_MODULE=ibus

export XMODIFIERS=@im=ibus

if test `ps axo user:20,pid,tty,cmd | grep -v grep | grep "/usr/libexec/ibus-dconf" 2> /dev/null | grep $USER | grep "pts/" | wc -l` -eq 0; 

then

    ibus-daemon --xim &

fi



# mkdir -p /etc/dconf/profile
#
cat <<EOF > /etc/dconf/profile/user

user-db:user

system-db:local

EOF


# mkdir -p /etc/dconf/db/local.d
# cat <<EOF > /etc/dconf/db/local.d/00-ibus-input

[desktop/ibus/general]

preload-engines=['hangul']

EOF

# dconf update




   

블로그 이미지

유효하지않음

,


** 큐브리드 다운로드
http://www.cubrid.com/downloads

** 큐브리드 JDBC 다운로드
https://www.cubrid.org/downloads/os-select/64-bit/drivers/jdbc

    driverClassName="cubrid.jdbc.driver.CUBRIDDriver"
    URL="jdbc:CUBRID:192.168.0.xxx:33000:
dbname:public::?charSet=utf-8"


** 매뉴얼
    한글 : https://www.cubrid.org/manual/ko/9.3.0/
    최신버전(영문) : https://www.cubrid.org/manual/en/10.0

 

 

** 큐브리드 설치
# yum install glibc ncurses libgcrypt libstdc++
# useradd -g dba -G dba cubrid
# su - cubrid
$ sh CUBRID-10.1-latest-Linux.x86_64.sh

    라이선스 및 모든 내용에 대해 Y 입력



** 서비스 실행환경 구성
$ vi .bashrc
    . .cubrid.sh

$ . .bashrc


** 서비스 실행
$ cubrid service start

    @ cubrid master start
    ++ cubrid master start: success
    @ cubrid broker start
    ++ cubrid broker start: success
    @ cubrid manager server start
    ++ cubrid manager server start: success

 


** 서비스 종료
$ cubrid service stop

    @ cubrid broker stop
    ++ cubrid broker stop: success
    @ cubrid manager server stop
    ++ cubrid manager server stop: success
    @ cubrid master stop
    ++ cubrid master stop: success



** 서비스 상태 확인
$ cubrid service status

    @ cubrid master status
    ++ cubrid master is running.
    @ cubrid server status
    @ cubrid broker status
    NAME PID PORT AS JQ TPS QPS SELECT INSERT UPDATE DELETE OTHERS LONG-T LONG-Q ERR-Q UNIQUE-ERR-Q #CONNECT #REJECT
    ==============================================================================================================================================================
    * query_editor 15397 30000 5 0 0 0 0 0 0 0 0 0/60.0 0/60.0 0 0 0 0
    * broker1 15408 33000 5 0 0 0 0 0 0 0 0 0/60.0 0/60.0 0 0 0 0
    @ cubrid manager server status
    ++ cubrid manager server is running.

 

** 데이터베이스 생성
$ cubrid createdb --db-volume-size=250M 
dbname ko_KR.utf8

    Creating database with 256.0M size using locale ko_KR.utf8. The total amount of disk space needed is 1.2G.

    CUBRID 10.1

 

** 생성한 데이터베이스 서비스 시작
$ cubrid server start dbname

    @ cubrid server start: dbname

    This may take a long time depending on the amount of recovery works to do.

    CUBRID 10.1

    ++ cubrid server start: success

 


** 생성한 데이터베이스 서비스 종료
$ cubrid server stop dbname

    @ cubrid server stop: dbname

    Server dbname notified of shutdown.
    This may take several minutes. Please wait.
    ++ cubrid server stop: success

 

** 생성한 데이터베이스 서비스 자동시작 처리
$ vi $CUBRID/conf/cubrid.conf

    [service]
    service=server,broker,manager
    server=dbname

 

** 커맨드라인 접속
$ csql 
dbname

    CUBRID SQL Interpreter

    Type `;help' for help messages.

csql> ;exit

 


** 계정 생성(DBA 권한으로 접속)
$ csql --CS-mode
dbname --user=dba
csql> CREATE USER username PASSWORD 'userpasswd';
csql> ;exit

 

** 생성한 User로 접속 확인 및 테이블 생성
$ csql -u
username -p userpasswd dbname
csql> CREATE TABLE test(t1 VARCHAR(10));

    Execute OK. (0.013104 sec) Committed.

    1 command(s) successfully processed.

 

** SQL 스크리트 파일 적용
csql> ;read cubrid_script.sql
csql> ;run

 

** 테이블 목록 확인
csql> show tables;


** 컬럼 목록 확인
csql> SELECT class_name as "table_name", attr_name as "column_name", prec "column_size", data_type, is_nullable as "nullable", default_value FROM DB_ATTRIBUTE WHERE class_name = 'table_name';

블로그 이미지

유효하지않음

,



※ClamAV 특장점

  • ClamAV(Clam AntiVirus)는 네트워크 장비로 유명한 시스코 시스템즈에서 지원하는 오픈소스 소프트웨어로 자유 크로스플랫폼
    형식의 바이러스 검사 소프트웨어 
툴킷이다.

  • 바이러스를 비롯한 수많은 종류의 악성 소프트웨어를 찾아낼 수 있다.

  • 주된 목적 가운데 하나는 서버 측면의 전자 메일 바이러스 검사기의 역할을 하면서 메일 서버에 이용

  • 닉스 아니라AIX, BSD, HP-UX, 리눅스, OS X, 오픈VMS, OSF, 솔라리스 같은 서드파티 버전용으로 개발됨

  • 0.96 버전부터 ClamAV는 마이크로소프트 윈도에서 빌드한 다음 실행할 수 있음

  • ClamAV와 소프트웨어 업데이트는 비용을 내지 않고도 이용할 수 있다.

  • 클램AV(ClamAV.net)의 데이터 센터는 전 세계에서 발생하는 바이러스 구조에 대한  방대한 자료를 확보

  • 확보한 방대한 자료를 주기적으로 업데이트 및 공개

  • 데이터베이스는 클램AV 엔진의 핵심으로 유닉스계열에 사용됨

  • 공개자료로서는 사실상 표준처럼 사용됨

  • 메일 게이트웨이 검색 소프트웨어의 오픈 소스 표준

  • 멀티 스레드 스캐너 데몬주문형 파일 검사 및 자동 서명 업데이트를 위한 명령 줄 유틸리티가 포함

  • 여러 파일 형식파일 및 아카이브 압축 풀기 및 여러 서명 언어를 지원

  • 트로이 목마바이러스악성 프로그램 및 기타 악의적 인 위협을 탐지하는 오픈소스  바이러스 백신 엔진

  • 바이러스 서명을 정기적으로 업데이트하는 유틸리티를 제공

 

 

※ ClamAV 설치

** ClamAV 설치를 위한 SELinux 비활성화 처리
# vi /etc/selinux/config
  SELINUX=disabled


** ClamAV 설치를 위한 yum 레파지토리 설치
# yum -y install epel-release


** ClamAV 패키지 설치
# yum install clamav-server clamav-data clamav-update clamav-filesystem clamav clamav-scanner-systemd clamav-devel clamav-lib clamav-server-systemd


** ClamAV 환경파일 복사 및 수정처리
# cp /usr/share/clamav/template/clamd.conf /etc/clamd.d/clamd.conf
# sed -i -e "s/^Example/#Example/" /etc/clamd.d/clamd.conf
# sed -i -e "s/^Example/#Example/" /etc/clamd.d/scan.conf
# sed -i -e "s/^Example/#Example/" /etc/freshclam.conf

# vi /etc/clamd.d/scan.conf (# 주석제거)
  LocalSocket /var/run/clamd.scan/clamd.sock


** ClamAV 데이터베이스 업데이트
# freshclam


** ClamAV 데이터베이스 데몬작업(자동 업데이트)
# vi /usr/lib/systemd/system/clam-freshclam.service
  [Unit]
  Description = freshclam scanner
  After = network.target

  [Service]
  Type = forking
  ExecStart = /usr/bin/freshclam -d -c 4
  Restart = on-failure
  PrivateTmp = true
  RestartSec = 20sec

  [Install]
  WantedBy=multi-user.target

 

** ClamAV 서비스 활성화
# systemctl enable clam-freshclam
# systemctl enable clamd@scan

** ClamAV 서비스 실행
# systemctl start clam-freshclam
# systemctl start clamd@scan

** ClamAV 서비스 확인
# systemctl status clam-freshclam
# systemctl status clamd@scan

** ClamAV 바이러스 스캔 확인
# clamscan -r /home/nextguide

  ----------- SCAN SUMMARY -----------
  Known viruses: 6349098
  Engine version: 0.101.4
  Scanned directories: 100
  Scanned files: 66
  Infected files: 0
  Data scanned: 85.75 MB
  Data read: 92.75 MB (ratio 0.92:1)
  Time: 72.517 sec (1 m 12 s)


** ClamAV 검사 스크립트 생성 및 주기적 처리(1회/일)
# vi /usr/local/bin/clamscan.sh

  #!/bin/sh

  SDATE=$(date "+%Y-%m-%d %H:%M:%S")
  echo $'\n\nStart Date :' $SDATE >> /var/log/clamscan.log
  clamscan -ri / >> /var/log/clamscan.log

# chmod 755 /usr/local/bin/clamscan.sh

# crontab -e
  00 04 * * * /usr/local/bin/clamscan.sh

블로그 이미지

유효하지않음

,

** 상위 디렉토리 접근 및 shell 접속 불가등

   

** 디렉토리는 운영서버 환경에 맞도록 수정한다.

# mkdir /data
# groupadd sftp
# useradd -g sftp -G sftp -d /data/nextbsc -s /bin/false nextbsc
# echo "nextbsc" | passwd --stdin nextbsc
# chown -R nextbsc.sftp /data/nextbsc
# chown root /data/nextbsc
# chmod 755 /data/nextbsc
# mkdir /data/nextbsc/upload
# chown nextbsc.sftp /data/nextbsc/upload

# vi /etc/ssh/sshd_config(# 주석처리)
  #Subsystem sftp /usr/libexec/openssh/sftp-server 
  Subsystem sftp internal-sftp -l VERBOSE
 
  # Example of overriding settings on a per-user basis
  Match Group sftp
      ChrootDirectory /data/%u
      X11Forwarding no
      AllowTcpForwarding no
      #PermitTTY no
      #ForceCommand cvs server
      ForceCommand internal-sftp -l VERBOSE


# systemctl restart sshd
 

** 테스트 방법
  1. SSH 접속 확인
  2. SFTP 접속 확인(change directory 여부 점검등)

블로그 이미지

유효하지않음

,

** 리눅스 본딩(Bonding)이란

   여러개의 NIC(랜카드)를 논리적으로 묶어서 한 개의 NIC의 개수만큼 대역폭을 확장하는 기술

   Fault Tolerance(결함 감내)와 같은 기능을 하며 2개의 NIC를 한 개의 NIC로 묶어서 Active와 Stand By로 

   구성하기도 한다.

 

 

 

** O/S 별 설명

    - HP-UX    : APA

    - SUN      : SunTrunking(IPMP)

    - IBM      : EtherChannel

    - Cisco    : EtherChannel

    - Windows  : Teaming

    - Linux    : Bonding(RedHat(CentOS) 7버전 이상은 Teaming이 별도로 추가됨)

    - 표준용어  : Link Aggregation

 

 

 

**Bonding mode 설명

 

0 : Balance-round robine 정책 : 2개의 NIC를 통한 분배

   첫 번째 가능한 슬레이브부터 마지막까지 순차적으로 전송하며

   이 모드는 부하분산과 장애 감내를 제공합니다.

 

1 : Active-standby 정책 : Active상태의 NIC에 문제 발생시 Fault Tolerance 

    bond에서 하나의 슬레이브만 활성화되며 다른 슬레이브는 활성화된 슬레이브가

    fail 된 경우에만 활성화 됩니다.

 

2 : Balance-XOR 정책 : 0과 비슷하지만 xor연산을 이용한 목적지 Mac과 근원지 Mac을 이용한 분배

    [(출발지 MAC 주소와 도착지 MAC 주소의 XOR) modula 슬레이브 1개]에 기초하여 전송합니다.

    이것은 도착지 MAC 주소에 대해서 동일한 슬레이브를 선택하게 된다. 이 모드는 부하분산과 장애감지를 제공합니다.

  

3 : Broadcast 정책 : 2개의 NIC에 어떤 규칙 없이 데이터 통신 모든 슬레이브 인터페이스에 모든 것을 전송합니다.

 

4 : 802.3ad (link aggregation) - switch에 aggregation 그룹생성이 필요함.

    IEEE 802.3ad dynamic link aggregation정책을 설정하며

    전송과 받는 것은 active aggregator 안에서 모든 slaves 위에서 됩니다.

 

5 : transmit load 밸런스로써 보내는 패킷만 밸런스 합니다.

    outgoing traffic은 각 slave 인터페이스에 현재의 부하에 따라서 분배됩니다.

    incoming traffic는 현재의 slave로 받음. 

 

6 : receive와 transmit패킷을 밸런스 하며 이때 5,6 은 하나의 스위치에 있을때만 동작합니다.

 

    이 mode는 load balancing를 더하여 balance-tlb를 포함 합니다.

 

 

 

 

 

/*--------------------------------------------------*/

/* 본딩 설정(운영서버 적용시 붉은색 수정필요)               */

/*--------------------------------------------------*/

 

 

# cd /etc/sysconfig/network-scripts/

# vi ifcfg-bond0

 

    DEVICE="bond0"

    TYPE="Bond"

    NAME="bond0"

    ONBOOT="yes"

    BOOTPROTO="none"

    IPADDR="192.168.0.190"

    NETMASK="255.255.255.0"

    GATEWAY="192.168.0.1"

    DNS1="8.8.8.8"

    DNS2="168.126.63.1"

    BONDING_MASTER="yes"

    BONDING_OPTS="mode=1 miimon=100 fail_over_mac=1 primary=eno1"

 

 

** 가상화(VirtualBox, vmware등) 서버에서 작업 및 테스트시는 fail_over_mac=1 primary=eno1 옵션이 추가되어야
본딩 운영이 가능하다.

 

 

 

* 내용 추가 및 수정(IPADDR, NETMASK, GATEWAY, DNS1, DNS2 삭제 또는 주석처리)

 

# vi ifcfg-eno1

 

    MASTER="bond0"

    SLAVE="yes"

    DEFROUTE="no"

 

 

 

# vi ifcfg-eno2

 

    MASTER="bond0"

    SLAVE="yes"

    DEFROUTE="no"

 

 

 

# systemctl restart NetworkManager

 

# systemctl restart network

 

# nmcli d (or nmcli c) 

 

  bond0 활성화 여부 확인

 

 

 

 

 

** 본딩 테스트

콘솔 화면을 3개를 접속하거나 연다.

콘솔 1번은 gateway에 ping을 날린다.


# ping 192.168.0.1

 

 

 

콘솔 2번은 bonding 상태를 확인한다.

# watch -d -n 1 "cat /proc/net/bonding/bond0"

 

 

 

 

 

콘솔 3번은 Active된 NIC를 임의로 다운시켜 콘솔 2번, 1번 화면을 확인한다.(또는 랜선을 제거해 본다)

 

 

# ifdown eno1

 

 

 

* 본딩 환경설정 파일

ifcfg-bond0
다운로드
ifcfg-enp0s3
다운로드
ifcfg-enp0s8
다운로드

 

 

 

 

/*--------------------------------------------------*/

/* Teaming 설정(운영서버 적용시 붉은색 수정필요)          */

/* Redhat/CentOS 7.x 이상 버전                        */

/*--------------------------------------------------*/

 

** 기존 NIC 접속 종료
# nmcli con mod enp0s3 connection.autoconnect no
# nmcli con mod enp0s8 connection.autoconnect no

** 티밍 추가 (nmcli 명령어 가각 한줄로 실행)
# nmcli con add con-name team0 type team ifname team0 config 

  '{

    "runner":{"name":"activebackup","hwaddr_policy":"by_active"},

    "link_wath":{"name":"ethtool","delay_up":2500,"delay_down":1000},

     "ports":{"enp0s3":{"prio":-10,"sticky":true},"enp0s8":{"prio":100}}

  }'

 

# nmcli con add con-name team0-port1 type team-slave ifname enp0s3 master team0
# nmcli con add con-name team0-port2 type team-slave ifname enp0s8 master team0
# nmcli con mod team0 ipv4.addresses 192.168.0.186/24
# nmcli con mod team0 ipv4.gateway 192.168.0.1
# nmcli con mod team0 ipv4.dns "8.8.8.8 168.126.63.1"
# nmcli con mod team0 ipv4.method manual
# nmcli con down team0 && nmcli con up team0

본딩 설정과 마찬가지로 티밍 구성시 강상화서버 추가 옵션 "hwaddr_policy":"by_active" 적용해야 정상 적으로 운영(테스트)이 가능하다.

 


** 티밍 상태 확인
teamdctl team0 state

** 티밍 포트 상태 확인
teamnl team0 ports

** 티밍 액티브 포트 상태 확인
teamnl team0 getoption activeport

** NIC 다운
nmcli dev dis enp0s3

** NIC 업
nmcli dev con enp0s3

 

 

* 티밍 환경설정 파일

ifcfg-team0
0.00MB
ifcfg-team0-port1
0.00MB
ifcfg-team0-port2
0.00MB

블로그 이미지

유효하지않음

,

**Vbox에 Xpenology_5.0-4458 설치


1. 준비물

  - gnoboot-alpha10.5.7z                          http://www.gnoboot.me/

  - winima90.zip                                       : http://www.winimage.com/

  - SynologyAssistantSetup-5.0-4448.exe    : http://www.synology.com/ko-kr/support/download/DS3612xs

  - DSM_DS3612xs_4458.pat                     : http://ukdl.synology.com/download/DSM/5.0/4458/


해당 링크에 관련 파일을 직접 다운로드 하거나 

https://drive.google.com/file/d/0B1YEQASgCZq8ZXQ1UE41MnNta28/edit?usp=sharing   

이 파일을 직접 다운받아 작업하면 된다.


  

gnoboot-alpha10.5.7z(압축해제 비밀번호 : 6n0boot-AlpHaTen.5) , winima90.zip 적당한 곳에 압출을 푼다.

   winimage를 실행하고 gnoboot-alpha10.5-vfat.img 파일을 읽어 드린다.


* 그냥 OK 클릭해주시고


* gnoboot-alpha10.5-vfat.img 내에 menu_alpha.lst 파일을 적당한 곳에 압축을 푼다.



menu_alpha.lst 파일을 에디터로 연후 7번째 라인에 sn=8CKIN00001 추가해준다. 8CKINxxxxx -> xxxxx는 모두 숫자만


menu_alpha.lst 수정한 파일을 드래그해서 다시 덮어쓰기하고 저장한다.




*Vbox를 실해하여 64bit 가상 머신 만들기를 시작한다.

* 중요(CMOS 설정) : 32bit 머신만 선택될 경우

   - CMOS Bios설정 부분에 Intel CPU 의 경우 VT-x, AMD CPU 의 경우 AMD-v 활성화 해야함

   - Vbox와 Windows 8.x에 Hyper-V 동시사용 불가함(Execute Disable Bit : 활성/비활성 문제)



*메모리는 512M이상으로 설정해 주시고


* 가상머신 만들기를 시작한다.





* 용량은 최소 8GB 이상으로 설정해줘야함.

* 중요 : 테스트 한다고 4GB로 설정했다가 완전 삽질했네..  pat 파일 설치시 아래 메세지를 볼수 있음...


무선 네트워크 연결을 통해 설치를 수행하고 있다면, DiskStation과 PC 클라이언트를 모두 이더넷 케이블 연결로 전환하고 

다시 시도하십시오.

설치 도중 오류가 발생했습니다. 오류 결정을 위해 DiskStation의 Telnet 서비스가 켜져 있습니다. 

포트 23을 DiskStation으로 전달할 수 있도록 라우터를 구성한 후, Synology 온라인 지원 부서로 문의 하십시오.



* 여기까지만 진행해 주시고 잠시..



* cmd 를 실행한 후 vbox 설치 폴더에서 vboxmanage로 이미지 변경 작업을 해준다.

* 생성된 xpenology_vbox.vdi 파일을 xpenology_vbox_bak.vdi 으로 복사함(추후 사용될 목적으로)



* 부팅이 가능하도록 생성된 이미지를 선택한다.



* 선택한 부팅용 이미지를 하다 디스크 속성을 IDE 프라이머리 마스터로 선택해 준다. 선택이 되지 않으면 Xpenology_5.0-4458.vdi

를 변경후 선택하면 됨.



* 네트워크 어댑터 브리지 어댑터로 선택함. 맥 주소도 확인해 주시고(틀릴수도 있으니 메모장에 복사만 해 놓자)



* 이제 시작버튼을 클릭하여 부팅시작



* 초기 인스톨시는 gnoboot.me 선택하고 엔터



* 해당 버전을 선택해주시고 엔터



* DiskStation login 확인되면 부팅완료

* URL 메모장 기록(DSM 설치시 필요)



* DSM 설치 방법은 2가지가 있다. Synology Assistant로 설치하는 방법하나.

  브라우저에서 Web Assistant 설치하는 방법 하나

* 둘중 한가지 방법으로만 설치한다.


Synology Assistant 인스톨 하면 바탕화면에서 Synology Assistant 아이콘을 클릭한다.

* 올라온 DiskStation을 확인할 수 있으며 마우스 오른쪽 클릭하여 install을 진행한다.



* 4458버전의 DSM파이을 선택해준다.



* 버전이 맞는지 다시한번 확인해 주고..


* 관리자 비밀번호와 서버명을 기록한다. 

* SSH/Telnet 접속시 기록한 비밀번호는 동일하게 구성된다.


* IP 설정해 주시고


* 인스톨진행......


* 완료...



* 브라우저에서 Web Assistant 설치하는 방법

 (Synology Assistant 통해 설치 진행 했으면 이부분은 건너뛰고 재 부팅화면으로 넘어간다.)

* 기록했던 URL로 접속을 하면 인스톨 화면을 볼 수 있다.


* DSM 파일 선택


* 해당버전을 선택한다.



* 비밀번호와 서버이름 입력

* SSH/Telnet 접속시 기록한 비밀번호는 동일하게 구성됨.




* 재부팅 화면

* Synology Assistant 또는 Web Assistant 설치후 Vbox실행창을 보면 Error 22가 나올수도 있다 내 경우엔 없었지만..

이런 에러 메세지가 나오면 추가로 복사 했던 xpenology_vbox_bak.vdi 파일 xpenology_vbox.vdi로 다시 덮어쓰고

다시 부팅을 시작한다.



* 이제는 설치가 완료 되었으니 첫번째 메뉴인 gnoboot-alpha를 선택하여 부팅


* 두번째 메뉴도 gnoboot-alpha를 선택 ...


* 설치 완료후 부팅되는 모습...


* 부팅이 완료되면 Web Assistant의 설치화면이 환영합니다로 변경됨.

* Synology Assistant 설치했으면 브라우서에 해당 IP와 PORT 기록하여 접속


* 귀찮아서 그냥 건너뜀...


* 선택해주고 이동함.



* 선택해주고 확인..


* 필요한 App설치 

* Download Station, Audio Station, Photo Station, Video Station, Surveillance Station, Plex Media Server 등...



* 설치된 App 확인


* 설치된 App 확인



* File Station에서 넥트워 드라이브 마운트 화면


* WebDAV 활성화


* SSH 서비스 활성화


* Web Station 활성화


* 계정 추가


* 추가될 계정의 정보 등록


* 추가될 계정의 그룹정보 연결


* 추가될 계정의 공유 디렉토리 권한설정


* 추가될 계정의 사용량 활성화


* 추가될 계정의 App 허용정보 등록


* 추가될 계정의 속도제한 등록


* 추가된 계정의 정보확인



* 응용 프로그램 포털에 해당 App 접속 포트 등록





* File Station 접속화면



* 윈도우 탐색기에서 네트워크 드라이브 연결



* DS관련 안드로이드 App

* DS File을 App으로 접속한 화면

* 안드로이드 탐색기 App인 X-plore에서 WebDAV로 접속한 화면


* DS video App으로 스트리밍 동영상 감상

* Plex App 유료네...




IP WebCam도 연결 가능하고 다른 App들도 많고 좋네... PC에 리눅스 설치해서 삽질 할 필요가 없어서 편함..


블로그 이미지

유효하지않음

,

라즈베리 파이에 카메라 모듈+문자인식 관련 설치 목적으로 한번 컴파일 해봄

아~ 정말... 내 일도 아닌데 간만에 삽질했네.. 시간되면 정리하고 우선 여기까지만....


Ubuntu-12.04.4-desktop-amd64로 작업함


** 관련 패키지 설치

$ sudo apt-get install build-essential

$ sudo apt-get install cmake

$ sudo apt-get install git

$ sudo apt-get install g++-arm-linux-gnueabi

$ sudo apt-get install gcc-arm-linux-gnueabi

$ sudo apt-get install g++-arm-linux-gnueabihf

$ sudo apt-get install gcc-arm-linux-gnueabihf

$ sudo apt-get install cmake-curses-gui

$ sudo apt-get install libpng12-dev

$ sudo apt-get install libjpeg62-dev 

$ sudo apt-get install libtiff4-dev

$ sudo apt-get install zlib1g-dev

$ sudo apt-get install autoconf automake libtool autotools-dev




** 혹씨모를 컴파일시 오류발생 방지를 위해 계정의 .bashrc 에 추가함
export LD_LIBRARY_PATH="/usr/local/lib:/usr/local/arm/opencv/lib:/usr/local/arm/leptonica/lib:/usr/local/arm/tesseract-ocr/lib:$LD_LIBRARY_PATH"



** 패키지 다운로드 디렉토리 생성(계정의 홈디렉토리에서 생성함)

$ pwd

/home/계정명


$ mkdir down

$ cd down




** opencv 소스 다운로드

wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip

$ unzip opencv-2.4.9.zip


** ARM gcc 컴파일 버전 확인(주버전.부버전만 확인한다 4.8)

$ arm-linux-gnueabihf-gcc --version

arm-linux-gnueabihf-gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

Copyright (C) 2011 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


arm-linux-gnueabihf-gcc (Ubuntu/Linaro 4.8.2-16ubuntu4) 4.8.2

Copyright (C) 2013 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.





** opencv 컴파일 버전 변경

$ pwd

/home/계정명/down


$ vi opencv-2.4.9/platforms/linux/arm-gnueabi.toolchain.cmake

5라인 정도에...

set(GCC_COMPILER_VERSION "4.6" CACHE STRING "GCC Compiler version")

--> set(GCC_COMPILER_VERSION "4.8" CACHE STRING "GCC Compiler version")




** opencv 빌드 디렉토리 생성

$ cd

$ cd down

$ mkdir build

$ cd build

$ pwd

/home/계정명/down/build




** opencv 컴파일 옵션 설정

$ rm -rf CMakeCache.txt

$ cmake \

    -DCMAKE_INSTALL_PREFIX=/usr/local/arm/opencv \

    -DWITH_FFMPEG=ON \

    -DWITH_JASPER=ON \

    -DWITH_JPEG=ON \

    -DWITH_PNG=ON \

    -DWITH_TIFF=ON \

    -DWITH_VFW=ON \

    -DWITH_WEBP=ON \

    -DWITH_TBB=ON \

    -DWITH_V4L=ON \

    -DWITH_OPENEXR=ON \

    -DWITH_OPENGL=ON \

    -DBUILD_JASPER=ON \

    -DBUILD_JPEG=ON \

    -DBUILD_PNG=ON \

    -DBUILD_OPENEXR=ON \

    -DBUILD_PACKAGE=ON \

    -DBUILD_TIFF=ON \

    -DBUILD_WITH_DEBUG_INFO=ON \

    -DBUILD_WITH_STATIC_CRT=ON \

    -DBUILD_ZLIB=ON \

    -DBUILD_EXAMPLES=ON \

    -DBUILD_NEW_PYTHON_SUPPORT=ON \

    -DINSTALL_PYTHON_EXAMPLES=ON \

    -DINSTALL_C_EXAMPLES=ON \

    -DSOFTFT=ON \

    -DUSE_NEON=ON \

    -DCMAKE_TOOLCHAIN_FILE=../opencv-2.4.9/platforms/linux/arm-gnueabi.toolchain.cmake \

    ../opencv-2.4.9



** opencv 컴파일 수행, 설치

$ make

$ sudo make install




** opencv cross 컴파일된 오브젝트 버전확인(32bit ARM, 확인해 보니 git로 받은 opencv는 3.0 인가보네...)

cd /usr/local/arm/opencv/lib

file libopencv_videostab.so.2.4.9 

libopencv_videostab.so.2.4.9: ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=8be58a40b52473a2002b969a369fabf1b4aeba8d, not stripped



** 문자인식 관련 패키지  디렉토리 생성(계정의 홈디렉토리에서 생성함)

$ cd

$ cd down

$ mkdir ocr

$ cd ocr

$ pwd

/home/계정명/down/ocr




** 문자인식 관련 패키지 다운로드

$ wget http://www.leptonica.org/source/leptonica-1.70.tar.gz

$ wget https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.02.tar.gz

$ wget https://tesseract-ocr.googlecode.com/files/tesseract-ocr-3.02.kor.tar.gz




** 문자인식 관련 패키지 압축풀기

$ tar xvf tesseract-ocr-3.02.02.tar.gz

$ tar xvf tesseract-ocr-3.02.kor.tar.gz

$ tar xvf leptonica-1.70.tar.gz




** leptonica 패키지 이동

$ cd leptonica-1.70

$ pwd

/home/계정명/down/ocr/leptonica-1.70




** leptonica 컴파일 옵션 정의

CC="arm-linux-gnueabihf-gcc" CXX="arm-linux-gnueabihf-g++" \

./configure \

    --prefix=/usr/local/arm/leptonica \

    --target=arm-linux \

    --host=arm-linux




** leptonica 컴파일 수행, 설치

$ make

$ sudo make install




** leptonica cross 컴파일된 오브젝트 버전확인(32bit ARM)

cd /usr/local/arm/leptonica/lib

file liblept.so.4.0.1

liblept.so.4.0.1: ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=358f8173e43fa39cabe5331a71b7ec3dc7c8a812, not stripped




** tesseract 패키지 이동

$ cd

$ cd down/ocr/tesseract-ocr/

$ pwd

/home/계정명/down/ocr/tesseract-ocr




** tesseract 컴파일 옵션 정의

$ ./autogen.sh


LIBLEPT_HEADERSDIR=/usr/local/arm/leptonica/include \

 CC="arm-linux-gnueabihf-gcc" CXX="arm-linux-gnueabihf-g++" \

./configure \

    --prefix=/usr/local/arm/tesseract-ocr \

    --target=arm-linux \

    --host=arm-linux \

    --with-extra-libraries=/usr/local/arm/leptonica/lib




** tesseract 컴파일 수행, 설치

$ make

$ sudo make install




** tesseract cross 컴파일된 오브젝트 버전확인(32bit ARM)

cd /usr/local/arm/tesseract-ocr/lib

file libtesseract.so.3.0.2 

libtesseract.so.3.0.2: ELF 32-bit LSB  shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, BuildID[sha1]=18c1b84e4915b1ceeacf568cde32b7ad10be073e, not stripped




** openalpr 패키지 이동

$ cd 

$ cd down/ocr

$ pwd

/home/계정명/down/ocr




** openalpr git 소스 다운로드

$ git clone https://github.com/openalpr/openalpr.git --depth=1




** openalpr 컴파일 옵션 변경

$ pwd

/home/계정명/down/ocr


$ cd openalpr/src

$ vi CMakeLists.txt


*17라인 정도 opencv, tesseract-ocr path변경

SET(OpenCV_DIR "${CMAKE_SOURCE_DIR}/../libraries/opencv/")

SET(Tesseract_DIR "${CMAKE_SOURCE_DIR}/../libraries/tesseract-ocr")


-->  SET(OpenCV_DIR "/usr/local/arm/opencv/lib")

       SET(Tesseract_DIR "/usr/local/arm/tesseract-ocr")


* 20라인 컴파일중 에러가 난다면 include path추가
 include_directories(
         /usr/local/arm/opencv/include
         ${Tesseract_DIR}/include
         ${Tesseract_DIR}/api
         ${Tesseract_DIR}/ccutil/
         ${Tesseract_DIR}/ccstruct/
         ${Tesseract_DIR}/ccmain/
 )

 * 48라인 변경 l
ink_directories( ${Tesseract_DIR}/.api/libs/ )
--> link_directories( ${Tesseract_DIR}/lib/)



** openalpr 컴파일 옵션 정의

$ pwd

/home/계정명/down/ocr/openalpr/src


$ mkdir build

$ cd build

$ pwd

/home/계정명/down/ocr/openalpr/src/build


$ cmake \

    -DCMAKE_INSTALL_PREFIX=/usr/local/arm/openalpr \

    -DCMAKE_PREFIX_PATH=/usr/local/arm/opencv \

    -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/arm-linux-gnueabihf-g++ \

    -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/arm-linux-gnueabihf-gcc \

    ../



** openalpr 컴파일 수행, 설치

$ make

$ sudo make install



** openalpr 컴파일시 /usr/local/arm/tesseract-ocr/lib/libtesseract.so: undefined reference ... 에러메세지 출력시

$ cd /usr/arm-linux-gnueabihf/lib

$ sudo cp -r /usr/local/arm/tesseract-ocr/lib/* .

$ sudo cp -r /usr/local/arm/leptonica/lib/* .



** openalpr ract cross 컴파일된 오브젝트 버전확인(32bit ARM)

cd /usr/local/arm/openalpr/bin

file alpr

alpr: ELF 32-bit LSB  executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=0dd51f34e6b0e3902773df82aaa039cd3de50033, not stripped



** traineddata 파일 복사

cd ~/down/ocr/openalpr/runtime_data/ocr/tessdata

$ sudo cp *.traineddata /usr/local/ocr/tesseract-ocr/share/tessdata/

$ sudo cp *.traineddata /usr/local/share/tessdata/



블로그 이미지

유효하지않음

,

[출처] http://kldp.org/node/103288

Fedora 10 패키지 목록을 살펴보던 중 호기심을 자극하는 패키지가 하나 있었다. 뭔가하고 살펴보니 ext3 파일 시스템에서 지워진 파일의 복구를 해주는 놈이다.

ext2와 다른 특성으로 인해 ext3에서 지워진 파일의 복구는 꽤 어려운 명령어들을 알아야했고 복구율도 좋지 않았었다. 하지만 ext3grep은 이러한 생각을 바꾸게 만들기에 충분했다.

소스 다운로드는 http://code.google.com/p/ext3grep/ 에서 할 수 있고 Fedora나 Debian의 최신 버전에는 포함되어 있으니 해당 배포판의 패키지 관리자로 설치하면 된다.

설치를 하고 간단한 테스트를 해보았다. 시간상 1GB정도의 파티션을 만들고 테스트를 진행했다.

    # mkfs.ext3 /dev/sdb1
    # mount /dev/sdb1 /mnt/test/
    # df -h
    /dev/sdb1             966M   18M  899M   2% /mnt/test

몇개의 디렉토리와 파일을 만들었다.

    # ls *
    test1.txt  test2.txt  테스트.txt  테스트2.txt

    dir1:
    dir1.txt

    dir2:
    dir2.txt

    dir3:
    dir3.txt

    lost+found:

    디렉토리1:
    디렉토리1.txt

    디렉토리2:
    디렉토리2.txt

    디렉토리3:
    디렉토리3.txt


그 중에 몇개를 삭제했다.

# rm -rf dir2 dir3 test2.txt 디렉토리1 디렉토리3 테스트.txt


이제 unmount 하고 실제 ext3grep 을 사용할 차례다.

    # umount /mnt/test


–dump-names 로 경로를 포함한 파일들의 경로를 알 수 있다.

    # ext3grep –dump-names /dev/sdb1
    Running ext3grep version 0.10.1
    Number of groups: 8
    Minimum / maximum journal block: 562 / 4664
    Loading journal descriptors… sorting… done
    The oldest inode block that is still in the journal, appears to be from 1235694214 = Fri Feb 27 09:23:34 2009
    Number of descriptors in journal: 269; min / max sequence numbers: 2 / 40
    Finding all blocks that might be directories.
    D: block containing directory start, d: block containing more directory entries.
    Each plus represents a directory start that references the same inode as a directory start that we found previously.

    Searching group 0: DDD+DD+++++++++++++++++D+DD+++++++++
    Searching group 1: +
    Searching group 2: +
    Searching group 3: +
    Searching group 4: +
    Searching group 5: +
    Searching group 6: +
    Searching group 7:
    Writing analysis so far to ’sdb1.ext3grep.stage1′. Delete that file if you want to do this stage again.
    Result of stage one:
    8 inodes are referenced by one or more directory blocks, 4 of those inodes are still allocated.
    7 inodes are referenced by more than one directory block, 3 of those inodes are still allocated.
    0 blocks contain an extended directory.
    Result of stage two:
    4 of those inodes could be resolved because they are still allocated.
    4 inodes could be resolved because all refering blocks but one were journal blocks.
    All directory inodes are accounted for!

    Writing analysis so far to ’sdb1.ext3grep.stage2′. Delete that file if you want to do this stage again.
    dir1
    dir1/.dir1.txt.swp
    dir1/dir1.txt
    dir2
    dir2/.dir2.txt.swp
    dir2/dir2.txt
    dir3
    dir3/.dir3.txt.swp
    dir3/dir3.txt
    lost+found
    test1.txt
    test2.txt
    디렉토리1
    디렉토리1/.디렉토리1.txt.swp
    디렉토리1/디렉토리1.txt
    디렉토리2
    디렉토리2/.디렉토리2.txt.swp
    디렉토리2/디렉토리2.txt
    디렉토리3
    디렉토리3/.디렉토리3.txt.swp
    디렉토리3/디렉토리3.txt
    테스트.txt
    테스트2.txt


위 명령어를 실행한 후 ext3grep.stage1, ext3grep.stage2 파일이 생성되는데 inode와 block의 정보를 담고 있다. 한번 생성되면 다른 명령어를 실행할때 재사용되기 때문에 검색에 소요되는 시간이 줄어든다.

    # cat sdb1.ext3grep.stage1
    # Stage 1 data for /dev/sdb1.
    # Inodes and directory start blocks that use it for dir entry ‘.’.
    # INODE : BLOCK [BLOCK ...]
    2 : 556 573 597 605 610 682 688 698 703 713 719 732 859
    11 : 557
    15713 : 740 792 800 805 40960
    31425 : 582 659 666 671 79872
    47137 : 571 620 628 633 112640
    62849 : 578 645 651 145408
    78561 : 736 774 780 172032
    94273 : 730 749 757 762 204800
    # Extended directory blocks.
    # END

    # cat sdb1.ext3grep.stage2
    # Stage 2 data for /dev/sdb1.
    # Inodes path and directory blocks.
    # INODE PATH BLOCK [BLOCK ...]
    2 ” 556
    11 ‘lost+found’ 557
    15713 ‘디렉토리3′ 40960
    31425 ‘dir3′ 79872
    47137 ‘dir1′ 112640
    62849 ‘dir2′ 145408
    78561 ‘디렉토리2′ 172032
    94273 ‘디렉토리1′ 204800
    # END


–restore-all 은 해당 장치의 모든 파일을 명령어가 실행된 위치에 RESTORED_FILES라는 디렉토리를 생성하고 그 안에 복구해준다. 명령어를 실행하기 전에 충분한 공간이 있는지 확인하자.

    # ext3grep –restore-all /dev/sdb1
    Running ext3grep version 0.10.1
    Number of groups: 8
    Minimum / maximum journal block: 562 / 4664
    Loading journal descriptors… sorting… done
    The oldest inode block that is still in the journal, appears to be from 1235694214 = Fri Feb 27 09:23:34 2009
    Number of descriptors in journal: 269; min / max sequence numbers: 2 / 40
    Writing output to directory RESTORED_FILES/
    Finding all blocks that might be directories.
    D: block containing directory start, d: block containing more directory entries.
    Each plus represents a directory start that references the same inode as a directory start that we found previously.

    Searching group 0: DDD+DD+++++++++++++++++D+DD+++++++++
    Searching group 1: +
    Searching group 2: +
    Searching group 3: +
    Searching group 4: +
    Searching group 5: +
    Searching group 6: +
    Searching group 7:
    Writing analysis so far to ’sdb1.ext3grep.stage1′. Delete that file if you want to do this stage again.
    Result of stage one:
    8 inodes are referenced by one or more directory blocks, 4 of those inodes are still allocated.
    7 inodes are referenced by more than one directory block, 3 of those inodes are still allocated.
    0 blocks contain an extended directory.
    Result of stage two:
    4 of those inodes could be resolved because they are still allocated.
    4 inodes could be resolved because all refering blocks but one were journal blocks.
    All directory inodes are accounted for!

    Writing analysis so far to ’sdb1.ext3grep.stage2′. Delete that file if you want to do this stage again.
    Restoring dir1/.dir1.txt.swp
    Restoring dir1/dir1.txt
    Restoring dir2/.dir2.txt.swp
    Restoring dir2/dir2.txt
    Restoring dir3/.dir3.txt.swp
    Restoring dir3/dir3.txt
    Restoring test1.txt
    Restoring test2.txt
    Restoring 디렉토리1/.디렉토리1.txt.swp
    Restoring 디렉토리1/디렉토리1.txt
    Restoring 디렉토리2/.디렉토리2.txt.swp
    Restoring 디렉토리2/디렉토리2.txt
    Restoring 디렉토리3/.디렉토리3.txt.swp
    Restoring 디렉토리3/디렉토리3.txt
    Restoring 테스트.txt
    Restoring 테스트2.txt

    # cd RESTORED_FILES/

    # ls *
    test1.txt  test2.txt  테스트.txt  테스트2.txt

    dir1:
    dir1.txt

    dir2:
    dir2.txt

    dir3:
    dir3.txt

    lost+found:

    디렉토리1:
    디렉토리1.txt

    디렉토리2:
    디렉토리2.txt

    디렉토리3:
    디렉토리3.txt


–restore-all 명령어와 함께 사용할 수 있는 필터가 여러개 있는데 –after 옵션을 주면 그 시간 이후의 파일들만 복구해준다. unix time을 적어주면 된다.

    # ext3grep –restore-all –after=1235694514 /dev/sdb1
    Running ext3grep version 0.10.1
    Only show/process deleted entries if they are deleted on or after Fri Feb 27 09:28:34 2009.

    Number of groups: 8
    Minimum / maximum journal block: 562 / 4664
    Loading journal descriptors… sorting… done
    The oldest inode block that is still in the journal, appears to be from 1235694214 = Fri Feb 27 09:23:34 2009
    Number of descriptors in journal: 269; min / max sequence numbers: 2 / 40
    Loading sdb1.ext3grep.stage2… done
    Not undeleting “dir1/.dir1.txt.swp” because it was deleted before 1235694514 (32767)
    Restoring dir1/dir1.txt
    Not undeleting “dir2/.dir2.txt.swp” because it was deleted before 1235694514 (1235694303)
    Not undeleting “dir2/dir2.txt” because it was deleted before 1235694514 (1235694303)
    Not undeleting “dir3/.dir3.txt.swp” because it was deleted before 1235694514 (1235694303)
    Not undeleting “dir3/dir3.txt” because it was deleted before 1235694514 (1235694303)
    Restoring test1.txt
    Not undeleting “test2.txt” because it was deleted before 1235694514 (1235694287)
    Not undeleting “디렉토리1/.디렉토리1.txt.swp” because it was deleted before 1235694514 (1235694287)
    Not undeleting “디렉토리1/디렉토리1.txt” because it was deleted before 1235694514 (1235694287)
    Not undeleting “디렉토리2/.디렉토리2.txt.swp” because it was deleted before 1235694514 (1235694287)
    Restoring 디렉토리2/디렉토리2.txt
    Not undeleting “디렉토리3/.디렉토리3.txt.swp” because it was deleted before 1235694514 (1235694404)
    Not undeleting “디렉토리3/디렉토리3.txt” because it was deleted before 1235694514 (1235694404)
    Not undeleting “테스트.txt” because it was deleted before 1235694514 (1235694404)
    Restoring 테스트2.txt


특정 이름의 파일만 복구 하려면 –restore-file 다음에 파일명을 써주면 된다.

    # ext3grep –restore-file 테스트.txt /dev/sdb1
    Running ext3grep version 0.10.1
    Number of groups: 8
    Minimum / maximum journal block: 562 / 4664
    Loading journal descriptors… sorting… done
    The oldest inode block that is still in the journal, appears to be from 1235694214 = Fri Feb 27 09:23:34 2009
    Number of descriptors in journal: 269; min / max sequence numbers: 2 / 40
    Writing output to directory RESTORED_FILES/
    Loading sdb1.ext3grep.stage2… done
    Restoring 테스트.txt

    # cd RESTORED_FILES/
    # ls
    테스트.txt


디렉토리 밑에 있는 파일이라면 경로까지 정확하게 써주면 된다. 경로를 포함한 파일명은 위에서 한번 실행했던 –dump-names로 알 수 있다.

    # ext3grep –restore-file dir2/dir2.txt /dev/sdb1
    Running ext3grep version 0.10.1
    Number of groups: 8
    Minimum / maximum journal block: 562 / 4664
    Loading journal descriptors… sorting… done
    The oldest inode block that is still in the journal, appears to be from 1235694214 = Fri Feb 27 09:23:34 2009
    Number of descriptors in journal: 269; min / max sequence numbers: 2 / 40
    Loading sdb1.ext3grep.stage2… done
    Restoring dir2/dir2.txt


더 많은 옵션이 있지만 일반적인 사용자라면 이정도만 알아도 충분히 복구할 수 있을 것이다. 이름처럼 ext3에 대해서 복구를 해주기 때문에 포맷이 되었거나 다른 파일시스템에서는 복구가 안된다.

마지막으로 노파심에서 한마디 하자면 실수로 파일을 삭제했을때에는 최대한 빨리 해당 장치를 unmount 해서 덮어써지지 않게 해야한다.

자세한 정보는 저자의 홈페이지에서 확인하자.

블로그 이미지

유효하지않음

,

vim 단축키 모음

OS 2009. 4. 7. 20:42

PHPSCHOOL 토크박스에 있던거 괜찮아서 추가했습니다.

블로그 이미지

유효하지않음

,

iSCSI on Solaris 10 x86

OS/Solaris 2009. 2. 19. 13:10

[출처] http://blog.scottlowe.org/2006/12/05/iscsi-on-solaris-10-x86/

Given that I’m neither a Solaris expert (yet) nor an iSCSI expert (yet), I knew that it would be a bit of a challenge to make this work.  Fortunately, a found avery useful blog posting by Frank Berger that gave me the framework I needed to get started.  From there, Sun’s documentation provided the rest of the necessary details.  Perhaps this documentation will prove moderately useful as well.

First, I added the following lines to the /etc/ietd.conf on the CentOS iSCSI target server:

Target iqn.2006-08.net.example:server.lun1
        IncomingUser username complicatedpassword
        Lun 1 Path=/dev/vg00/isanvol1,Type=fileio
        Alias iet-lun1
        MaxConnections          8
        InitialR2T              No
        ImmediateData           Yes

A quick restart of the iSCSI target service and I was all set on the target side.  If you were going to do this yourself in your own environment, you’d need to modify the “IncomingUser” and “Lun X Path”.  In this instance I’m using LVM on CentOS, so my path specifies a logical volume in a volume group.  Your configuration will differ, obviously.  Alternately, if you are using a different iSCSI target implementation, you’d need to configure it appropriately.  (I hope to be able to do some testing against a NetApp iSCSI target in the near future.)

On the initiator side, everything is done with the “iscsiadm” command.  This command is fairly self-explanatory and has built-in help (-?) throughout most of the options, but it did take me a little bit of time to get things working.

First, we have to make sure that the iSCSI initiator is online:

svcs -a | grep iscsi

If disabled, then we can enable it with this command:

svcadm enable svc:/network/iscsi_initiator

From there, we configure the iSCSI initiator:

iscsiadm add discovery-address 10.1.1.1:3260
iscsiadm modify initiator-node -a CHAP
iscsiadm modify initiator-node -H username
iscsiadm modify initiator-node -C
(specify CHAP password)
iscsiadm modify discovery --sendtargets enable

Because I’d also specified a static config as well (dynamic discovery didn’t seem to be working as I expected; more on that in a moment), using “iscsiadm list target” now returned two iSCSI targets.  They appeared to be different targets, and since I do have two targets defined on the iSCSI server (one for VMware and one for this), I didn’t want to take any chances on affecting the VMware LUN.  So, I removed and disabled the dynamic discovery, removed the static config, and then re-added the static config:

iscsiadm add static-config iqn.2006-08.net.example:server.lun1,
10.1.1.1:3260

(This should all be on one line; it was wrapped here for readability.)  After doing that, “iscsiadm list target” showed only a single target identified as “server.lun1”, which assured me that I wasn’t seeing the VMware LUN.

<aside>In a more complex environment, how does one ensure that iSCSI LUNs are properly isolated from unwanted hosts?  The “IncomingUser” parameter was different between my VMware LUN and the raw LUN being presented to Solaris, so in theory I would have been safe.  Better safe than sorry, in my opinion.</aside>

After I was sure that the iSCSI initiator was properly seeing the LUN, then I created a new device, created a new filesystem on that device, and then mounted it:

devfsadm -c iscsi
format (selected new disk identified as iSCSI)
newfs /dev/dsk/c2t1d0s2
mount /dev/dsk/c2t1d0s2 /export/iscsi

Of course, you’ll need to modify the above commands slightly depending upon your configuration, but the overall process should be pretty close to what I’ve outlined above.




Step 1: configuring the iSCSI initiator on both V215 nodes:


root@solcluster03:~> svcadm enable iscsi_initiator
root@solcluster03:~> iscsiadm list initiator-node
Initiator node name: iqn.1986-03.com.sun:01:00144f7109f2.48aa5d81
Initiator node alias: -
Login Parameters (Default/Configured):
Header Digest: NONE/-
Data Digest: NONE/-
Authentication Type: NONE
RADIUS Server: NONE
RADIUS access: unknown
Configured Sessions: 1
root@solcluster03:~> iscsiadm add discovery-address 172.19.107.9
root@solcluster03:~> devfsadm -c iscsi
root@solcluster03:~> iscsiadm modify discovery -t enable
root@solcluster03:~> format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
0. c1t0d0 
/pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/sd@0,0
1. c1t1d0 
/pci@1e,600000/pci@0/pci@a/pci@0/pci@8/scsi@1/sd@1,0
2. c2t010000144F20E16400002A0048AEB3ABd0 
/scsi_vhci/ssd@g010000144f20e16400002a0048aeb3ab
3. c2t010000144F20E16400002A0048609421d0 
/scsi_vhci/ssd@g010000144f20e16400002a0048609421
Specify disk (enter its number): ^D
root@solcluster03:~>

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

Step 2: ZFS creation (some uninteresting stuff in there, but I don't 
want to cut something out):


root@solcluster03:~> NOINUSE_CHECK=1 zpool create iscsi 
c2t010000144F20E16400002A0048609421d0
root@solcluster03:~> zfs set mountpoint=/export/iscsi iscsi

root@solcluster03:~> zfs list
NAME USED AVAIL REFER MOUNTPOINT
iscsi 92K 9,78G 24,5K /export/iscsi
root@solcluster03:~>

root@solcluster03:~> zfs set compression=on iscsi
root@solcluster03:~> zfs set backup:zfs:avoidscrub=true iscsi
root@solcluster03:~> zfs set storage:cluster:hasp=true iscsi
root@solcluster03:~> zfs set storage:cluster:avs=false iscsi
root@solcluster03:~> zfs get all iscsi
NAME EIGENSCHAFT WERT QUELLE
iscsi type filesystem -
iscsi creation Mi Sep 3 9:14 2008 -
iscsi used 92K -
iscsi available 9,78G -
iscsi referenced 24,5K -
iscsi compressratio 1.00x -
iscsi mounted yes -
iscsi quota none default
iscsi reservation none default
iscsi recordsize 128K default
iscsi mountpoint /export/iscsi local
iscsi sharenfs off default
iscsi checksum on default
iscsi compression off default
iscsi atime on default
iscsi devices on default
iscsi exec on default
iscsi setuid on default
iscsi readonly off default
iscsi zoned off default
iscsi snapdir hidden default
iscsi aclmode groupmask default
iscsi aclinherit secure default
iscsi canmount on default
iscsi shareiscsi off default
iscsi xattr on default
iscsi storage:cluster:hasp true local
iscsi backup:zfs:avoidscrub true local
iscsi storage:cluster:avs false local
root@solcluster03:~>
root@solcluster03:~> zfs create iscsi/data
root@solcluster03:~> zfs list | grep iscsi
iscsi 158K 9,78G 26,5K /export/iscsi
iscsi/data 24,5K 9,78G 24,5K /export/iscsi/data
root@solcluster03:~>

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

Step 3: Creating the HA-NFS resource group (called "hanfs-rg")

root@solcluster03:~> clresourcegroup create -p Pathprefix=/export/iscsi 
hanfs-rg
root@solcluster03:~> clresourcegroup status

Cluster Resource Groups ===

Group Name Node Name Suspended Status
---------- --------- --------- ------
hanfs-rg solcluster04 No Unmanaged
solcluster03 No Unmanaged

root@solcluster03:~>

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

Step 4: Creating a logical hostname resource (would be needed for HA-NFS 
later)

root@solcluster03:~> host solcluster
solcluster.dlan.cinetic.de has address 172.20.5.125
root@solcluster03:~>

root@solcluster03:~> grep solcluster.dlan.cinetic.de /etc/hosts
172.20.5.125 solcluster solcluster.dlan.cinetic.de
root@solcluster03:~>

root@solcluster03:~> clreslogicalhostname create -g hanfs-rg -h 
solcluster hanfs-ip
root@solcluster03:~> clreslogicalhostname status

Cluster Resources ===

Resource Name Node Name State Status Message
------------- --------- ----- --------------
hanfs-ip solcluster04 Offline Offline
solcluster03 Offline Offline

root@solcluster03:~>

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

Step 5: Creating the HAStoragePlus resource


root@solcluster03:~> clresourcetype register SUNW.HAStoragePlus
root@solcluster03:~>

root@solcluster03:~> clresource create -t SUNW.HAStoragePlus -g hanfs-rg 
-p Zpools=iscsi hanfs-hasp
root@solcluster03:~> clresource list
hanfs-ip
hanfs-hasp
root@solcluster03:~>
---------------------------------------------------------------

Note: The zpool is being exported by the clresource command. Takes some 
time.


Step 6: Taking the resource group online

root@solcluster03:~> clresourcegroup list
hanfs-rg
root@solcluster03:~>


root@solcluster03:~> clresourcegroup online -M hanfs-rg

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


And that's it. The command never returns. the zpool is never imported, 
the resource themselves stay "Offline". After a reboot, the hasp 
resource is "Pending" and further modification of the configuration is 
impossible. No log entries btw, seems like

Solaris 10 Update 5, Solaris Cluster 3.2 Update 1, actual recommended 
patches cluster applied, using 2x V215 as iSCSI initiatiors and 1x X4500 
as the iSCSI target.

블로그 이미지

유효하지않음

,

[출처] http://www.cyberciti.biz/tips/howto-setup-linux-iscsi-target-sanwith-tgt.html

Linux target framework (tgt) aims to simplify various SCSI target driver (iSCSI, Fibre Channel, SRP, etc) creation and maintenance. The key goals are the clean integration into the scsi-mid layer and implementing a great portion of tgt in user space.

The developer of IET is also helping to develop Linux SCSI target framework (stgt) which looks like it might lead to an iSCSI target implementation with an upstream kernel component. iSCSI Target can be useful:

a] To setup stateless server / client (used in diskless setups).
b] Share disks and tape drives with remote client over LAN, Wan or the Internet.
c] Setup SAN - Storage array.
d] To setup loadbalanced webcluser using cluster aware Linux file system etc.

In this tutorial you will learn how to have a fully functional Linux iSCSI SAN using tgt framework.

iSCSI target (server)

Storage resource located on an iSCSI server known as a "target". An iSCSI target usually represents nothing but hard disk storage. As with initiators, software to provide an iSCSI target is available for most mainstream operating systems.

iSCSI initiator (client)

An initiator functions as an iSCSI client. An initiator typically serves the same purpose to a computer as a SCSI bus adapter would, except that instead of physically cabling SCSI devices (like hard drives and tape changers), an iSCSI initiator sends SCSI commands over an IP network.

Debian / Ubuntu Linux Install tgt

Type the following command to install Linux target framework user-space tools:
$ sudo apt-get install tgt

CentOS / RHEL / Red Hat Linux Install tgt

RHEL 5.2 and older version do not have tgt tools. However, RHEL 5.3 (preview version) comes with tgt tools.

tgtadm - Linux SCSI Target Administration Utility

tgtadm is used to monitor and modify everything about Linux SCSI target software: targets, volumes, etc. This tool allows a system to serve block-level SCSI storage to other systems that have a SCSI initiator. This capability is being initially deployed as a Linux iSCSI target, serving storage over a network to any iSCSI initiator.

Start tgtd

To start the tgtd, enter:
# /usr/sbin/tgtd
Under RHEL 5.3 to start the tgtd service, enter:
# /etc/init.d/tgtd start

Define an iscsi target name

The following example creates a target with id 1 (the iqn is 19 iqn.2001-04.com.example:storage.disk2.amiens.sys1.xyz) and adds a 20 logical unit (backed by /dev/hdc1) with lun 1.
# tgtadm --lld iscsi --op new --mode target --tid 1 -T iqn.2001-04.com.example:storage.disk2.amiens.sys1.xyz

To view the current configuration, enter:
# tgtadm --lld iscsi --op show --mode target
Sample output:

Target 1: iqn.2001-04.com.example:storage.disk1.amiens.sys1.xyz
    System information:
        Driver: iscsi
        Status: running
    I_T nexus information:
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: deadbeaf1:0
            SCSI SN: beaf10
            Size: 0
            Online: No
            Poweron/Reset: Yes
            Removable media: No
            Backing store: No backing store
    Account information:
    ACL information:

Add a logical unit to the target (/dev/sdb1):
# tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /dev/sdb1

A note about home computer / test system

Most production boxes will only use iSCSI root with real iSCSI devices, but for testing purposes it can be quite useful to set up an iSCSI target on your image server. This is useful for testing and learning iSCSI target and iSCSI initiator at home, simply use filesystem for testing purpose. Usedd command to create diskbased filesystem:
# dd if=/dev/zero of=/fs.iscsi.disk bs=1M count=512
Add /fs.iscsi.disk as a logical unit to the target:
# tgtadm --lld iscsi --op new --mode logicalunit --tid 1 --lun 1 -b /fs.iscsi.disk
Now, you should able to view details:
# tgtadm --lld iscsi --op show --mode target
Sample output:

Target 1: iqn.2001-04.com.example:storage.disk1.amiens.sys1.xyz
    System information:
        Driver: iscsi
        Status: running
    I_T nexus information:
    LUN information:
        LUN: 0
            Type: controller
            SCSI ID: deadbeaf1:0
            SCSI SN: beaf10
            Size: 0
            Online: No
            Poweron/Reset: Yes
            Removable media: No
            Backing store: No backing store
        LUN: 1
            Type: disk
            SCSI ID: deadbeaf1:1
            SCSI SN: beaf11
            Size: 512M
            Online: Yes
            Poweron/Reset: Yes
            Removable media: No
            Backing store: /fs.iscsi.disk
    Account information:
    ACL information:

Accept iSCSI Target

To enable the target to accept any initiators, enter:
# tgtadm --lld iscsi --op bind --mode target --tid 1 -I ALL
This should open network port # 3260:
# netstat -tulpn | grep 3260
Sample output:

tcp        0      0 0.0.0.0:3260            0.0.0.0:*               LISTEN      27328/tgtd
tcp6       0      0 :::3260                 :::*                    LISTEN      27328/tgtd      

And you are done. Your system is configured as iSCSI Target. Remote client computer can access this computers hard disk over network. Your can use cluster aware filesystem to setup real shared storage for small business. Open TCP port 3260 in your firewall, if required.

How do I access iSCSI Target (server) via iSCSI initiator (client)?

See detailed os specific iSCSI initiator instuctions:

  1. RHEL 4 or RHEL 5 Linux iSCSI initiator tutorial.
  2. Debian Linux iSCSI initiator tutorial.
  3. FreeBSD iSCSI initiator tutorial.
  4. Windows iSCSI initiator tutorial.

Following is a quick way to access iSCSI target, under RHEL 5. Let us say your server iSCSI Target IP is 192.168.1.2. Type the following command to discover targets at a given IP address such as 192.168.1.2 (use 127.0.0.1 if you are testing it from same computer):
# iscsiadm --mode discovery --type sendtargets --portal 192.168.1.2
OR
# iscsiadm --mode discovery --type sendtargets --portal 127.0.0.1
Sample output:

127.0.0.1:3260,1 iqn.2001-04.com.example:storage.disk1.amiens.sys1.xyz

Login to the iscsi target session:
# iscsiadm --mode node --targetname iqn.2001-04.com.example:storage.disk1.amiens.sys1.xyz --portal 192.168.1.2:3260 --login
OR
# iscsiadm --mode node --targetname iqn.2001-04.com.example:storage.disk1.amiens.sys1.xyz --portal 127.0.0.1:3260 --login
Verify that login was successful:
# tail -f /var/log/messages
Sample output:

Nov 11 07:34:04 vivek-desktop kernel: [ 9039.562312] scsi 6:0:0:1: Direct-Access     IET      VIRTUAL-DISK     0001 PQ: 0 ANSI: 5
Nov 11 07:34:04 vivek-desktop kernel: [ 9039.572268] sd 6:0:0:1: [sdc] 1048576 512-byte hardware sectors (537 MB)
Nov 11 07:34:04 vivek-desktop kernel: [ 9039.572374] sd 6:0:0:1: [sdc] Write Protect is off
Nov 11 07:34:04 vivek-desktop kernel: [ 9039.572530] sd 6:0:0:1: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Nov 11 07:34:04 vivek-desktop kernel: [ 9039.572715] sd 6:0:0:1: [sdc] 1048576 512-byte hardware sectors (537 MB)
Nov 11 07:34:04 vivek-desktop kernel: [ 9039.572790] sd 6:0:0:1: [sdc] Write Protect is off
Nov 11 07:34:04 vivek-desktop kernel: [ 9039.572940] sd 6:0:0:1: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Nov 11 07:34:04 vivek-desktop kernel: [ 9039.572946]  sdc: unknown partition table
Nov 11 07:34:04 vivek-desktop kernel: [ 9039.573492] sd 6:0:0:1: [sdc] Attached SCSI disk
Nov 11 07:34:04 vivek-desktop kernel: [ 9039.573593] sd 6:0:0:1: Attached scsi generic sg4 type 0

sdc is new scsi disk. You may need to restart iSCSI to probe partition and check disks:
# service iscsi restart
# partprobe
# fdisk -l

You can now create parition and mount file system using usual fdisk and mkfs.ext3 commands:
# fdisk /dev/sdc
# mkfs.ext3 /dev/sdc1mkdir /iscsi
# mkdir /iscsi
# mount /dev/sdc1 /iscsi
# df -H

Sample output:

Filesystem             Size   Used  Avail Use% Mounted on
/dev/sda2               99G    30G    64G  32% /
tmpfs                  1.1G      0   1.1G   0% /lib/init/rw
varrun                 1.1G   361k   1.1G   1% /var/run
varlock                1.1G      0   1.1G   0% /var/lock
udev                   1.1G   2.9M   1.1G   1% /dev
tmpfs                  1.1G   312k   1.1G   1% /dev/shm
/dev/sda1              105G    32G    73G  31% /media/sda1
/dev/sda5              294G   275G    20G  94% /share
/dev/sdb2              247G   119G   116G  51% /disk1p2
/dev/sdc1              520M    11M   483M   3% /iscsi
블로그 이미지

유효하지않음

,

[출처] http://www.cyberciti.biz/tips/howto-centos-rhel4-iscsi-initiators.html

I've received a couple of email about setting up iSCSI under CentOS 4 or RHEL ES 4 server. Previously, I wrote about iSCSI under CentOS 5 / RHEL 5 server.

Requirements

[a] Following instructions tested on RHEL ES 4 and CentOS 4 only. (See RHEL 5/ CentOS 5 / Debian/ Ubuntu Linux specific instructions here).
[b] You need following information
[c] ISCSI Username
[d] ISCSI Password
[e] ISCSI Server IP / hostname

CentOS Linux v4.x - Install iscsi-initiator-utils

Type the following command:
# yum install iscsi-initiator-utils

Redhat ES Linux v4.x - Install iscsi-initiator-utils

Type the following command:
# up2date iscsi-initiator-utils

Configure iSCSI

Open /etc/iscsi.conf file, enter:
# vi /etc/iscsi.conf
Setup it as follows:

DiscoveryAddress=ISCSI_TARGET_HOST_OR_IP
 OutgoingUserName=ISCSI_USER_NAME
 OutgoingPassword=ISCSI_PASSWORD
 LoginTimeout=15

Save and close the file.

Start the iscsi service

Type the following command to start iscsi service so that you can see block device:
# chkconfig iscsi on
# /etc/init.d/iscsi start

Run any one of the following to find out new block device name:
# fdisk -l
# tail -f /var/log/messages
# find /sys/devices/platform/host* -name "block*"

Format iSCSI device

Use fdisk and mkfs.ext3 commands. First, create a partition (assuming that /dev/sdc is a new block device assigned to iscsi) :
# fdisk /dev/sdc
# mkfs.ext3 /dev/sdc1

Create /mnt/iscsi directory:
# mkdir -p /mnt/iscsi
Open /etc/fstab file and append config directive:
/dev/sdc1 /mnt/iscsi ext3 _netdev 0 0
Save and close the file. Mount the parition /dev/sdc1:
# mount -a
# df -H

블로그 이미지

유효하지않음

,

[출처] http://www.cyberciti.biz/tips/rhel-centos-fedora-linux-iscsi-howto.html

Internet SCSI (iSCSI) is a network protocol s that allows you to use of the SCSI protocol over TCP/IP networks. It is good alternative to Fibre Channel-based SANs. You can easily manage, mount and format iSCSI Volume under Linux. It allows access to SAN storage over Ethernet.

Open-iSCSI Project

Open-iSCSI project is a high-performance, transport independent, multi-platform implementation of iSCSI. Open-iSCSI is partitioned into user and kernel parts.

Instructions are tested on:
[a] RHEL 5
[b] CentOS 5
[c] Fedora 7
[d] Debian / Ubuntu Linux

Install Required Package

iscsi-initiator-utils RPM package - The iscsi package provides the server daemon for the iSCSI protocol, as well as the utility programs used to manage it. iSCSI is a protocol for distributed disk access using SCSI commands sent over Internet Protocol networks. This package is available under Redhat Enterprise Linux / CentOS / Fedora Linux and can be installed using yum command:
# yum install iscsi-initiator-utils

A note about Debian / Ubuntu Linux

If you are using Debian / Ubuntu Linux install open-iscsi package, enter:
$ sudo apt-get install open-iscsi

iSCSI Configuration

There are three steps needed to set up a system to use iSCSI storage:

  1. iSCSI startup using the init script or manual startup. You need to edit and configure iSCSI via /etc/iscsi/iscsid.conf file
  2. Discover targets.
  3. Automate target logins for future system reboots.
  4. You also need to obtain iSCSI username, password and storage server IP address (target host)

Step # 1: Configure iSCSI

Open /etc/iscsi/iscsid.conf with vi text editor:
# vi /etc/iscsi/iscsid.conf
Setup username and password:
node.session.auth.username = My_ISCSI_USR_NAME
node.session.auth.password = MyPassword
discovery.sendtargets.auth.username = My_ISCSI_USR_NAME
discovery.sendtargets.auth.password = MyPassword

Where,

  • node.session.* is used to set a CHAP username and password for initiator authentication by the target(s).
  • discovery.sendtargets.* is used to set a discovery session CHAP username and password for the initiator authentication by the target(s)

You may also need to tweak and set other options. Refer to man page for more information. Now start the iscsi service:
# /etc/init.d/iscsi start

Step # 2: Discover targets

Now use iscsiadm command, which is a command-line tool allowing discovery and login to iSCSI targets, as well as access and management of the open-iscsi database. If your storage server IP address is 192.168.1.5, enter:
# iscsiadm -m discovery -t sendtargets -p 192.168.1.5
# /etc/init.d/iscsi restart

Now there should be a block device under /dev directory. To obtain new device name, type:
# fdisk -l
or
# tail -f /var/log/messages
Output:

Oct 10 12:42:20 ora9is2 kernel:   Vendor: EQLOGIC   Model: 100E-00           Rev: 3.2
Oct 10 12:42:20 ora9is2 kernel:   Type:   Direct-Access                      ANSI SCSI revision: 05
Oct 10 12:42:20 ora9is2 kernel: SCSI device sdd: 41963520 512-byte hdwr sectors (21485 MB)
Oct 10 12:42:20 ora9is2 kernel: sdd: Write Protect is off
Oct 10 12:42:20 ora9is2 kernel: SCSI device sdd: drive cache: write through
Oct 10 12:42:20 ora9is2 kernel: SCSI device sdd: 41963520 512-byte hdwr sectors (21485 MB)
Oct 10 12:42:20 ora9is2 kernel: sdd: Write Protect is off
Oct 10 12:42:20 ora9is2 kernel: SCSI device sdd: drive cache: write through
Oct 10 12:42:20 ora9is2 kernel:  sdd: unknown partition table
Oct 10 12:42:20 ora9is2 kernel: sd 3:0:0:0: Attached scsi disk sdd
Oct 10 12:42:20 ora9is2 kernel: sd 3:0:0:0: Attached scsi generic sg3 type 0
Oct 10 12:42:20 ora9is2 kernel: rtc: lost some interrupts at 2048Hz.
Oct 10 12:42:20 ora9is2 iscsid: connection0:0 is operational now

/dev/sdd is my new block device.

Step # 3: Format and Mount iSCSI Volume

You can now partition and create a filesystem on the target using usual fdisk and mkfs.ext3 commands:
# fdisk /dev/sdd
# mke2fs -j -m 0 -O dir_index /dev/sdd1

OR
# mkfs.ext3 /dev/sdd1

Tip: If your volume is large size like 1TB, run mkfs.ext3 in background using nohup:
# nohup mkfs.ext3 /dev/sdd1 &

Mount new partition:
# mkdir /mnt/iscsi
# mount /dev/sdd1 /mnt/iscsi

Step #4: Mount iSCSI drive automatically at boot time

First make sure iscsi service turned on at boot time:
# chkconfig iscsi on
Open /etc/fstab file and append config directive:
/dev/sdd1 /mnt/iscsi ext3 _netdev 0 0

블로그 이미지

유효하지않음

,

folding linux lines

OS/Linux 2008. 11. 25. 16:05

fold : 접다, 우리안에 넣다.
80 컬럼이 넘는 긴 라인을 갖는 파일을 80컬럼으로 만들고자 한다면 다음의 명령어를
사용할 수 있다.

$ fold -w 60 filename

60 컬럼으로 만들고 싶은 경우 위의 명령어를 사용할 수 있다.

자세한 옵션은 man page 참조. 원문에는 Linux 명령어라고 하는데 Solaris에서도
명령어가 작동한다.
블로그 이미지

유효하지않음

,
[출처] http://pgclks.tistory.com/140

host login: root
configuration error - unknown item 'PASS_MIN_LEN' (notify administrator)
Password:

o 참고 URL

http://kldp.org/files/______________________________520.doc http://www.puschitz.com/SecuringLinux.shtml#EnablingPasswordAging
http://www.puschitz.com/SecuringLinux.shtml#EnforcingStrongerPasswords

o 사용예 설명

다음 예제는 어떻게 다음의 패스워드 규칙을 적용시키는가를 보여준다.
- 패스워드의 최소길이 8자
    pam_cracklib.so minlen=8
- 소문자 최소 1자
    pam_cracklib.so lcredit=-1
- 대문자 최소 1자
    pam_cracklib.so ucredit=-1
- 숫자 최소 1자
    pam_cracklib.so dcredit=-1
- 문자와 숫자이외의 문자 최소 1자(특수문자를 말하는 듯..)
    pam_cracklib.so ocredit=-1

이 패스워드 제한을 설정하려면 /etc/pam.d/system-auth 파일을 열어 파란색으로 된 부분을 추가하거나
변경을 하라

auth           required       /lib/security/$ISA/pam_env.so
auth           sufficient      /lib/security/$ISA/pam_unix.so likeauth nullok
auth           required       /lib/security/$ISA/pam_deny.so
account      required       /lib/security/$ISA/pam_unix.so
account      sufficient      /lib/security/$ISA/pam_succeed_if.so uid < 100 quiet
account      required       /lib/security/$ISA/pam_permit.so
password   requisite       /lib/security/$ISA/pam_cracklib.so retry=3 minlen=8 lcredit=-1 ucredit=-1 dcredit=-1 ocredit=-1
password   sufficient      /lib/security/$ISA/pam_unix.so nullok use_authtok md5 shadow
password   required       /lib/security/$ISA/pam_deny.so
session      required       /lib/security/$ISA/pam_limits.so
session      required       /lib/security/$ISA/pam_unix.so

password aging은 /etc/shadow 파일을 직접 수정해서 변경할 수도 있지만
chage 명령을 이용하면 좀더 쉽게 사용할 수 있습니다.

chage -l ID : 현재의 에이징 정보
chage -m mindays ID : 암호 의무사용기간 수정
chage -M maxdays ID : 암호 유효기간 수정
chage -d lastdays ID : 암호 변경일 수
chage -E expiredays ID : 계정 만료일 수정

블로그 이미지

유효하지않음

,