어렷을적 슬렉웨어(Slackware)를 설치하면서 무수히 커피를 마셨고,
레드헷(Red Hat)에 빠졌다가 페도라(Fedora)가 나오면서 왠지 배신감에 다른 배포판을 찾게 되었고...

젠투(Gentoo)의 빌드 매력에 잠시 빠져 허덕이기도 하고
필요에 의해서 솔라리스(Solaris), 수세(SUSE), 센트(CentOS), 아치(Arch) 等도 잠시 사용을 했었다.


물론 지금 필자의 블로그를 보신 분이라면 알겠지만, 최근에는 우분투(Ubuntu)에 푸욱~ 빠져 있다.
거의 지배적인 위치에 있다보니 너무나 많은 레퍼런스가 있고, 사용하기에도 편하고
업무에서도 거의 표준으로 사용하기에 개인적인 취향과 업무와 일치하기도 쉽고.... ^^


그러다가 갑자기 떠오른 생각!

   "전세계적으로 가장 많이 사용되는 배포판이 무엇일까?"


그런데 가만히 생각해보니, 이러한 순위를 종종 봤던 기억이 떠올랐다. 다른 블로그 또는 기사로 접했던 것이다.
그 아티클에서 인용을 하던 사이트는 다음과 같다.

   - http://distrowatch.com/



이 사이트에서 방문자들이 검색하는 내용을 가지고 순위를 제공해주고 있다.



필자는 당연히 Ubuntu가 1위를 하고 있을 것이라 생각했다. 하지만... 2위?!

사실 순위표 전체를 가지고 평가하면 Ubuntu가 1위가 맞다!!!
Ubuntu 기반의 배포판들을 모두 더하면 탁월하게 1위다! Mint, kubuntu, xubuntu, Lubuntu 等 모두 Ubuntu 가족들이다.

뭐 여하튼, 위에서 보는바와 같이 글로벌하게 가장 많이 사용하는 리눅스 배포판은 바로 "Mint"이다!



그래서인지, Mint 홈페이지에 보면 세상에서 3번째로 많이 사용되는 가정용 운영체제라고 자부하고 있다.
윈도우즈, Mac 다음으로 Mint ~ !!


Ubuntu 기반이다보니 당연하게도 Debian을 뿌리로 두기 때문에,
데비안 패키지와 우분투 패키지를 사용할 수 있다는 장점은 물론이고 커뮤니티 기반으로 활발한 괜찮은 배포판이다.



Mint 배포판도 한 번 국내에 많은 보급이 되도록 한 번 살펴보도록 해야겠다!
(이미 많이 알려져있을 수도 있지만, 업무에서 사용하는 용도로는 아직 아닌 것 같기에...)

반응형

hostname 우리말로는 "호스트명"이라고 부르면 될 것 같다.

일반적으로는 네트워크에서 특정 컴퓨터(서버)를 인식할 수 있는 이름을 의미하게 되며,
같은 네트워크에서는 유니크한 이름을 갖도록 해야 한다.

만일, 동일한 네트워크에서 같은 호스트명을 사용하게 된다면
단순한 혼란이 발생하는 것이 아니라 충돌상황이 발생할 수도 있다.

FQDN(Fully Qualified Domain Name)과 관련한 부분에 대해서는 이번에는 제외하도록 하겠다.


1. hostname 확인하기

   - 지금 현재 설정되어있는 호스트명을 확인하기 위해서는 다음과 같이 실행해보면 된다.
   - 물론, 대부분의 사용자들은 프롬프트에 표현되어 있기도 하다.

$ hostname

   - "2014.08.16" 기준으로 Ubuntu 12.04에서 hostname 버전은 3.06이고, 14.04에서는 3.15 이다.
   - hostname 버전에 따라서 약간의 옵션 차이가 있기에 12.04/14.04 모두에 적용되는 내용으로 설명하겠다.



2. hostname 변경하기

   - Linux 배포판에 따라 차이가 있는 부분인데, 우리는 여기에서 Ubuntu 기준으로 설명하도록 하겠다.

$ sudo nano /etc/hostname

변경하고 싶은 호스트명

   - 다른 내용은 필요없고, 호스트명을 수정하면된다.

$ sudo hostname -F /etc/hostname

   - [ hostname ] 명령으로 확인하면 변경된 것을 확인할 수 있지만, 터미널을 다시 실행하는 것이 깔끔하다.



3. 뒷정리하기

   - 위와 같이 하면, 기본적으로 호스트명을 변경할 수 있지만 다른 부분도 손봐주는 것이 바람직하기에...

$ sudo nano /etc/hosts

127.0.0.1         localhost
127.0.0.1         변경한 호스트명
...


필자의 경험으로... 네트워크와 관련된 사항들은 재부팅을 해주는 것이 가장 깔끔하다!

반응형

그 동안 계속 한글 입력기로 "nabi"를 사용해왔지만,
Ubuntu 14.04에서 시스템 트레이를 지원하지 않고 있어서 조금 짜증이 나던 차에
최근 Chrome에서 계속 한글 입력 문제가 계속 되면서 더더더욱 짜증이 나서.... 바꿔 보기로 했다.

Ubuntu 12.04에서는 기본 환경에서 아래와 같이 진행할 수가 없다.
Chrome 한글 문제는 Ubuntu 12.04에서는 그냥 ibus 한글 입력기를 사용하는 것이 속편하다.

