원격에 있는 파일시스템을 사용하기 위해서 사용할 수 있는 방법 중에 가장 유명하고 대중적인 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 환경에서의 포트 제한 등에 대해서는 다른 포스트로 설명하도록 하겠다.

반응형

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



여기까지 하면 끄~~읕


반응형

Ubuntu 11.10을 설치해서 사용하다보면 한글 관련해서 문제가 좀 있다.


처음 설치하고 나면 기본 '키보드 입력 시스템'은 "ibus"인데,
이걸로 쓰다보면 한글 입력할 때 아주 많이 불편하다.

"머가" 입력하고 한 칸 띈 다음에 "필요해"라고 입력을 하면,
"머 가필요해"라고 입력이 되어버린다. 즉, 띄어쓰기가 앞 글자에 적용이 되어버린다.

'ibus'에 있는 버그라고 하는데, 이게 빨리 안고쳐지고 있다.


그래서, 추천하는 방식이 바로 "nabi" 이다.
"nabi"로 변경 후 재부팅하면 멋지게 한글을 사용할 수 있게 된다.




그런데, 친절하게 안내를 해주는 것은 좋은데 화면에 턱!하니 나와있는 것이 조금 보기 싫다.

일단, 당장 화면에 안보이게 하는 방법은 오른쪽에 있는 설정 버튼 (톱니바퀴) 을 누르면 나오는 메뉴에서
"팔레트 숨기기"를 누르면 화면에서 샤라락 사라진다.

하지만, 재부팅하면 다시 쨘~하고 나타난다. 1회용 방법이라는 의미~




그러면 지속적으로 보이지 않게, 더불어 위의 트레이로 들어가게 하려면 어떻게 해야할까!?


 $ gsettings get com.canonical.Unity.Panel systray-whitelist

위의 명령어를 입력하면 스크린샷과 같이 목록이 나타난다.
유니티 패널의 시스템트레이에 등록되어있는 목록이다.
여기에 Nabi를 추가하면 된다.


 $ gsettings set com.canonical.Unity.Panel systray-whitelist "['JavaEmbeddedFrame', 'Wine', 'scp-dbus-service', 'Update-notifier', 'Nabi' ]"

즉, get을 set으로 바꾸고, 위에서 나온 목록에 "Nabi"를 추가해주면 된다.

그런데, 화면에 'Nabi' 팔레트가 그대로 보일 것이다. 응!?

재부팅을 하면 된다~


그러면, 위의 트레이에 예쁜 나비가 보일 것이다.


여기까지~ ^^



Modify 2013.05.18 22:49

Ubuntu 13.04 에서 이상한 현상이 있다고 댓글을 남겨주신 분이 계셔서 테스트를 진행해 보았다.


1. 기본 상태에서의 한글

   - 개인적으로 지식이 부족하다보니, ibus와 nabi 입력기의 차이가 무엇인지 잘 알지 못한다.
   - 위에서 nabi를 셋팅한 이유는 단지, ibus에서의 한글 입력에 문제가 있었기 때문이다.

   - 그런데, Ubuntu 13.04 에서의 기본 상태에서 한글 입력은 잘 되었다 !!
   - 밀려 쓰기 같은 증상이 발생하지 않았다 !!!

$ ibus-daemon --version
ibus-daemon - Version 1.4.2

   - 개인적으로 굳이 다른 한글 입력기를 사용할 이유는 없어보인다.


2. nabi 설치

   - 그럼에도 불구하고 어떤 이유가 있어서 nabi 입력기를 설치해야한다고 하면... 해야하는데...


   - 언어지원의 키보드 입력기를 보면... nabi가 없다. 설치하자.

$ sudo apt-get install nabi
$ sudo reboot

   - 그런데, nabi를 설치를 했는데, 언어 지원 메뉴를 보면 다른 이름으로 입력기가 추가되어 있다.




3. 시스템트레이 whitelist 확인하기

   - Unity의 Panel에 대한 셋팅으로 nabi를 트레이로 넣기 위해서 먼저 확인을 해야 한다.

$ gsettings get com.canonical.Unity.Panel systray-whitelist
'com.canonical.Unity.Panel' 스키마가 없습니다

   - 이건 또 뭔 소리이지 ?!



4. systray fix

   - systray-whitelist에 대한 설정을 하기 위해서는 apt repository를 하나 추가해서 변경된 패키지를 설치해야 한다.

$ sudo apt-add-repository ppa:timekiller/unity-systrayfix
$ sudo apt-get update
$ sudo apt-get upgrade

   - 이제 다시 확인을 해보자.

