주의!! 이 글은 ZFS 설치 과정에서 있었던 삽질을 시간 순서대로 기록한것이니 절대 따라하지 마세요!!

 

 

으아 Yum으로 ZFS 설치하는 포스트를 쪼금쪼금씩 3일간 쓰고 나니 카페에 다른 질문이 올라왔다.

컴파일이 안되신다는데, 보니까 필요한 패키지가 좀 덜 설치 되신거 같다.

그래서 어떤게 필요한지 확인을 위해 CentOS 6.5를 최소 설치하고 컴파일로 진행해 봤다.

 

뭐 지난번 글과 같이 VM을 만들어 주었다. (라지만 글이 게시된지 5분도 안지났구만...)

 

 

 

0. Zfs On Linux 사이트 확인

 

http://zfsonlinux.org/

 

 

녹색선으로 되어있는 제일 최신 버전을 설치 할 계획이다.

 

 

1. wget으로 설치 파일 다운로드

 

# wget http://archive.zfsonlinux.org/downloads/zfsonlinux/spl/spl-0.6.5.7.tar.gz
-bash: wget: command not found

 

# yum install wget

 

# wget http://archive.zfsonlinux.org/downloads/zfsonlinux/spl/spl-0.6.5.7.tar.gz
--2016-06-02 23:20:39--  http://archive.zfsonlinux.org/downloads/zfsonlinux/spl/spl-0.6.5.7.tar.gz
Resolving archive.zfsonlinux.org... 54.231.10.169
Connecting to archive.zfsonlinux.org|54.231.10.169|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 558570 (545K) [application/x-gzip]
Saving to: `spl-0.6.5.7.tar.gz'

100%[==========================================================>] 558,570      273K/s   in 2.0s   

2016-06-02 23:20:42 (273 KB/s) - `spl-0.6.5.7.tar.gz' saved [558570/558570]

 

# wget http://archive.zfsonlinux.org/downloads/zfsonlinux/zfs/zfs-0.6.5.7.tar.gz
--2016-06-02 23:20:49--  http://archive.zfsonlinux.org/downloads/zfsonlinux/zfs/zfs-0.6.5.7.tar.gz
Resolving archive.zfsonlinux.org... 54.231.10.129
Connecting to archive.zfsonlinux.org|54.231.10.129|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2537816 (2.4M) [application/x-gzip]
Saving to: `zfs-0.6.5.7.tar.gz'

100%[==========================================================>] 2,537,816    472K/s   in 6.4s   

2016-06-02 23:20:57 (385 KB/s) - `zfs-0.6.5.7.tar.gz' saved [2537816/2537816]

 

# ls -l
합계 3028
-rw-r--r--. 1 root root  558570 2016-05-13 12:04 spl-0.6.5.7.tar.gz
-rw-r--r--. 1 root root 2537816 2016-05-13 12:05 zfs-0.6.5.7.tar.gz

 

 

역시 최소 설치라서 시작부터 뭔가 없다-_-a

 

2. spl 부터 압축 해제 후 설치 시작

 

# tar zxf ./spl-0.6.5.7.tar.gz

 

# cd spl-0.6.5.7

# ./configure
checking for gawk... gawk
checking metadata... META file
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking whether make sets $(MAKE)... yes
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/root/ZFS/spl-0.6.5.7':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

 

 

일단 C 컴파일러가 없다.

 

3. gcc 설치

 

# yum install gcc
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.navercorp.com
 * extras: mirror.navercorp.com

.............

===============================================================
 Package                   Arch              Version                       Repository          Size
===============================================================
Installing:
 gcc                       x86_64            4.4.7-17.el6                  base                10 M
Installing for dependencies:
 cloog-ppl                 x86_64            0.15.7-1.2.el6                base                93 k
 cpp                       x86_64            4.4.7-17.el6                  base               3.7 M
 glibc-devel               x86_64            2.12-1.192.el6                base               988 k
 glibc-headers             x86_64            2.12-1.192.el6                base               617 k
 kernel-headers            x86_64            2.6.32-642.1.1.el6            updates            4.4 M
 libgomp                   x86_64            4.4.7-17.el6                  base               134 k
 mpfr                      x86_64            2.4.1-6.el6                   base               157 k
 ppl                       x86_64            0.10.2-11.el6                 base               1.3 M
Updating for dependencies:
 glibc                     x86_64            2.12-1.192.el6                base               3.8 M
 glibc-common              x86_64            2.12-1.192.el6                base                14 M
 libgcc                    x86_64            4.4.7-17.el6                  base               103 k
 tzdata                    noarch            2016d-1.el6                   updates            451 k