발음하기도 힘든 fcitx라고 하는 한글입력기를 사용해보고자 한다.
공식 홈페이지는 https://fcitx-im.org/wiki/Fcitx 이고, 여기에서 발음은 "파이틱스"(?)라고 한다.

설치는 바로~ ^^

$ sudo apt-get install fcitx-hangul

한글입력기는 설치하고 사용하려면 재부팅을 요구한다.
재부팅을 안해도 된다고 하면 방법을 누가 알려주기 바란다.

재부팅 후에 "시스템 설정"을 하고선 "언어 지원"을 실행하자.




"언어 설치/제거" 부분을 보면 fcitx를 선택할 수 있다.



상세한 설정을 위해서는 상단 시스템 트레이에서 키보드 모양을 선택하고 Configure를 실행하자.



그러면 아래와 같은 화면이 나온다.


한영키 설정을 하려면 "Global Config"를 선택하면 된다.


필자는 이렇게 해서 한글 입력 잘 되었다~!!! 성공~!!!

반응형

NFS를 사용하기 위해서 사용하는 포트가 지정된 1개가 아니다.
그러다보니 방화벽 환경에서 NFS를 사용하게 되면 당연히 문제가 발생한다.



[ portmap → rpcbind ]

포트를 활용하기 위하여 portmap을설치하려 했더니 다음과 같은 메시지가 나온다.

$ sudo apt-get install portmap
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'rpcbind' instead of 'portmap'
rpcbind is already the newest version.
rpcbind set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.


portmap 대신에 rpcbind 가 설치되어 있다는 말인데, 그렇다면 우리는 rpcbind를 사용하면 된다.



[ port 현황 확인 ]

지금 사용하고 있는 port 현황을 확인해보도록 하자.

$ rpcinfo -p
   program vers proto      port  service
    100000    4      tcp        111  portmapper
    100000    3      tcp        111  portmapper
    100000    2      tcp        111  portmapper
    100000    4      udp       111  portmapper
    100000    3      udp       111  portmapper
    100000    2      udp       111  portmapper
    100024    1      udp    38905  status
    100024    1      tcp     40987  status
    100003    2      tcp       2049  nfs
    100003    3      tcp       2049  nfs
    100003    4      tcp       2049  nfs
    100227    2      tcp       2049
    100227    3      tcp       2049
    100003    2      udp      2049  nfs
    100003    3      udp      2049  nfs
    100003    4      udp      2049  nfs
    100227    2      udp      2049
    100227    3      udp      2049
    100021    1      udp    54927  nlockmgr
    100021    3      udp    54927  nlockmgr
    100021    4      udp    54927  nlockmgr
    100021    1      tcp     44736  nlockmgr
    100021    3      tcp     44736  nlockmgr
    100021    4      tcp     44736  nlockmgr
    100005    1      udp    47711  mountd
    100005    1      tcp     53370  mountd
    100005    2      udp    48583  mountd
    100005    2      tcp     43514  mountd
    100005    3      udp    51022  mountd
    100005    3      tcp     52825  mountd



[ port 등록 ]

사용할 포트를 등록해보자.

$ sudo nano /etc/services

...
status            4000/tcp                        # rpc.statd tcp port
status            4000/udp                       # rpc.statd udp port
mountd          4002/tcp                        # mountd tcp port
mountd          4002/udp                       # mountd udp port
rquotad          4003/tcp                        # rpc.rquotad tcp port
rquotad          4003/udp                       # rpc.rquotad udp port
...

실행 옵션도 수정해주어야 한다.

$ sudo nano /etc/default/nfs-kernel-server

...
# RPCMOUNTDOPTS="--manage-gids"
RPCMOUNTDOPTS="-p 4002 -g"
...

다음의 파일을 수정해야 한다.
만약 없는 경우 새로 생성하면 된다.

$ sudo nano /etc/modprobe.d/options.conf

options lockd nlm_udpport=4001 nlm_tcpport=4001


그리고, 이젠 서비스를 재시작하자.

$ sudo service rpcbind restart
rpcbind stop/waiting
rpcbind start/running, process 2519

$ sudo service nfs-kernel-server restart
 * Stopping NFS kernel daemon                                                                            [ OK ]
 * Unexporting directories for NFS kernel daemon...                                                [ OK ]
 * Exporting directories for NFS kernel daemon...                                                    [ OK ]
 * Starting NFS kernel daemon                                                                              [ OK ]

정상적으로 적용이 잘 되었는지 확인해보자.

$ rpcinfo -p
   program vers proto   port  service
    100000    4   tcp        111  portmapper
    100000    3   tcp        111  portmapper
    100000    2   tcp        111  portmapper
    100000    4   udp       111  portmapper
    100000    3   udp       111  portmapper
    100000    2   udp       111  portmapper
    100024    1   udp     4000  status
    100024    1   tcp      4000  status
    100003    2   tcp      2049  nfs
    100003    3   tcp      2049  nfs
    100003    4   tcp      2049  nfs
    100227    2   tcp      2049
    100227    3   tcp      2049
    100003    2   udp     2049  nfs
    100003    3   udp     2049  nfs
    100003    4   udp     2049  nfs
    100227    2   udp     2049
    100227    3   udp     2049
    100021    1   udp     4001  nlockmgr
    100021    3   udp     4001  nlockmgr
    100021    4   udp     4001  nlockmgr
    100021    1   tcp      4001  nlockmgr
    100021    3   tcp      4001  nlockmgr
    100021    4   tcp      4001  nlockmgr
    100005    1   udp     4002  mountd
    100005    1   tcp      4002  mountd
    100005    2   udp     4002  mountd
    100005    2   tcp      4002  mountd
    100005    3   udp     4002  mountd
    100005    3   tcp      4002  mountd



