LVM(Logical Volume Manager)

물리적인 디스크나 파티션을 원하는 방식과 용량의 가상 디스크를 구성

디스크 크기를 증가 or 감소 가능

실습)

IP: 211.183.3.10
GW: 211.183.3.2
DNS: 8.8.8.8
  • sdb, sdc, sdd 3개 디스크 추가
    각각 1GB, 2GB, 3GB

  • sdb, sdc, sdd 3개 파티션 추가
[root@www ~]# fdisk /dev/sdb
Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'
Command (m for help): p

Command (m for help): w
The partition table has been altered!
  • sdc, sdd도 위와 동일하게 추가
[root@www ~]# fdisk /dev/sdc
[root@www ~]# fdisk /dev/sdd

# yum search : 패키지 검색

# 내가 설치하고 싶은 패키지

  • 패키지 설치
[root@www ~]# yum install -y lvm2
  • 물리디스크를 pv로 선언
[root@www ~]# pvcreate /dev/sdb1
  Physical volume "/dev/sdb1" successfully created.
[root@www ~]# pvcreate /dev/sdc1
  Physical volume "/dev/sdc1" successfully created.
[root@www ~]# pvcreate /dev/sdd1
  Physical volume "/dev/sdd1" successfully created.
  • 내가 만든 pv 목록
[root@www ~]# pvscan
  PV /dev/sda2   VG centos          lvm2 [<19.00 GiB / 0    free]
  PV /dev/sdc1                      lvm2 [<2.00 GiB]
  PV /dev/sdd1                      lvm2 [<3.00 GiB]
  PV /dev/sdb1                      lvm2 [1023.00 MiB]
  Total: 4 [24.99 GiB] / in use: 1 [<19.00 GiB] / in no VG: 3 [<6.00 GiB]
  • volume group 생성
[root@www ~]# vgcreate myvg /dev/sdb1 /dev/sdc1 /dev/sdd1
  Volume group "myvg" successfully created

  • volume group 안에 있는 logical volume인 mylv1, mylv2 생성
[root@www ~]# lvcreate --size 1G --name mylv1 myvg
  Logical volume "mylv1" created
[root@www ~]# lvcreate --size 1G --name mylv2 myvg
  Logical volume "mylv2" created.
  • 남은 공간 전부를 할당하기 위해 +100%FREE를 사용한 mylv3 생성
[root@www ~]# lvcreate --extents +100%FREE --name mylv3 myvg
  Logical volume "mylv3" created. 

# lvdisplay로 확인가능
# 내가 갖고있는 lv의 장치명 확인

  • 파일시스템 생성
[root@www ~]# mkfs.ext4 /dev/myvg/mylv1
[root@www ~]# mkfs.ext4 /dev/myvg/mylv2
[root@www ~]# mkfs.ext4 /dev/myvg/mylv3
  • 마운트 포인트 생성
[root@www ~]# mkdir /lv1
[root@www ~]# mkdir /lv2
[root@www ~]# mkdir /lv3
  • 마운트
[root@www ~]# mount /dev/myvg/mylv1 /lv1
[root@www ~]# mount /dev/myvg/mylv2 /lv2
[root@www ~]# mount /dev/myvg/mylv3 /lv3

  • 마운트 유지
[root@www ~]# vi /etc/fstab
# 아래 내용 추가
/dev/myvg/mylv1         /lv1                    ext4    defaults        0 0
/dev/myvg/mylv2         /lv2                    ext4    defaults        0 0
/dev/myvg/mylv3         /lv3                    ext4    defaults        0 0

실습)

디스크를 추가하여 VG와 LV를 늘려보자.
7GB 디스크 추가하고 lv2의 용량을 5GB로 확장하자.

  • 물리디스크를 pv로 선언
[root@www ~]# pvcreate /dev/sde
  Physical volume "/dev/sde" successfully created.
  • 볼륨그룹에 방금 만든 pv인 /dev/sde를 추가