Transaction Summary
===============================================================
Install       9 Package(s)
Upgrade       4 Package(s)

 

 

의존성 때문에 설치 되는게 좀 많다.

kennel-headers 의 경우 지금 설치된 커널 보다 높은 버전이 설치된다. repo를 추가해서 현재 설치되는 녀석과 맞출수 있겠지만.. 그냥 진행 해보자-_-a

 

4. 다시 configure 수행

 

# ./configure
....... 

checking kernel source directory... Not found
configure: error:
        *** Please make sure the kernel devel package for your distribution
        *** is installed and then try again.  If that fails, you can specify the
        *** location of the kernel source with the '--with-linux=PATH' option.

 

 

이번엔 kernel-devel 을 설치 하라고 한다. 그래 이게 빠질수는 없겠지!

 

5. kernel-devel 설치

 

# yum install kernel-devel

 

================================================================
 Package                 Arch              Version                         Repository          Size
================================================================
Installing:
 kernel-devel            x86_64            2.6.32-642.1.1.el6              updates             11 M

Transaction Summary
================================================================
Install       1 Package(s)

 

 

1개만 달랑 설치 되는거 보니 또 에러 날거 같다.

 

6. 다시 configure 수행

 

# ./configure

...... 

checking kernel source directory... /usr/src/kernels/2.6.32-642.1.1.el6.x86_64
checking kernel build directory... /usr/src/kernels/2.6.32-642.1.1.el6.x86_64
checking kernel source version... 2.6.32-642.1.1.el6.x86_64
checking kernel file name for module symbols... Module.symvers
checking whether debugging is enabled... no
checking whether basic kmem accounting is enabled... no
checking whether detailed kmem tracking is enabled... no
checking whether modules can be built... no

configure: error: *** Unable to build an empty module.

 

 

역시나 에러 발생.. 근데 이번에는 뭘 설치하라는건지 모르겠다....

그래서 config.log 를 뒤지다 보니 아래와 같은 내용이 있다.

 

configure:14576: cp conftest.c build && make modules -C /usr/src/kernels/2.6.32-642.1.1.el6.x86_64 EXTRA_CFLAGS=-Werror-implicit-function-declaration   M=/root/ZFS/spl-0.6.5.7/build
/bin/sh: perl: command not found
make[1]: *** [/root/ZFS/spl-0.6.5.7/build/conftest.o] Error 127

 

음.. perl이 없다고? 이거 때문이가 싶어서 설치 해 본다.

 

 

7. perl 설치

 

# yum install perl

 

===============================================================
 Package                        Arch            Version                         Repository     Size
===============================================================
Installing:
 perl                           x86_64          4:5.10.1-141.el6_7.1            base           10 M
Installing for dependencies:
 perl-Module-Pluggable          x86_64          1:3.90-141.el6_7.1              base           40 k
 perl-Pod-Escapes               x86_64          1:1.04-141.el6_7.1              base           33 k
 perl-Pod-Simple                x86_64          1:3.13-141.el6_7.1              base          213 k
 perl-libs                      x86_64          4:5.10.1-141.el6_7.1            base          579 k
 perl-version                   x86_64          3:0.77-141.el6_7.1              base           52 k

Transaction Summary
==============================================================
Install       6 Package(s)

 

8. 다시 configure 수행

 

# ./configure

..........

config.status: executing libtool commands
config.status: creating rpm/generic/Makefile
config.status: creating rpm/generic/spl.spec
config.status: creating rpm/generic/spl-kmod.spec
config.status: creating rpm/generic/spl-dkms.spec
config.status: creating spl.release
config.status: creating spl_config.h
config.status: executing depfiles commands
config.status: executing libtool commands

 

된건가!!!

찝찝하지만 다음 단계로..

 

9. make rpm 수행

 

# make rpm
make  pkg="spl-kmod" \
                def='--define "build_src_rpm 1" ' srpm-common

............

 *** Required util rpmbuild missing.  Please install the
 *** package for your distribution which provides rpmbuild,
 *** re-run configure, and try again.

make[2]: *** [rpm-local] 오류 1
make[2]: Leaving directory `/root/ZFS/spl-0.6.5.7'
make[1]: *** [srpm-common] 오류 1
make[1]: Leaving directory `/root/ZFS/spl-0.6.5.7'
make: *** [srpm-kmod] 오류 2

 