위와같이 되었다고 하면 이제 포트가 고정이 되었으니 방화벽에 포트 등록을 해주면 된다.

111 (portmap), 2049 (nfs), 4000 (status), 4001 (nfs lock manager), 4002 (mountd), 4003 (rquotad)

 

반응형

원격에 있는 파일시스템을 사용하기 위해서 사용할 수 있는 방법 중에 가장 유명하고 대중적인 NFS.
NFS(Network File System)는 SUN에서 개발한 RPC(Remote Procedure Call) 기반 시스템이다.


NFS를 사용하는 것은 2대의 PC 사이에서 이루어지는 Server-Client 구조다.



[ Server ]

우선 Server 패키지를 설치해야 한다.

sudo apt-get install nfs-kernel-server


제공해줄 디렉토리를 하나 생성해준다.

$ sudo mkdir ./nfs
$ sudo chmod 777 ./nfs

디렉토리 생성을 꼭 sudo 권한으로 할 필요는 없다. 중요한 것은 777 권한을 부여해주어야 하는 것이다.

그런 다음 필요한 것은, 공유하고 싶은 내용을 환경 설정을 해줘야 한다.

sudo nano /etc/exports

※ VirtualBox 내부 통신을 위해서는 : http://nan1004au.tistory.com/18

# /etc/exports: the access control list for filesystems which may be exported

#               to NFS clients.  See exports(5).

#

# Example for NFSv2 and NFSv3:

# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)

#

# Example for NFSv4:

# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)

# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)

#

/srv/nfs 192.168.56.*(rw,no_root_squash,sync,no_subtree_check)


당연히 알겠지만, 위의 IP에서 *표는 각자의 실제 IP로 대체할 수 있다.
그리고 사용할 수 있는 옵션이 엄청 많지만...
필자는 (rw,no_root_squash,sync,no_subtree_check) 정도만으로도 충분한 것 같다.

온갖 인터넷 서핑을 하고, man 내용 살펴보고, 나름 발번역도 해보고 해서 아래와 같이 정리는 했지만
실제 모든 옵션을 테스트 해보지는 않아서 설명이 올바른지는 확인하지 못했다.

옵션 기본값 설명
ro / rw 파일 시스템을 읽기 전용으로 하거나 read-write 가능하도록 마운트
root_squash /
no_root_squash
no_root_squash 이 옵션을 사용하면, 로컬 사용자와 원격 사용자를 모두 ID 0 즉 root로 취급한다. 따라서 원격 사용자는 파일과 디렉토리에 대한 모든 권한을 획득할 수 있다. 모든 유저를 믿을 수 있다면, 편리하게 사용할 수 있지만 보안에 취약할 수 있다. 서버와 클라이언트의 root 사용자를 같도록 설정한다. Default 값으로 루트 사용자의 사용자 ID와 그룹 ID는 모두 0 이다. 이 옵션을 사용하시면 익명 사용자의 사용자 ID와 그룹 ID에 사용자 ID 0와 그룹 ID 0를 부여하여 원격 루트 사용자를 로컬 루트로 취급한다. 따라서 클라이언트 상의 루트 사용자는 디렉토리를 내보내기할 수 있는 권한을 갖게 된다. 이 옵션을 선택하시면 시스템 보안이 매우 약해진다. 절대로 필요한 상황이 아니면 root_squash 옵션을 선택하지 마라.
all_squash /
no_all_squash
no_all_squash 클라이언트 사용자를 익명(anonymous) 사용자로 취급한다. 이 옵션이 선택되면 모든 사용자 ID와 그룹 ID는 익명 사용자로 취급된다.

[no_all_squash] root 이외의 모든 사용자에 대해 같은 UID를 갖는 사용자는 동일한 권한을 준다. 모든 사용자는 nobody. (default)
anonuid 익명 사용자를 위한 사용자 ID를 지정하실 수 있다.
anongid 익명 사용자를 위한 그룹 ID를 지정하실 수 있다.
insecure 인증되지 않은 액세스도 가능
sync / async 파일을 쓸때 서버와 클라이언트 싱크를 맞춘다. 서버는 데이터가 저장소에 안전히 쓰였음을 확인 한 후, 응답을 보낸다. 변경 사항을 디스크에 기록하기 전에는 서버가 요청에 응답하는 것을 허용하지 않는다.