[root@www ~]# vgextend myvg /dev/sde
  Volume group "myvg" successfully extended
  • 추가된 사이즈와 기존에 이미 할당된 사이즈, 남은 공간 확인
[root@www ~]# vgdisplay myvg

용량 늘리기

  • mylv2를 5G로 재설정 (→ 이렇게만 하면 fs에서 인지 못함)
[root@www ~]# lvextend --size 5G /dev/myvg/mylv2

  • 파일시스템 리사이징 ( 늘어난 용량을 파일시스템에서 인지할 수 있도록)
[root@www ~]# resize2fs /dev/myvg/mylv2

실습↓)

lv2의 용량을 2GB로 줄여보자.
  1. 마운트해제
  2. 파일시스템 체크
  3. 줄일 파티션 용량만큼 fs 감소
  4. lvreduce 명령으로 사이즈 감소
  5. 다시 마운트  
  • 마운트해제
[root@www ~]# umount /lv2
  • 파일시스템 체크
[root@www ~]# e2fsck -f /dev/myvg/mylv2

용량 줄이기

  • 줄일 파티션 용량만큼 fs 감소
[root@www ~]# resize2fs /dev/myvg/mylv2 2G
  • lvreduce 명령으로 사이즈 감소
[root@www ~]# lvreduce --size 2G /dev/myvg/mylv2
  • 다시 마운트
[root@www ~]# mount /dev/myvg/mylv2 /lv2

실습↑↓)

mylv1를 2GB로 확장하고 mylv2는 1GB로 감소시킨 후 남은 VG공간 전체를 mylv3에 할당해 보세요
  • mylv1를 2GB로 확장
[root@www ~]# lvextend --size 2G /dev/myvg/mylv1
[root@www ~]# resize2fs /dev/myvg/mylv1
  • mylv2를 1GB로 감소
[root@www ~]# umount /lv2
[root@www ~]# e2fsck -f /dev/myvg/mylv2
[root@www ~]# resize2fs /dev/myvg/mylv2 1G
[root@www ~]# mount /dev/myvg/mylv2 /lv2
  • mylv3에 남은 VG공간 할당 
[root@www ~]# lvextend --extents +100%FREE /dev/myvg/mylv3
[root@www ~]# resize2fs /dev/myvg/mylv3

실습↑↓)

현재 사용중인 서버의 최상위 디렉토리 용량을 10G 정도 늘려보세요.

xfs 파일시스템의 경우, xfs_growfs 라는 명령으로 리사이징을 하셔야 합니다.
resize2fs 대신 위 명령으로 해보세요!

풀이)

10GB 디스크를 추가

  • 내가 확장하고싶은 VG의 이름을 확인
[root@srv1 ~]# vgdisplay

  • pv 생성
[root@srv1 ~]# pvcreate /dev/sdf
  • 생성한 pv를 centos라는 이름의 vg에 추가
[root@srv1 ~]# vgextend centos /dev/sdf

 

1. df -h로 lv 이름 확인

[root@srv1 ~]# df -h

2. lvdisplay로 이름 확인

[root@srv1 ~]# lvdisplay

    • 10GB를 추가했으니 남은 공간 전부 /dev/centos/root에 할당
[root@srv1 ~]# lvextend --extents +100%FREE /dev/centos/root
[root@srv1 ~]# xfs_growfs /dev/centos/root


시험)

1. 나에게 주어진 172.16.101.0 /24 사설 대역을 VLSM 하여 VMnet을 구성하시오.
(Vmware Workstation은 가상 네트워크 구성후 재부팅을 해야 GNS3와 연동이 된다.) 현실대역은 vmnet8로 가정한다.
  • VMnet4
    30+2=32 < 32=2^5, SM: 32-5=27 (255.255.255.224)
    172.16.101.0 ~ 172.16.101.31 /27
  • VMnet6 → VMnet3으로 일단,,,
    16+2=18 < 32=2^5, SM: 32-5=27 (255.255.255.224)
    172.16.101.32 ~ 172.16.101.63 /27
  • VMnet5
    10+2=12 < 16=2^4, SM: 32-4=28 (255.255.255.240)
    172.16.101.64 ~ 172.16.101.79 /28
  • R1-R2
    4=2^2, SM: 32-2=30 (255.255.255.252)
    172.16.101.80 ~ 172.16.101.83
  • R2-R3
    4=2^2, SM: 32-2=30 (255.255.255.252)
    172.16.101.84 ~ 172.16.101.87
  • 전체 네트워크 대역대
    172.16.101.0/25 (255.255.255.128)
  • 라우터 설정