그래 rpm-build도 없구나..

 

10. rpm-build 설치

 

# yum install rpm-build

 

==================================================================
 Package                  Arch          Version                                   Repository   Size
==================================================================
Installing:
 rpm-build                x86_64        4.8.0-55.el6                              base        131 k
Installing for dependencies:
 elfutils                 x86_64        0.164-2.el6                               base        240 k
 elfutils-libs            x86_64        0.164-2.el6                               base        230 k
 gdb                      x86_64        7.2-90.el6                                base        2.3 M
 patch                    x86_64        2.6-6.el6                                 base         90 k
 redhat-rpm-config        noarch        9.0.3-51.el6.centos                       base         60 k
 unzip                    x86_64        6.0-4.el6                                 base        152 k
 xz                       x86_64        4.999.9-0.5.beta.20091007git.el6          base        137 k
 xz-lzma-compat           x86_64        4.999.9-0.5.beta.20091007git.el6          base         16 k
Updating for dependencies:
 elfutils-libelf          x86_64        0.164-2.el6                               base        197 k
 rpm                      x86_64        4.8.0-55.el6                              base        906 k
 rpm-libs                 x86_64        4.8.0-55.el6                              base        318 k
 rpm-python               x86_64        4.8.0-55.el6                              base         60 k
 xz-libs                  x86_64        4.999.9-0.5.beta.20091007git.el6          base         89 k

Transaction Summary
=================================================================
Install       9 Package(s)
Upgrade       5 Package(s)

 

 

이번에도 좀 많다..

 

11. 다시 make rpm 수행

 

# make rpm
make  pkg="spl-kmod" \
                def='--define "build_src_rpm 1" ' srpm-common

............

 *** Required util rpmbuild missing.  Please install the
 *** package for your distribution which provides rpmbuild,
 *** re-run configure, and try again.

make[2]: *** [rpm-local] 오류 1
make[2]: Leaving directory `/root/ZFS/spl-0.6.5.7'
make[1]: *** [srpm-common] 오류 1
make[1]: Leaving directory `/root/ZFS/spl-0.6.5.7'
make: *** [srpm-kmod] 오류 2

 

음....?? 뭐지.. 같은 에러가 나온다..

혹시나 해서 다시 configure를 수행하고 make rpm을 해봤다.

 

12. 다시 configure 수행 후 make rpm 수행

 

# ./configure

........

config.status: creating spl.release
config.status: creating spl_config.h
config.status: executing depfiles commands
config.status: executing libtool commands

 

# make rpm

....