[async] sync 옵션을 사용하지 않는 경우에 해당 한다.
서버는 데이터가 저장소에 안전히 저장됐는지를 확인하지 않는다.
클라이언트의 데이터 쓰기 요청이 들어오면 바로 응답을 보낸다.
데이터 curruption이 발생할 수 있지만 성능 향상을 기대할 수 있다.
no_subtree_check 파일 시스템의 전체 디렉토리가 아닌 하부 디렉토리가 내보내진 경우,
서버는 내보낸 하부 디렉토리에 요청된 파일이 존재하는지를 검사한다. 이러한 검사 과정을 하부구조 검사라고 부른다. 이 옵션을 선택하시면 하부구조 검사를 사용하지 않는다. 전체 파일 시스템이 내보내진 경우에 이 옵션을 선택하면 하부구조 검사를 하지 않음으로서 전송률을 높일 수 있다. 
no_wdelay 즉시 쓰기 작업 동기화를 강제한다. 즉, 즉시 디스크에 기록한다.

설정을 모두 마쳤으면, 재시작!

$ sudo service nfs-kernel-server restart





[ Client ]

NFS를 사용하기 위한 기본 패키지를 설치하자.

sudo apt-get install nfs-common


마운트하여 사용할 디렉토리를 생성하자.

$ sudo mkdir ./nfsclient


다시 한 번 말하지만, 꼭 sudo 권한으로 할 필요는 없다.
실제 사용할 목적에 맞춰서 적절히 권한을 설정해주면 된다.

이제 mount를 하면 된다.

sudo mount -t nfs -o nolock 10.89.54.*:/srv/nfs /srv/nfsclient


위와 같이 따라하면 일단, NFS를 이용해서 원격으로 접근하여 파일시스템을 사용할 수 있다.
당연히 알겠지만 위의 IP 부분은 NFS Server를 하고 있는 아이의 IP로 적어주면 된다.

하지만, 우리가 원하는 것은... 재부팅을 하여도 계속 연결되어 있는 파일시스템일 것이다.
그렇게 하기 위해서는 아래와 같이 fstab 설정을 진행하여주면 된다.



[ fstab for NFS ]

파일시스템을 관리하기 위해 종종 사용했을 것이다.
일반적인 스타일로는 아래와 같이 진행하면 된다.

[파일시스템 장치명] [마운트 포인트] [파일시스템 종류] [옵션] [dump관련설정] [파일점검 옵션]


< 옵션 >

옵션 기본값 설명
auto / noauto auto  부팅시 자동 마운트 여부
exec / no exec exec 실행파일이 실행되는 것을 허용 여부
ro / rw rw (read only) or (read write)
suid / nosuid suid setuid, setgid의 사용 허용 여부
user / nouser nouser 일반 계정 사용자들도 마운트 할 수 있도록 하거나 root만 mount 가능
usrquota   일반 사용자 quota적용
grpquota   그룹 quota 적용


< dump >

0 : 덤프되지 않은 파일시스템
1 : 데이터 백업을 위해 dump가능

 
< 파일점검 >

0 : 부팅시 fsck를 사용하지 않음
1 : 루트 파일시스템을 의미
2 : 루트 파일시스템 이외의 파일시스템을 의미


하지만, 일반적으로 fstab을 사용한다고 하면 위의 옵션들로 충분하지만,
우리는 조금 특이한 NFS를 사용을 하기에 조금 다른 옵션들을 사용할 수 있다.

하지만 아래 내용은 인터넷 짜집기와 나름의 발번역으로 정리한 것이다.
실제 옵션을 모두 확인해보지는 못했기에 보증하지는 못하겠다.