$ gsettings get com.canonical.Unity.Panel systray-whitelist
['JavaEmbeddedFrame', 'Wine', 'Update-notifier']

   - 됐다 !
 


5. nabi 추가

   - 이제 앞에서 했던대로 Nabi를 tray로 추가하자.

$ gsettings set com.canonical.Unity.Panel systray-whitelist "['JavaEmbeddedFrame', 'Wine', 'Update-notifier', 'Nabi']"
$ sudo reboot

   - 재부팅을 해보면 확인이 된다.



성공 ~~~!!!

반응형


01. 기본 패키지 설치

$ sudo apt-get install build-essential libpcre3-dev libruby libssl-dev libcurl4-openssl-dev libpq-dev libreadline-dev libjpeg62-dev libpng12-dev curl openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev autoconf libc6-dev libncurses5-dev automake libtool bison pkg-config


02. Ruby 설치

$ sudo su -
$ curl -L https://get.rvm.io | sudo bash -s stable
$ source /etc/profile
$ rvm install 2.0.0
$ rvm use 2.0.0
$ rvm --default use 2.0.0

$ nano /etc/environment


PATH="......:/usr/local/rvm/bin"




03. Rails 설치

$ gem install rdoc
$ gem install rails -v 3.2.13
 

04. PostgreSQL 설치 및 설정

$ apt-get install postgresql

$ su - postgres
$ psql

# CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD 'my_password' NOINHERIT VALID UNTIL 'infinity';
# CREATE DATABASE redmine WITH ENCODING='UTF8' OWNER=redmine;
# \q

$ exit
$ gem install pg


05. ImageMagick

$ apt-get install imagemagick librmagick-ruby libmagickwand-dev
$ gem install rmagick



06. Redmine

$ cd /srv/install/
$ wget http://www.redmine.org/releases/redmine-2.4.1.tar.gz
$ tar zxvf  redmine-2.4.1.tar.gz


07. bundler & install

$ cd redmine-2.4.1
$ gem install bundler

$ reboot

$ sudo su -
$ cd /srv/install/redmine-2.4.1
$ bundle install --without development test mysql sqlite


08. Apache2 설치

$ apt-get install apache2 apache2-prefork-dev


 

09. passenger 설치

$ gem install passenger
$ cd /usr/local/rvm/gems/ruby-2.0.0-p353/gems/passenger-4.0.29/
./bin/passenger-install-apache2-module

 

$ nano /etc/apache2/mods-available/passenger.conf

<IfModule mod_passenger.c>
   PassengerUser www-data
   PassengerDefaultUser www-data

   PassengerRoot /usr/local/rvm/gems/ruby-2.0.0-p353/gems/passenger-4.0.29
   PassengerDefaultRuby /usr/local/rvm/wrappers/ruby-2.0.0-p353/ruby
</IfModule>

$ nano /etc/apache2/mods-available/passenger.load

LoadModule passenger_module /usr/local/rvm/gems/ruby-2.0.0-p353/gems/passenger-4.0.29/buildout/apache2/mod_passenger.so


$ cd /etc/apache2/mods-enabled
ln -s ../mods-available/passenger.conf ./passenger.conf
ln -s ../mods-available/passenger.load ./passenger.load


10. database 설정값 등록

$ cd /srv/install/redmine-2.4.1
$ nano ./config/database.yml

 

production:
        adapter: postgresql
        database: redmine
        host: localhost
        username: redmine
        password: redmine
        encoding: utf8
        schema_search_path: public


     - 주의 사항으로는 위의 파일 내용을 입력할 때에 Tab 말고 White-Space로 입력해야 한다.


11. 추가 작업

$ rake generate_secret_token
$ RAILS_ENV=production rake db:migrate
$ RAILS_ENV=production rake redmine:load_default_data
   → Select language [ko]
$ mkdir public/plugin_assets

 

$ chown -R www-data:www-data files log tmp public
$ chmod -R 755 files log tmp public/plugin_assets
$ chown -R www-data:www-data ./config/database.yml
$ chmod 600 ./config/database.yml


 

12. 웹설정

$ cd /var/www/
$ ln -s /srv/install/redmine-2.4.1/public ./redmine

$ nano /etc/apache2/sites-available/default


<Directory /var/www/redmine>

        RailsBaseURI /redmine
        RackEnv production
        RailsEnv production
        PassengerResolveSymlinksInDocumentRoot on

</Directory>


$ service apache2 restart


여기까지 진행하고 웹브라우저로 http://127.0.0.1/redmine에 접속을 하면 Redmine을 볼 수 있다.

초기 관리자는 admin/admin 이다.

반응형