Executing(--clean): /bin/sh -e /tmp/spl-build-root-t7MmhxJO/TMP/rpm-tmp.7nYG5l
+ umask 022
+ cd /tmp/spl-build-root-t7MmhxJO/BUILD
+ rm -rf spl-0.6.5.7
+ exit 0
make[1]: Leaving directory `/root/ZFS/spl-0.6.5.7'

 

# ls *.rpm
kmod-spl-2.6.32-642.1.1.el6.x86_64-0.6.5.7-1.el6.x86_64.rpm
kmod-spl-devel-0.6.5.7-1.el6.x86_64.rpm
kmod-spl-devel-2.6.32-642.1.1.el6.x86_64-0.6.5.7-1.el6.x86_64.rpm
spl-0.6.5.7-1.el6.src.rpm
spl-0.6.5.7-1.el6.x86_64.rpm
spl-debuginfo-0.6.5.7-1.el6.x86_64.rpm
spl-dkms-0.6.5.7-1.el6.noarch.rpm
spl-dkms-0.6.5.7-1.el6.src.rpm
spl-kmod-0.6.5.7-1.el6.src.rpm
spl-kmod-debuginfo-0.6.5.7-1.el6.x86_64.rpm

 

 

오.. rpm 파일이 생겼다. 이제 설치를 해 주자.

 

13. rpm 설치

 

# rpm -Uvh ./*.rpm
오류: Failed dependencies:
        kernel-uname-r = 2.6.32-642.1.1.el6.x86_64 is needed by kmod-spl-2.6.32-642.1.1.el6.x86_64-0.6.5.7-1.el6.x86_64
        dkms >= 2.2.0.2 is needed by spl-dkms-0.6.5.7-1.el6.noarch
   1:spl                    ########################################### [100%]
   2:spl-dkms               ########################################### [100%]
   3:spl-kmod               ########################################### [100%]

 

 

 

kernel 버전 2.6.32.642가 필요하다고? ㅠㅠ

어휴... 이거 뭐 일이 많네.. zfs 때문에 커널 업데이트까지 해야 되다니...

이쯤 되면 배보다 배꼽이 크다.

그런 관계로 일단 여기서 중단! 홈페이지를 뒤적뒤적 해봤다.

 

14. 홈페이지에 나와있는 정보 확인

 

그래 역시 먼저 찾아보고 했어야 되었어...

친절하게 설치해야할 패키지가 나와있다. 역시 멍청하면 손발이 고생이다.

 

https://github.com/zfsonlinux/zfs/wiki/Building-ZFS

 

 

 

확인 해보니 설치 하라고 한 devel 패키지 대부분이 없다.

Dev tools 중에서도 6개 빼고 하나도 설치 되어있지 않고.. 근데 Tools를 설치하려니 95개나 설치 된단다..

devel 패키지도 14개나 설치 되고.. 처음부터 했으면 몇 개 더 있었겠지...

여튼 일단 설치를 하자.

 

# yum groupinstall "Development Tools"

 

Install      89 Package(s)
Upgrade       6 Package(s)

 


# yum install kernel-devel zlib-devel libuuid-devel libattr-devel libblkid-devel libselinux-devel libudev-devel

 

Install       8 Package(s)
Upgrade       6 Package(s)

 

일단 parted lsscsi ksh는 제외하고 다시 configure 부터 수행...

 

15. 깔끔히 설치를 위해 기존 설치 하던 디렉토리 삭제 후 다시 시작..

 

# pwd
/root/ZFS/spl-0.6.5.7

# cd ..

# rm -fr ./spl-0.6.5.7

# tar zxf ./spl-0.6.5.7.tar.gz

# cd spl-0.6.5.7

 

 

16. 또 다시 configure 수행 후 make rpm 수행

 

# ./configure

........ 

config.status: creating spl.release
config.status: creating spl_config.h
config.status: executing depfiles commands
config.status: executing libtool commands

 

# make rpm

......

+ cd /tmp/spl-build-root-JBU3Oe64/BUILD
+ rm -rf spl-0.6.5.7
+ exit 0
make[1]: Leaving directory `/root/ZFS/spl-0.6.5.7'

 

# ls *.rpm
kmod-spl-2.6.32-642.1.1.el6.x86_64-0.6.5.7-1.el6.x86_64.rpm
kmod-spl-devel-0.6.5.7-1.el6.x86_64.rpm
kmod-spl-devel-2.6.32-642.1.1.el6.x86_64-0.6.5.7-1.el6.x86_64.rpm
spl-0.6.5.7-1.el6.src.rpm
spl-0.6.5.7-1.el6.x86_64.rpm
spl-debuginfo-0.6.5.7-1.el6.x86_64.rpm
spl-dkms-0.6.5.7-1.el6.noarch.rpm
spl-dkms-0.6.5.7-1.el6.src.rpm
spl-kmod-0.6.5.7-1.el6.src.rpm
spl-kmod-debuginfo-0.6.5.7-1.el6.x86_64.rpm

 

 

 

음.. 버전을 보니 느낌이 싸... 한데......

 

17. rpm 설치

 

# rpm -Uvh *.rpm
오류: Failed dependencies:
        kernel-uname-r = 2.6.32-642.1.1.el6.x86_64 is needed by kmod-spl-2.6.32-642.1.1.el6.x86_64-0.6.5.7-1.el6.x86_64
        dkms >= 2.2.0.2 is needed by spl-dkms-0.6.5.7-1.el6.noarch
   1:spl                    ########################################### [100%]
   2:spl-dkms               ########################################### [100%]
   3:spl-kmod               ########################################### [100%]

 

아.. 이런.. 역시 인가..

이미 길어질대로 길어진 글이라서 다음 글에서 OS 재설치 후 다시 도전해야겠다...

 

최신 커널 설치만이 답인건가!

일단 조금 쉬고 OS 재설치 부터 다음 글에서 계속!!

 

'Server Engineer > Linux' 카테고리의 다른 글

RHEL/CentOS Local YUM  (0) 2019.07.22
ZFS on CentOS 6 - 컴파일 설치.2  (0) 2016.06.02
ZFS on CentOS 6 - Yum 설치  (0) 2016.06.02
CentOS7 에서 KVM 가상머신 만들기  (0) 2016.04.29
CentOS7 bonding  (0) 2016.04.22
Posted by 까만핀치
,