옵션 기본값 설명
rsize=n The  number of bytes NFS uses when reading files from an NFS server.
The rsize is negotiated between the server and client to determine the largest block size that both can support. The value specified by this option is the maximum size that could be used; however, the actual size used may be smaller. Note: Setting this size to a value  less  than  the largest supported block size will adversely affect performance.
wsize=n The number of bytes NFS uses when writing  files to  an NFS  server.
The wsize is negotiated between the server and client to determine the largest block size that both can support. The value specified by this option is the maximum size that could be used;  however, the actual size used may be smaller. Note: Setting this size to a value less than the largest supported block size  will adversely affect performance.
timeo=n The value in tenths of a second before sending the first retransmission after an RPC timeout. The default value is 7 tenths of a second. After the first timeout, the timeout is doubled after each successive timeout until a maximum timeout of 60 seconds is reached or the enough retransmissions have occured to cause a major timeout. Then, if the filesystem is hard mounted, each new time-out cascade restarts at twice the initial value of the previous cascade, again doubling at each retransmission. The maximum timeout is always 60 seconds. Better overall performance may be achieved by increasing the time-out when mounting on a busy network, to a slow server, or through several routers or gateways.
retrans=n 3 The number of minor timeouts and retransmissions that must occur before a major timeout occurs. When a major timeout occurs, the file operation is either aborted or a "server not responding" message is printed on the console.
acregmin=n 3 The minimum time in seconds that attributes of a regular file should be cached before requesting fresh information from a server.
acregmax=n 60 The maximum time in seconds that attributes of a regular file can be cached before requesting  fresh  information from a server.
acdirmin=n 30 The minimum time in seconds that attributes of a directory should be cached before requesting fresh information from a server.
acdirmax=n 60 The maximum time in seconds that attributes of a directory can be cached before requesting fresh information from a server.
actimeo=n Using  actimeo sets all of acregmin, acregmax, acdirmin, and acdirmax to the same value. There is no default value.
retry=n The number of minutes to retry an NFS mount operation in the foreground or  background  before  giving up. The default value for forground mounts is 2 minutes. The default value for background mounts is 10000 minutes, which is roughly one week.
namlen=n 255 NFS 서버가 RPC 마운트 프로토콜의 버전 2를 지원하지 않을 때 원격 파일 시스템에서 지원되는 파일명의 길이를 명시한다. POSIX pathconf 함수를 지원하기 위해서 사용된다.
port=n The numeric value of the port to connect to the NFS server on. If the port number is 0 (the default) then query the remote host's portmapper for the  port number to  use. If the remote host's NFS daemon is not registered with its portmapper, the standard NFS port number 2049 is used instead.
proto=n Mount the NFS filesystem using a specific network protocol instead of  the default TCP protocol. Valid protocol types are udp and tcp.
mountport=n mountd 포트 번호 지정하기
mountprog=n 100005 원격 호스트의 마운트 데몬과 접속하기 위해 사용할 수 있는 별도의 RPC 프로그램 번호를 정한다. NFS 서버를 여러 개 운영하고 있을 때 유용하다.
mountvers=n Use an alternate RPC version number to contact the mount daemon on the remote host. This option is useful for hosts that can run multiple NFS servers.
The default value depends on which kernel you are using.
nfsprog=n 100003 원격 호스트의 NFS 데몬과 접속하기 위해 사용하는 별도의 RPC 프로그램 번호를 정한다. NFS 서버를 여러 개 운영하고 있을 때 사용한다.
nfsvers=n 원격 호스트의 NFS 데몬과 접속하기 위해 사용하는 별도의 RPC 버전 번호를 정한다. NFS 서버를 여러 개 운영하고 있을 때 사용한다.
vers=n vers is an alternative to nfsvers and is compatible with many other operating systems.
nolock Disable NFS locking. Do not  start  lockd. This has to be used with some old NFS servers that don't support locking.
bg If the first NFS mount attempt times out, retry the mount in the background.
After a mount operation is backgrounded, all subsequent mounts on the same NFS server will be backgrounded immediately, without first attempting the mount. A missing  mount  point is treated as a timeout, to allow for nested NFS mounts.
fg If the first NFS mount attempt times out, retry the mount in the foreground.  This is the complement of the  bg  option, and  also  the default behavior.
soft If an NFS file operation has a major timeout then report an I/O error to the calling program. The default is to continue retrying NFS file operations indefinitely.
hard If an NFS file operation has a major timeout then report "server not responding" on the console and continue retrying indefinitely. This is the default.
intr If an NFS file operation has a major timeout and it is hard mounted, then allow signals to interupt the file operation and cause it to return EINTR to the calling program. The default is to not allow file operations to be interrupted.
posix POSIX 규칙을 사용하여 NFS 파일 시스템을 마운트한다. 파일명 최대 길이에 POSIX pathconf 함수를 제대로 지원을 위해서 사용된다. 원격 호스트는 RPC 마운트 프로토콜 버전 2를 지원해야 한다. 많은 NFS 서버들이 아직 버전 1만을 지원하고 있다.
nocto Suppress the retrieval of new attributes when creating a file.
noac Disable all forms of attribute caching entirely. This extracts a significant  performance penalty but it allows two different NFS clients to get reasonable results when both clients are actively writing to a common export on the server.
noacl Disables Access Control List (ACL) processing.
resvport/noresvport

Specifies whether the NFS client should use a privileged source port when communicating with an NFS server for this mount point. If this option is not specified, or the resvport option is specified, the NFS client uses a privileged source port. If the noresvport option is specified, the NFS client uses a nonprivileged source port.
Using non-privileged source ports helps increase the maximum number of NFS mount points allowed on a client, but NFS servers must be configured to allow clients to connect via non-privileged source ports.

sec=mode Set the security flavor for this mount to "mode". The default setting is sec=sys, which uses local unix uids and gids to authenticate NFS operations (AUTH_SYS). Other currently supported settings are:  sec=krb5, which uses Kerberos V5 instead of local unix uids and gids to  authenticate  users; sec=krb5i, which uses Kerberos V5 for user authentication and performs integrity checking of NFS operations using secure checksums to prevent data tampering; and sec=krb5p, which uses Kerberos V5 for user authentication and integrity checking, and encrypts NFS traffic to prevent traffic sniffing (this is the most secure setting). Note that there is a performance penalty when using integrity or privacy.
tcp / udp tcp 많은 NFS 서버들이 UDP만을 지원하지만, TCP 프로토콜을 사용할 수도 있다.
nordirplus Disables NFSv3 READDIRPLUS RPCs. Use this options when mounting servers that don't support or have broken READDIRPLUS implementations.
nosharecache As of kernel 2.6.18, it is no longer possible to mount the same  same filesystem with different mount options to a new mountpoint.  It was deemed unsafe to do so, since cached data cannot  be shared  between  the two mountpoints. In consequence, files or directories that were common  to both  mountpoint subtrees could often be seen to be out of sync following an update. This option allows administrators to select the pre-2.6.18 behaviour, permitting the same filesystem to be mounted with different mount options.
Beware: Use of this option is not recommended unless you are certain that there are no hard links or subtrees of this mountpoint that are mounted elsewhere.
lookupcache=type