R1(config-if)#int f0/0
ip add 172.16.101.28 255.255.255.224
no sh
R1(config-if)#int f0/1
ip add 172.16.101.81 255.255.255.252
no sh

R2(config-if)#int f0/1
ip add 172.16.101.82 255.255.255.252
no sh
R2(config-if)#int f0/0
ip add 172.16.101.76 255.255.255.240
no sh
R2(config-if)#int f1/0
ip add 172.16.101.85 255.255.255.252
no sh

R3(config-if)#int f1/0
ip add 172.16.101.86 255.255.255.252
no sh
R3(config-if)#int f0/0
ip add 172.16.101.60 255.255.255.224
no sh
R3(config-if)#int f0/1
ip add 211.183.3.100 255.255.255.0
no sh
  • 라우팅
R1(config-if)#ip route 172.16.101.64 255.255.255.240 172.16.101.82
R1(config-if)#ip route 172.16.101.32 255.255.255.224 172.16.101.82
R1(config-if)#ip route 172.16.101.84 255.255.255.252 172.16.101.82

R2(config-if)#ip route 172.16.101.0 255.255.255.224 172.16.101.81
R2(config-if)#ip route 172.16.101.32 255.255.255.224 172.16.101.86

R3(config-if)#ip route 172.16.101.0 255.255.255.224 172.16.101.85
R3(config-if)#ip route 172.16.101.80 255.255.255.252 172.16.101.85
R3(config-if)#ip route 172.16.101.64 255.255.255.240 172.16.101.85
  • 디폴트 라우팅
R1(config-if)#ip route 0.0.0.0 0.0.0.0 172.16.101.82
R2(config-if)#ip route 0.0.0.0 0.0.0.0 172.16.101.86
R3(config-if)#ip route 0.0.0.0 0.0.0.0 211.183.3.2
  • NAT 설정
R3(config-if)#access-list 1 permit 172.16.101.0 0.0.0.255
R3(config-if)#int f1/0
R3(config-if)#ip nat inside
R3(config-if)#int f0/0
R3(config-if)#ip nat inside
R3(config-if)#int f0/1
R3(config-if)#ip nat outside
R3(config-if)#ip nat inside source list 1 int f0/1 overload
  • 저장
R1(config-if)#do wr
R2(config-if)#do wr
R3(config-if)#do wr
2. exam 서버들은 서로의 호스트네임을 서브도메인으로 사용한다. 또한 각 서버에 접근할때 영문주소로 접근해야한다.<exam1 서버>
: pxe - client
무인설치 후 영문주소로 모든 서버에 접근 가능해야 한다.

<exam2 서버>
: WEB 서버
도메인 - www.sulnal.com
NFS-server의 공유디렉토리(/lshared)에 저장된 index.html 파일을 /lremote라는 마운트포인트를 통해 접근하여 웹서비스를 제공한다.
: FTP, TFTP 서버
도메인 - ftp.sulnal.com, tftp.sulnal.com

<exam3 서버>
: NFS 서버
도메인 - nfs.sulnal.com
RAID 16으로 /rshared 폴더를 구성하여 exam1에게 3GB의 용량을 제공해야 한다. 마운트포인트는 /rremote
LVM으로 /lshared 폴더를 구성하여 exam2에게 2~5GB의 용량을 제공할 수 있어야 한다. 마운트포인트는 /lremote

<exam4 서버>
: DHCP 서버

도메인 - dhcp.sulnal.com