1. Download

   - wget을 통해 바로 다운로드 받을 수 없고, Web을 통해 라이선스 체크를 해야 다운로드가 된다.
   - http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html


2. Install

$ cd /srv/install/jdk

$ sudo -s tar zxvf jdk-7u45-linux-x64.tar.gz
$ sudo mkdir -p /usr/local/java
$ sudo -s mv ./jdk1.7.0_45 /usr/local/java/


3. PATH Configuration 1

$ sudo nano /etc/environment


PATH=...........:/usr/local/java/jdk1.7.0_45/bin
JAVA_HOME=/usr/local/java/jdk1.7.0_45

 

$ source /etc/environment



4. PATH Configuration 2

$ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/local/java/jdk1.7.0_45/bin/java" 1
$ sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/local/java/jdk1.7.0_45/bin/javac" 1
$ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/local/java/jdk1.7.0_45/bin/javaws" 1

$ sudo update-alternatives --set java /usr/local/java/jdk1.7.0_45/bin/java
$ sudo update-alternatives --set javac /usr/local/java/jdk1.7.0_45/bin/javac
$ sudo update-alternatives --set javaws /usr/local/java/jdk1.7.0_45/bin/javaws


     - 이렇게 하고 마지막으로 잘 되었는지 확인을 위해서 아래와 같이 버전을 확인해보자.

$ java -version


 

반응형

예쁜 달력을 하나 띄우고 싶어서 찾아본 달력 프로그램 하나.

http://www.rainlendar.net/



오픈 소프트웨어는 아니다.


그냥 가볍게 사용하기에는 Lite 버전으로도 충분하다.
리눅스 버전을 다운 받으려면, Show all downloads 링크를 클릭하면 된다.


시스템 요구사항 및 설치 방법은 다음과 같다.


실제로 설치를 한 번 해보자.

$ sudo apt-get install tofrodos gtk2-engines-pixbuf libjpeg62

$ cd /srv/install/rainlendar
$ wget http://www.rainlendar.net/download/rainlendar2-lite_2.11.1.b129-1_amd64.deb
$ sudo dpkg --install ./rainlendar2-lite_2.11.1.b129-1_amd64.deb

설치가 잘 되었으면 다음과 같이 메뉴로도 확인을 할 수 있다.


클릭을 하면 실행이 되는데...


한글도 잘 지원을 하고 있다.
항상 위로 실행시킬 수 있고, To Do 관리도 할 수 있는 등 꽤 쓸만한 기능을 지원해준다.

반응형

'OS > Ubuntu' 카테고리의 다른 글

Ubuntu 한글 입력기 nabi 트레이에 넣기  (20) 2014.01.07
JDK (Ubuntu12.04, SourceCode 1.7.0_45)  (0) 2013.12.09
[PKG] whoopsie  (0) 2013.08.15
터미놀로지 (Terminology)  (0) 2013.05.01
Ubuntu에서 Enlightenment 사용해보기 (EFL 맛보기)  (0) 2013.05.01

새로운 버전이 나온김에 한 번 더 살펴보았다.



1. 필수 패키지 설치

$ sudo apt-get install make libcurl4-gnutls-dev libexpat1-dev gettext zlib1g-dev libssl-dev asciidoc xmlto autoconf

 

 

2. 다운로드

$ cd /srv/install/git

$ wget http://git-core.googlecode.com/files/git-1.8.5.1.tar.gz
$ tar zxvf git-1.8.5.1.tar.gz
$ cd git-1.8.5.1/


3. 빌드

$ make configure
$ ./configure --prefix=/usr/local
$ make all doc
$ sudo make install install-doc install-html

   - 설치가 잘 되었는지 확인을 해보기 위해서 버전 확인을 해보자.

$ git --version



GIT 자동완성을 지원하기 위해서는...

   - http://whatwant.tistory.com/478


우리 모두 Git으로 행복한 형상관리를...

반응형


1. 필수 패키지 설치

$ sudo apt-get install make libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev asciidoc xmlto autoconf

 

 

2. 다운로드

$ cd /srv/install/git

$ wget http://git-core.googlecode.com/files/git-1.8.4.1.tar.gz
$ tar zxvf git-1.8.4.1.tar.gz
$ cd git-1.8.4.1/


3. 빌드

$ make configure
$ ./configure --prefix=/usr/local
$ make all doc
$ sudo make install install-doc install-html

   - 설치가 잘 되었는지 확인을 해보기 위해서 버전 확인을 해보자.

$ git --version



GIT 자동완성을 지원하기 위해서는...
   - http://whatwant.tistory.com/478


우리 모두 Git으로 행복한 형상관리를...


반응형

+ Recent posts