This option dictates how directories and files should be cached when they are accessed -- i.e. "looked up" -- on the server. A lookup can  be either positive (directory/file was found) or negative (directory/file was not found);  both types of lookups can be cached.
By default, both positive and negative lookups are cached(lookupcache=all). lookupcache=pos prevents negative lookups from being cached, while lookupcache=none prevents all lookups from being cached.
Note:  lookupcache=none can adversely affect performance, but may be necessary if shared files created or deleted on the server need to be immediately visible to any applications running on NFS clients.


특히, NFS4를 위해서는 더 다양한 옵션이 있다. 사실 그리 반갑지는 않다.
특히 전체를 테스트해보지 못했다라는 것이 개인적으로는 무언가 아쉽다.

옵션 기본값 설명
rsize=n The number of bytes nfs4 uses when reading files from the server. The rsize is negotiated between the server  and client to determine the largest block size that both can support. The value specified by this option is the maximum size that could be used; however, the actual size used may be smaller.
Note: Setting this size to a value less than the largest supported block  size  will adversely affect performance.
wsize=n The number of bytes nfs4 uses when writing files to the server. The wsize is negotiated between the server and client to determine the largest block size that both can support. The value specified by this option is the maximum size that could be used; however, the actual size used  may be smaller.
Note: Setting this size to a value less than the largest supported block  size  will adversely affect performance.
timeo=n The value in tenths of a second before sending the first retransmission after  an  RPC timeout. The default value depends on whether proto=udp or proto=tcp is in effect (see below). The default value for UDP is 7  tenths of a second. The default value for TCP is 60 seconds.
After the first timeout, the timeout is doubled after each successive timeout until a maximum timeout of 60 seconds is reached or the enough  retransmissions have occured to cause a major timeout. Then, if the filesystem is hard mounted, each new timeout cascade restarts at twice the initial value of the previous cascade, again doubling at each retransmission. The maximum timeout is always 60 seconds.
retrans=n 5 / 2

주 타임아웃을 발생하기 전에 부 타임아웃과 재전송 횟수를 정한다. (proto=udp)인 경우에는 5, (proto=tcp)인 경우에는 2가 기본값이다. 주 타임아웃이 일어나면 파일 작업이 중지되거나 콘솔 상에 "server not responding" 메시지가 출력된다.

acregmin=n 3 서버에게 최신 정보를 요청하기에 앞서 일반 파일의 속성이 캐쉬되어야 할 시간의 최소값을 정한다.
acregmax=n 60 서버에게 최신 정보를 요청하기에 앞서 일반 파일의 속성이 캐쉬되어야 할 시간의 최대값을 정한다.
acdirmin=n 30 서버에게 최신 정보를 요청하기에 앞서 디렉토리의 속성이 캐쉬되어야 할 시간의 최소값을 정한다.
acdirmax=n 60 서버에게 최신 정보를 요청하기에 앞서 디렉토리의 속성이 캐쉬되어야 할 시간의 최대값을 정한다.
actimeo=n 이 값을 다음 acregmin, acregmax, acdirmin, acdirmax에 똑같이 적용한다.
retry=n 2 / 10000 포그라운드 또는 백그라운드에서 진행 중인 NFS 마운트 작업이 포기하기 전까지 실행할 시간(분, minutes)을 정한다. 포그라운드의 경우 2분, 백그라운드는 10000분(약 1주)이 기본값이다.
port=n 0 / 2049 NFS 서버와 연결할 수 있는 포트 번호를 정한다. 만약 0이라면 원격 호스트의 portmapper에게 질의하여 알아내도록 하고, 포트매퍼에 NFS 데몬이 등록되어 있지 않은 경우에는 2049라는 표준 NFS 포트 번호가 사용된다.
proto=n Mount the NFS filesystem using a specific network protocol instead  of  the  default TCP protocol. Valid protocol types are udp and tcp. Many NFS version 4 servers only support the TCP protocol.
clientaddr=n On a multi-homed client, this causes the client to use a specific callback address when communicating with an NFS version 4 server. This option is currently ignored.
sec=mode Same as sec=mode for the nfs filesystem type (see above).
bg / fg fg 첫번째 NFS 마운트 시도에서 타임아웃이 걸리면 포그라운드로 실행하거나 (fg),
타임아웃 걸리면 백그라운드에서 실행(bg)을 하도록 한다. bg 옵션을 보완하는 것이 fg 옵션이다.
After a mount operation is backgrounded, all  subsequent mounts on  the same NFS server will be backgrounded immediately, without first attempting the  mount. A missing mount point is treated as a timeout, to allow for nested NFS mounts.
soft / hard hard NFS 파일 작업에서 주 타임아웃이 걸리면 콘솔상에 "server not responding"이라고 출력하고 무한히 재시도하하거나(hard) 프로그램에게 I/O 에러를 보고한다(soft).
intr (none) 주 타임아웃이 생기고 하드 마운트된 상태라면 파일 작업을 중지하도록 시그널을 보내도록 허용하고 EINTR 시그널을 보낸다. 기본값은 파일 작업을 인터럽트하지 않는 것이다.
nocto 파일이 생성될 때 새로운 속성을 검색하는 것을 금한다.
noac 모든 속성 캐쉬를 못하게 하고, 강제로 동기를 맞춰서 쓴다. 서버 효율을 떨어뜨리기는 하지만 두 개의 다른 NFS 클라이언트로 하여금 서버 상의 공통 파일 시스템에 쓰기 작업을 할 때 좋은 효율을 얻을 수 있게 해준다.
nosharecache As of kernel 2.6.18, it is no longer possible to mount  the same filesystem with different mount options to a new mountpoint. It was deemed unsafe to do so, since cached data cannot be shared between the two mountpoints. In consequence, files or directories that were common to both mountpoint subtrees could often be seen to be out of sync following an update. This option allows administrators to select the pre-2.6.18 behaviour, permitting the same filesystem to be mounted with different mount options.
Beware: Use of this option is not recommended unless you are certain that there are no hard links or subtrees of this mountpoint that are mounted elsewhere.
lookupcache=type This option dictates how directories and files should be cached when they are accessed --  i.e. "looked  up"  -- on  the server.
A lookup can be either positive (directory/file was  found) or negative (directory/file was not found); both types of lookups can be cached.
By default, both positive and negative lookups are cached (lookupcache=all ).
lookupcache=pos prevents negative lookups from being cached, while  lookupcache=none prevents all lookups from being cached.
Note: lookupcache=none can adversely affect performance, but may be necessary if shared files created or deleted on the server need to be immediately visible to any applications running on NFS clients.