<exam5 서버>
: DNS 서버

도메인 - dns.sulnal.com
  • 초기설정
systemctl stop firewalld
systemctl disable firewalld
sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config
cat <<EOF > /etc/yum.repos.d/CentOS-Base.repo
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
baseurl=https://vault.centos.org/7.9.2009/os/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
baseurl=https://vault.centos.org/7.9.2009/updates/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
baseurl=https://vault.centos.org/7.9.2009/extras/x86_64/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra
baseurl=https://vault.centos.org/7.9.2009/centosplus/x86_64/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib&infra=$infra
baseurl=https://vault.centos.org/7.9.2009/contrib/x86_64/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

EOF
init 6
  • 각 서버에 필요한 패키지 설치 후 DNS 변경

1. exam4) DHCP 서버

  • DHCP 패키지 설치
[root@dhcp ~]# yum install -y dhcp
    • DHCP 풀 설정
[root@dhcp ~]# vi /etc/dhcp/dhcpd.conf
subnet 172.16.101.64 netmask 255.255.255.240 { }
#본인이 속한 풀

subnet 172.16.101.0 netmask 255.255.255.224
{
option routers 172.16.101.28;
#GW
option subnet-mask 255.255.255.224;
#SM
range dynamic-bootp 172.16.101.3 172.16.101.29;
#IP 할당 범위

option domain-name-servers 172.16.101.35;
#DNS

allow booting;
#부팅 허용

next-server 172.16.101.4;
#PxE(tftp) 서버의 주소

filename "pxelinux.0";
#next-server에 가서 받아올 파일
}
[root@dhcp ~]#systemctl restart dhcpd
[root@dhcp ~]# systemctl enable dhcpd
  • R1 helper-address 설정
R1(config)#int f0/0
R1(config-if)#ip helper-address 172.16.101.67
  • exam1) pxe-client IP 할당 확인

2. exam5) DNS 서버

  • DNS 패키지 설치
[root@dns ~]# yum install -y bind bind-utils
  • DNS 서버 설정
[root@dns ~]# vi /etc/named.conf

# any로 변경

  • zone 생성
[root@dns ~]# vi /etc/named.rfc1912.zones
zone "sulnal.com" IN {
        type master;
        file "sulnal.com.db";
        allow-update { none; };
};
  • zone 파일 생성
$TTL 3H
@               SOA     @       root (
                                                0       ; serial
                                                1D      ; refresh
                                                1H      ; retry
                                                1W      ; expire
                                                3H )    ; minimum

                   IN      NS      @
                   IN      A       172.16.101.4
www           IN      A       172.16.101.4
ftp               IN      A       172.16.101.4             
tftp              IN      A       172.16.101.4
nfs              IN      A       172.16.101.5
dns             IN      A       172.16.101.35
dhcp           IN      A       172.16.101.67
[root@dns ~]# systemctl restart named
  • DNS 서버 수정
[root@dns ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens32
DNS1="172.16.101.35"
[root@dns ~]# systemctl restart network

3. exam2) WEB, FTP, TFTP 서버

 

3-1. 초기 설정

  • http, ftp, tftp 패키지 설치
[root@web ~]# yum install -y httpd vsftpd tftp-server bind-utils nfs-utils syslinux
  • 질의할 DNS 서버 변경
[root@web ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens32
DNS1="172.16.101.35"
[root@web ~]# systemctl restart network
[root@web ~]# systemctl enable network

 

3-2. TFTP 서버 구성

# ISO 파일을 다시 DVD 롬에 삽입

  • iso 파일 위치
[root@web ~]# ls /dev/cdrom
/dev/cdrom
  • 해당 장치의 iso 파일에 접근하기 위해 /media 라는 마운트포인트로 마운팅
[root@web ~]# mount /dev/cdrom /media
mount: /dev/sr0 is write-protected, mounting read-only
  • pxelinux.0
    pxe 부팅에 필요한 파일
[root@web ~]# cp /media/images/pxeboot/vmlinuz /var/lib/tftpboot
  • initrd.img
    램디스크 파일
[root@web ~]# cp /media/images/pxeboot/initrd.img /var/lib/tftpboot
  • vmlinuz
    압축된 리눅스 커널 파일
[root@web ~]# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot

[root@web ~]# systemctl restart tftp
[root@web ~]# systemctl enable tftp
  • exam1) pxe-client 부팅 파일 확인

 

