어휴.. 좀 쉬었으니 다시 시작해본다.

 

이전 글에서 만들어둔 VM에 CentOS 6.5를 최소 설치하고 다시 시작해 본다.

(이전 글 : http://pathcre8or.tistory.com/17 )

 

쉬는 동안 생각해보니 yum을 통해서 kernel-headers나 kernel-devel 을 설치하게 되면

CentOS 6.5의 커널인 2.6.32-431보다 높은 2.6.32-642가 설치 되는데 이게 문제가 된거 같다.

그런 고로 CentOS 6.5 최소 설치 후 kernel-headers와 kernel-devel을 따로 설치 해주기로 했다.

 

요 몇일간 이것저것 테스트 한다고 리눅스 설치면 20번쯤 한거 같다.

뭐 전부 최소 설치 해서 금방 설치 되긴 했지만 파티셔닝 입력 할때 마다 너무 귀찮다...

(CentOS 6.5 x86_64 기준 최소 설치시 패키지 217개 설치 됨)

 

그나저나 사실 이걸 일 할 때 쓰일거 같지도 않은데;;

게다가 CentOS 7버전이 나온후로 명령어도 많이 바뀌어서 그걸 공부해야 되는데

아직까지 이런 삽질이나 하느라 시간을 쓰니 참...

재미는 있지만 돈 안되는짓 하느라 시간 쓰는 내가 웃기기도 하고...

뭐 여튼... 갑자기 잡생각이 확 드네!!!

 

일단 시작 해보자!

 

 

1. 설치 후 상태 확인

 

# rpm -qa | grep kernel
kernel-firmware-2.6.32-431.el6.noarch
dracut-kernel-004-335.el6.noarch
kernel-2.6.32-431.el6.x86_64

 

2. kernel-headers와 kernel-devel 패키지를 ISO 파일에서 복사해서 설치

 

# mount /dev/sr0 /mnt
mount: block device /dev/sr0 is write-protected, mounting read-only

 

# cd /mnt/Packages/

 

# ls kernel*
kernel-2.6.32-431.el6.x86_64.rpm                 kernel-devel-2.6.32-431.el6.x86_64.rpm
kernel-abi-whitelists-2.6.32-431.el6.noarch.rpm  kernel-doc-2.6.32-431.el6.noarch.rpm
kernel-debug-2.6.32-431.el6.x86_64.rpm           kernel-firmware-2.6.32-431.el6.noarch.rpm
kernel-debug-devel-2.6.32-431.el6.x86_64.rpm     kernel-headers-2.6.32-431.el6.x86_64.rpm

 

# cp ./kernel-headers-2.6.32-431.el6.x86_64.rpm /root/

# cp ./kernel-devel-2.6.32-431.el6.x86_64.rpm /root/

# cd

 

# rpm -Uvh kernel-headers-2.6.32-431.el6.x86_64.rpm
경고: kernel-headers-2.6.32-431.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
준비 중...               ########################################### [100%]
   1:kernel-headers         ########################################### [100%]

 

# rpm -Uvh kernel-devel-2.6.32-431.el6.x86_64.rpm
경고: kernel-devel-2.6.32-431.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
준비 중...               ########################################### [100%]
   1:kernel-devel           ########################################### [100%]

 

# rpm -qa | grep kernel
kernel-firmware-2.6.32-431.el6.noarch
kernel-headers-2.6.32-431.el6.x86_64
dracut-kernel-004-335.el6.noarch
kernel-2.6.32-431.el6.x86_64
kernel-devel-2.6.32-431.el6.x86_64

 

3. wget으로 zfs 설치 파일 다운로드

 

# 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

 

 

4. 홈페이지에 있는 필요 패키지 설치

 

 

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

 

 

 

 

# yum groupinstall "Development Tools"

Install     112 Package(s)
Upgrade      15 Package(s)

 

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

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

 

# rpm -qa | grep kernel | grep 431
kernel-firmware-2.6.32-431.el6.noarch
kernel-headers-2.6.32-431.el6.x86_64
kernel-2.6.32-431.el6.x86_64
kernel-devel-2.6.32-431.el6.x86_64 

 

홈페이지에 나와있는 내용 중 kernel-devel을 제외 하고 설치 했다.

설치 후 확인 해보니 kernel-headers와 kernel-devel이 원래 그대로 잘 있다. 휴...

 

5. spl 압축 해제 후 설치

 

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

# cd spl-0.6.5.7

# ./configure

...

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

 

# make pkg-utils pkg-kmod

......

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

 

# ls *.rpm
kmod-spl-2.6.32-431.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-431.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-kmod-0.6.5.7-1.el6.src.rpm
spl-kmod-debuginfo-0.6.5.7-1.el6.x86_64.rpm

 

# rpm -Uvh ./*.x86_64.rpm
준비 중...               ########################################### [100%]
   1:spl                    ########################################### [ 17%]
   2:kmod-spl-2.6.32-431.el6########################################### [ 33%]
   3:spl-kmod-debuginfo     ########################################### [ 50%]
   4:spl-debuginfo          ########################################### [ 67%]
   5:kmod-spl-devel-2.6.32-4########################################### [ 83%]
   6:kmod-spl-devel         ########################################### [100%]

 

잘 된다!

zfs도 이어서 설치 해본다!

 

6. zfs 압축 해제 후 설치

 

# cd ..

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

# cd zfs-0.6.5.7

# ./configure

.....

config.status: creating zfs.release
config.status: creating zfs_config.h
config.status: executing depfiles commands
config.status: executing libtool commands

 

# make pkg-utils pkg-kmod

.....

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

 

# ls *.rpm
kmod-zfs-2.6.32-431.el6.x86_64-0.6.5.7-1.el6.x86_64.rpm
kmod-zfs-devel-0.6.5.7-1.el6.x86_64.rpm
kmod-zfs-devel-2.6.32-431.el6.x86_64-0.6.5.7-1.el6.x86_64.rpm
libnvpair1-0.6.5.7-1.el6.x86_64.rpm
libuutil1-0.6.5.7-1.el6.x86_64.rpm
libzfs2-0.6.5.7-1.el6.x86_64.rpm
libzfs2-devel-0.6.5.7-1.el6.x86_64.rpm
libzpool2-0.6.5.7-1.el6.x86_64.rpm
zfs-0.6.5.7-1.el6.src.rpm
zfs-0.6.5.7-1.el6.x86_64.rpm
zfs-debuginfo-0.6.5.7-1.el6.x86_64.rpm
zfs-dracut-0.6.5.7-1.el6.x86_64.rpm
zfs-kmod-0.6.5.7-1.el6.src.rpm
zfs-kmod-debuginfo-0.6.5.7-1.el6.x86_64.rpm
zfs-test-0.6.5.7-1.el6.x86_64.rpm

 

# rpm -Uvh ./*.x86_64.rpm
오류: Failed dependencies:
        bc is needed by zfs-test-0.6.5.7-1.el6.x86_64
        lsscsi is needed by zfs-test-0.6.5.7-1.el6.x86_64
        mdadm is needed by zfs-test-0.6.5.7-1.el6.x86_64
        parted is needed by zfs-test-0.6.5.7-1.el6.x86_64

 

# yum localinstall ./*.x86_64.rpm 

====================================================================
 Package                 Arch   Version         Repository                                     Size
====================================================================
Installing:
 kmod-zfs-2.6.32-431.el6.x86_64
                         x86_64 0.6.5.7-1.el6   /kmod-zfs-2.6.32-431.el6.x86_64-0.6.5.7-1.el6.x86_64
                                                                                              2.7 M
 kmod-zfs-devel          x86_64 0.6.5.7-1.el6   /kmod-zfs-devel-0.6.5.7-1.el6.x86_64          2.1 M
 kmod-zfs-devel-2.6.32-431.el6.x86_64
                         x86_64 0.6.5.7-1.el6   /kmod-zfs-devel-2.6.32-431.el6.x86_64-0.6.5.7-1.el6.x86_64
                                                                                              136 k
 libnvpair1              x86_64 0.6.5.7-1.el6   /libnvpair1-0.6.5.7-1.el6.x86_64               80 k
 libuutil1               x86_64 0.6.5.7-1.el6   /libuutil1-0.6.5.7-1.el6.x86_64                77 k
 libzfs2                 x86_64 0.6.5.7-1.el6   /libzfs2-0.6.5.7-1.el6.x86_64                 315 k
 libzfs2-devel           x86_64 0.6.5.7-1.el6   /libzfs2-devel-0.6.5.7-1.el6.x86_64           2.3 M
 libzpool2               x86_64 0.6.5.7-1.el6   /libzpool2-0.6.5.7-1.el6.x86_64               1.2 M
 zfs                     x86_64 0.6.5.7-1.el6   /zfs-0.6.5.7-1.el6.x86_64                     812 k
 zfs-debuginfo           x86_64 0.6.5.7-1.el6   /zfs-debuginfo-0.6.5.7-1.el6.x86_64            12 M
 zfs-dracut              x86_64 0.6.5.7-1.el6   /zfs-dracut-0.6.5.7-1.el6.x86_64               16 k
 zfs-kmod-debuginfo      x86_64 0.6.5.7-1.el6   /zfs-kmod-debuginfo-0.6.5.7-1.el6.x86_64       36 M
 zfs-test                x86_64 0.6.5.7-1.el6   /zfs-test-0.6.5.7-1.el6.x86_64                199 k
Installing for dependencies:
 bc                      x86_64 1.06.95-1.el6   base                                          110 k
 device-mapper           x86_64 1.02.117-7.el6  base                                          211 k
 device-mapper-libs      x86_64 1.02.117-7.el6  base                                          256 k
 lsscsi                  x86_64 0.23-3.el6      base                                           38 k
 mdadm                   x86_64 3.3.4-1.el6     base                                          347 k
 parted                  x86_64 2.1-29.el6      base                                          608 k

 

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

 

VM에서 해서그런지 make가 엄청나게 느리다... OS 설치 하는것보다 더 오래 걸린듯;;;

 

게다가 끝까지 뜨는 저 의존성 에러들... ㅠㅠ

하나하나 설치 하기 귀찮아서 그냥 yum으로 해결해 버렸다.

 

zpool과 zfs 명령어를 실행해보니 잘 된다.

여튼 설치는 끝난거 같고... 이제 구성을 해보자.

 

7. zfs 모듈 실행 후 확인

 

# modprobe zfs

# lsmod | grep zfs
zfs                  2747674  0
zcommon                48128  1 zfs
znvpair                80284  2 zfs,zcommon
spl                    90538  3 zfs,zcommon,znvpair
zavl                    7215  1 zfs
zunicode              323046  1 zfs

 

7. pool 생성

 

# fdisk -l | grep " /dev/sd"
Disk /dev/sdb: 1073 MB, 1073741824 bytes
Disk /dev/sdc: 1073 MB, 1073741824 bytes
Disk /dev/sda: 10.7 GB, 10737418240 bytes

 

# zpool create testpool /dev/sdb /dev/sdc
invalid vdev specification
use '-f' to override the following errors:
/dev/sdb does not contain an EFI label but it may contain partition
information in the MBR.
/dev/sdc does not contain an EFI label but it may contain partition
information in the MBR.

 

# zpool create testpool /dev/sdb /dev/sdc -f

 

# zpool list
NAME       SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
testpool  1.97G  68.5K  1.97G         -     0%     0%  1.00x  ONLINE  -

 

# df -h

testpool        2.0G     0  2.0G   0% /testpool
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3       8.7G  1.4G  6.9G  17% /
tmpfs           491M     0  491M   0% /dev/shm
/dev/sda1       194M   27M  158M  15% /boot
/dev/sr0        4.2G  4.2G     0 100% /mnt
testpool        2.0G     0  2.0G   0% /testpool 

 

8. testpool에 파일시스템 생성

 

# zfs list
NAME       USED  AVAIL  REFER  MOUNTPOINT
testpool  56.5K  1.91G    19K  /testpool

 

# zfs create testpool/testfs

 

# zfs list
NAME              USED  AVAIL  REFER  MOUNTPOINT
testpool          250K  1.91G    19K  /testpool
testpool/testfs    19K  1.91G    19K  /testpool/testfs

 

# df -h
Filesystem       Size  Used Avail Use% Mounted on
/dev/sda3        8.7G  1.4G  6.9G  17% /
tmpfs            491M     0  491M   0% /dev/shm
/dev/sda1        194M   27M  158M  15% /boot
/dev/sr0         4.2G  4.2G     0 100% /mnt
testpool         2.0G     0  2.0G   0% /testpool
testpool/testfs  2.0G     0  2.0G   0% /testpool/testfs

 

 

잘 된다! 역시!!

 

참고로 위에 make 할때 kmod 형식으로 했는데,

이러면 나중에 커널 업데이트 하면 다시 컴파일 해줘야 한다.

dkms 모드로 하면 커널 업데이트 해도 자동으로 인식해서 올려 준다는데,

dkms 설치가 귀찮아서 그냥 kmod로 했다.

 

어차피 커널 업데이트 따위 하지 않을거다! 라고 믿으면서...

 

여튼... 여기까지!!!

 

힘들다~~

 

 

 

 

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

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