무언가 옵션이 엄청 많고 하나 하나 설정을 해주면 좋을 것 같은데,
개인적으로 이만큼 알아보는 것만으로도 정말 많은 시간을 빼앗기다보니.... 일일이 테스트해보지를 못했다.
정말 아쉽기는 한데, 구글링을 열심히 해봐도 저 많은 옵션을 일일이 셋팅하는 경우가 많지는 않아서 안심이다.



일단 아래와 같이 정말 간단하게 해보자.
당연히 [ NFS Client ]에서 수행하는 것이다.

sudo nano /etc/fstab

...


192.168.56.102:/srv/nfs /srv/nfsclient nfs defaults 0 0


입력을 잘하였으면 이제는 잘 동작하는지 확인을 해볼차례다. 재부팅!!!! 고고!!!
재부팅 후에 설정한 디렉토리를 살펴보자. 잘 연결되어 있으면 성공!!!

위와 같이 그대로 했을 때 필자는 성공을 했으므로
만약 여러분이 그대로 했는데 안되었다면 무언가 중간에 놓친 것이 있거나 상황이 다른 것이니 확인을 해보기 바란다.



이 외에 Firewall 환경에서의 포트 제한 등에 대해서는 다른 포스트로 설명하도록 하겠다.

반응형

도구 성능 테스트를 위해서 용량이 큰 파일이 필요한데,
마땅히 구할 방도가 없어서 고민하던 중 필요한 사이즈의 더미 파일을 만들어 볼 생각을 해봤다.

그랬더니, 이와 같은 고민을 하는 사람이 많다는 사실을 알게 되었고,
이러한 파일을 만드는 방법을 제공해주고 있다는 사실도 알게 되었다.

$ dd if=/dev/zero of=[filename] bs=[blocksize] count=[repeat]

 실제 사용 방법은 아래와 같다.

$ dd if=/dev/zero of=./test bs=100M count=2

위와 같이 하면 200M 크기의 test라는 이름의 파일이 생성된다.


count의 용도는 다음과 같다.

$ dd if=/dev/zero of=./10G bs=10G count=1
dd: memory exhausted by input buffer of size 10737418240 bytes (10 GiB)

10GB짜리 파일 하나를 만들려고 하는데 10GB x 1 count로 만들면 위와 같이 메모리 에러가 발생할 수 있다.

$ dd if=/dev/zero of=./10G bs=1G count=10
10+0 레코드 들어옴
10+0 레코드 나감
10737418240 바이트 (11 GB) 복사됨, 74.6861 초, 144 MB/초

그런데, 위와 같이 1GB 짜리를 10번 반복해서 만들라고 하면 된다!
이러한 것을 잘 이용하면 더 멋지게 컴퓨터 생활을 할 수 있을 것이다.


반응형

HDD를 물리적으로 추가하였는데, Ubuntu에서 자동으로 붙지 않는다.
USB 같은 것은 자동으로 잘 잡아주면서... 이거 왠지 사용자 친화적이지 않다.

그래서, CLI로 추가 작업을 진행해주어야 한다.


1. HDD 잘 인식하는지 확인하기

   - HDD 관련 작업은 fdisk 명령어로 대부분 처리할 수 있다.

$ sudo fdisk -l

Disk /dev/sda: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 cylinders, total 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00089aab

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   100663295    50330624   83  Linux
/dev/sda2       100665342   104855551     2095105    5  Extended
/dev/sda5       100665344   104855551     2095104   82  Linux swap / Solaris

Disk /dev/sdb: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders, total 419430400 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sdb doesn't contain a valid partition table

   - /dev/sda 는 잘 연결되어 있고, /dev/sdb는 물리적으로만 잘 붙어있다는 것을 확인할 수 있다.
   - 친절히 제일 마지막 줄에 파티션 테이블도 안만들어져 있다고 알려주고 있다.


2. 파티션 작업

   - 앞에서 찾아낸 작업해야할 HDD를 지정해서 파티션 작업을 진행하면 된다.

$ sudo fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xb9110add.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-419430399, default 2048): (enter)
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-419430399, default 419430399): (enter)
Using default value 419430399