3-3. FTP 서버 구성

  • iso 파일 내용 전부를 ftp 디렉토리에 복사
[root@web ~]# cp -r /media/* /var/ftp/pub
  • 디렉토리 만들고 해당 경로로 이동
[root@web ~]# mkdir /var/lib/tftpboot/pxelinux.cfg
[root@web ~]# cd /var/lib/tftpboot/pxelinux.cfg
  • 부팅 방식 결정
[root@web pxelinux.cfg]# vi default
DEFAULT pxe-client
LABEL pxe-client
 kernel vmlinuz
 APPEND initrd=initrd.img repo=ftp://ftp.sulnal.com/pub
# repo=ftp://172.16.101.4/pub
[root@web pxelinux.cfg]# systemctl restart vsftpd
[root@web pxelinux.cfg]# systemctl enable vsftpd
  • exam1) pxe-client OS 설치 환경 구축

 

접을뻔...ㅋ 문제가 생겼던 이유

1. RAM이 1GB → 2GB

2. kickstart 설정 오류

3. 만약 repo=ftp://ftp.sulnal.com/pub이 안된다면 dns 오류

 

3-4. WEB 서버 구성 (kickstart)

  • /var/kick/kick.cfg 내용 복붙
[root@web]# cd /var/ftp/pub
[root@web pub]# vi kick.cfg
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Install OS instead of upgrade
install
# Keyboard layouts
keyboard 'us'
# Root password
rootpw --iscrypted 1OY1ngum$NEOqu9p9uxPnFG3pcRaGD0
# System language
lang en_US
# System authorization information
auth  --useshadow  --passalgo=sha512
# Use graphical install
graphical
firstboot --disable
# SELinux configuration
selinux --enforcing

# Firewall configuration
firewall --disabled
# Reboot after installation
reboot
# System timezone
timezone Africa/Abidjan --utc
# Use network installation
url --url="ftp://ftp.sulnal.com/pub"
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part swap --fstype="swap" --size=2048
part / --fstype="xfs" --grow --size=1

%packages
@^minimal
@core
chrony
kexec-tools

%end
  • pxe pub에 킥스타트 절차 추가
[root@web pub~]# vi /var/lib/tftpboot/pxelinux.cfg/default
DEFAULT centos7_pxe
LABEL centos7_pxe
 kernel vmlinuz
 APPEND initrd=initrd.img repo=ftp://ftp.sulnal.com/pub ks=ftp://ftp.sulnal.com/pub/kick.cfg
[root@web pxelinux.cfg]# systemctl restart httpd
[root@web pxelinux.cfg]# systemctl enable httpd
  • exam1) pxe-client 자동 부팅 확인

 

 접을뻔...ㅋ PANE이가 자꾸 죽었던 이유 

1. kick.cfg에 url 잘못 들어가 있음...

2. kick.cfg에 복붙할때, rootpw가 잘못되어 있었음

4. exam3) NFS 서버

  • 패키지 설치
[root@nfs ~]# yum install -y mdadm lvm2 nfs-utils

 

4-1. RAID 16

exam1에게 3GB의 용량을 제공

사용 가능 용량 = 1/2(디스크 개수 × X)× (RAID 6 가용 비율​ / 총 디스크 개수)

X 1.125 → 안정적으로 2GB라고 설정

  • 2GB 디스크 8개 추가

  • 파티션 생성
[root@nfs ~]# fdisk /dev/sdb
...
[root@nfs ~]# fdisk /dev/sdi

  • RAID 1 디스크 배열 md1 ~ md4 생성