Command (m for help): p

Disk /dev/sdb: 214.7 GB, 214748364800 bytes
255 heads, 63 sectors/track, 26108 cylinders, total 419430400 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xb9110add

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048   419430399   209714176   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

   - 각자의 상황에 따라 위와 같이 출력되지 않거나 다른 옵션을 선택해야할 경우도 있을 것이다.
   - 일단은 필자의 상황으로 설명을 하도록 하겠다. 다양한 옵션에 대한 설명은 생략!


3. 포맷

   - 파티션 작업을 했다고 바로 사용할 수는 없다. 포맷을 하고 사용해야 한다. 파일시스템을 만들어주는 과정이다.

$ sudo mkfs.ext4 /dev/sdb1
mke2fs 1.42.9 (4-Feb-2014)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
13107200 inodes, 52428544 blocks
2621427 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
1600 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
 4096000, 7962624, 11239424, 20480000, 23887872

Allocating group tables: done                           
Writing inode tables: done                           
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

   - ext4가 아닌 다른 파일시스템을 사용할 사람은 바꾸면 된다.


4. UUID 확인

   - 앞에서 붙인 HDD를 다루기 위해서는 고유의 값인 UUID를 알아야 한다.

$ ls -l /dev/disk/by-uuid/
합계 0
lrwxrwxrwx 1 root root 10  6월 22 18:22 29f6905f-be40-4321-b7c0-7658f2cb4c3e -> ../../sdb1
lrwxrwxrwx 1 root root 10  6월 22 18:06 822b2062-39d1-4ba3-ab4d-fdc332fec050 -> ../../sda5
lrwxrwxrwx 1 root root 10  6월 22 18:06 94200076-d0b4-4dea-97d4-ee5bedc01bf5 -> ../../sda1


5. mount 등록

   - 방금 만든 파티션은 지금 접근해서 사용할 수는 없다. 파티션을 마운트(mount) 해주어야 사용할 수가 있는 것이다.
   - 하지만, 한 번만 사용할 것이 아니라 매번 부팅할 때마다 마운트 되는 것이 필요하다.

$ sudo mkdir /srv/repository

   - 마운트 하고자 하는 경로의 디렉토리를 미리 만들어 두자.

$ sudo nano /etc/fstab

...
UUID=29f6905f-be40-4321-b7c0-7658f2cb4c3e       /srv/repository ext4    errors=remount-ro       0       1

   - 부팅 時 자동으로 마운트할 내용을 위와 같이 적어주면 된다.

$ sudo mount -a

   - 재부팅하지 않아도 마운트 시킬 수 있다.

$ sudo chown hp14:hp14 /srv/repository

   - 권한은 마운트 뒤에 설정해주면 적용된다.


6. 확인

   - 잘 붙었는지 확인해보자.

$ df -h
Filesystem      Size     Used    Avail   Use%    Mounted on
/dev/sda1        48G       11G     35G     24%     /
none               4.0K          0     4.0K      0%      /sys/fs/cgroup
udev               991M     4.0K    991M     1%      /dev
tmpfs              201M     900K    200M    1%      /run
none               5.0M          0     5.0M    0%      /run/lock
none             1002M       76K   1001M   1%      /run/shm
none              100M        40K    100M   1%      /run/user
/dev/sdb1       197G       60M    187G   1%      /srv/repository



여기까지 하면 끄~~읕


반응형

기본 한글입력기인 ibus를 사용하는 것은 왠지 불편하다.
그래서 대중적인, 리눅스를 사용하는 한국인이라면 왠지 다 알고 있어야 할 것 같은 nabi를 사용하곤 한다.

설치는 정말 쉽다.

sudo apt-get install nabi

그런 다음 [설정] - [언어 지원] - [키보드 입력기]를 선택하면 된다.


"Hangul"로 설정하고 나서 로그아웃/로그인 또는 재부팅을 하면 다음과 같은 팝업을 볼 수 있다.


이제는 편하게 한글을 사용하면 되긴 하는데... 여기에서 이슈는 저 팝업창을 없애버리고 싶은 충동이다!

12.04 버전까지만해도 시스템트레이로 옮기기를 하면 되었느데,
최근에는 이러한 기능을 공식적으로 지원하지 않는다. 지원하지 않는 것이 아니라 막았다고 보는 것이 맞을 것이다.

사실 이는 Ubuntu 측에서 지원하지 않는 것이 아니라 다른 방식을 지원하는 것이고,
새로운 방식을 nabi가 지원하지 않는다라는 것이 더 정확한 대답일 것이다.


물론 우리의 뛰어난 리눅서분들은 이러한 상황을 극복할 수 있는 방법들을 만들어내었다.
그런데, 좀 문제가 있는 것이... 기존 패키지 내용을 패치하는 방식을 통해서 해결을 하고 있는 것이다.
PPA 추가를 통해서 제공하지 않는 기능을 제공하도록 패치를 하는 것이다 보니
지속적으로 사용 가능한지에 대해서 보장을 할 수가 없다.


깔끔하게 사용하기 위해서는 IBus 방식을 사용하던지 아니면
그냥 위와 같이 별도의 팝업으로 뜨도록 내버려두는 것을 권장한다.

반응형

+ Recent posts