[root@nfs ~]# mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1
[root@nfs ~]# mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sdd1 /dev/sde1
[root@nfs ~]# mdadm --create /dev/md3 --level=1 --raid-devices=2 /dev/sdf1 /dev/sdg1
[root@nfs ~]# mdadm --create /dev/md4 --level=1 --raid-devices=2 /dev/sdh1 /dev/sdi1
  • RAID 6 디스크 배열 md16를 생성
[root@nfs ~]# mdadm --create /dev/md16 --level=6 --raid-devices=4 /dev/md1 /dev/md2 /dev/md3 /dev/md4
  • 잘 만들어졌는지 확인
[root@nfs ~]# mdadm -D /dev/md16

  • 파일시스템 생성
[root@nfs ~]# mkfs -t ext4 /dev/md1
  • 마운트 포인트 생성
[root@nfs ~]# mkdir /rshared
  • 마운트
[root@nfs ~]# mount /dev/md16 /rshared

  • 마운트 유지
[root@client ~]# vi /etc/fstab
# 아래 내용 추가
/dev/md16                /rshared                  ext4    defaults        0 0

 

4-2. LVM

exam2에게 2~5GB의 용량을 제공

  • 5GB 디스크 1개 추가

  • 파티션 생성
[root@nfs ~]# fdisk /dev/sdj
  • 물리디스크를 pv로 선언
[root@nfs ~]# pvcreate /dev/sdj1
  Physical volume "/dev/sdj1" successfully created.
  • volume group 생성
[root@nfs ~]# vgcreate myvg /dev/sdj1
  Volume group "myvg" successfully created
  • volume group 안에 있는 logical volume인 mylv 생성
[root@nfs ~]# lvcreate --extents +100%FREE --name mylv myvg
  Logical volume "mylv" created.
  • 파일시스템 생성
[root@nfs ~]# mkfs.ext4 /dev/myvg/mylv
  • 마운트 포인트 생성
[root@nfs ~]# mkdir /lshared
  • 마운트
[root@nfs ~]# mount /dev/myvg/mylv /lshared
  • 마운트 유지
[root@nfs ~]# vi /etc/fstab
# 아래 내용 추가
/dev/myvg/mylv                /lshared                  ext4    defaults 0 0

 

4-3. NFS 서버 구성

RAID 16으로 /rshared 폴더를 구성, exam1의 마운트포인트는 /rremote

LVM으로 /lshared 폴더를 구성, exam2의 마운트포인트는 /lremote

  • nfs로 공유할 대상을 설정하는 파일 수정
[root@srv3 ~]# vi /etc/exports
# 아래 내용 추가
/rshared        172.16.101.*(rw)
/lshared        172.16.101.*(rw)

# /rshared *(rw)
# /lshared www.sulnal.com(rw)
  • 설정값 반영
[root@nfs ~]# exportfs -r

[root@nfs ~]# systemctl restart nfs-server
[root@nfs ~]# systemctl enable nfs-server

5. exam1) NFS 클라이언트

  • 패키지 설치
[root@pxe-client ~]# yum install -y nfs-utils
  • DNS 설정 변경
[root@pxe-client ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens32
DNS1="172.16.101.35"
  • 마운트 포인트 생성
[root@pxe-client ~]# mkdir /rremote
  • 마운트
[root@pxe-client ~]# mount -t nfs nfs.sulnal.com:/rshared /rremote
  • 마운트 유지
[root@nfs ~]# vi /etc/fstab
# 아래 내용 추가
nfs.sulnal.com:/rshared                /rremote                  nfs    defaults 0 0

 

exam2) WEB 서버 /lshared

  • 마운트 포인트 생성
[root@web ~]# mkdir /var/www/html/lremote
  • 마운트
[root@web ~]# mount -t nfs nfs.sulnal.com:/lshared /lremote
  • 마운트 유지
[root@web ~]# vi /etc/fstab
# 아래 내용 추가
nfs.sulnal.com:/lshared                /var/www/html/lremote                  nfs    defaults 0 0