실습환경
- OS: Oracle Linux 5 (Red Hat Enterprise 6.9)
목표
- /data(/dev/sdb1) 라벨(이름)을 /log(/dev/sdb1) 로 변경하기
실습
root@WAS01-DEV01:/root>#
# 현재 상태 확인
root@WAS01-DEV01:/root># df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_temporaclelinux6u9-lv_root
35G 29G 5.0G 85% /
tmpfs 1.9G 0 1.9G 0% /dev/shm
/dev/sda1 477M 83M 369M 19% /boot
/dev/sdb1 50G 7.1G 40G 16% /data
root@WAS01-DEV01:/root>#
root@WAS01-DEV01:/root>#
# fstab 설정 확인
root@WAS01-DEV01:/root># cat /etc/fstab
#
# /etc/fstab
# Created by anaconda on Wed Jul 18 09:47:39 2018
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_temporaclelinux6u9-lv_root / ext4 defaults 1 1
UUID=0ccab54b-42fb-45ef-909e-76ca0263c406 /boot ext4 defaults 1 2
/dev/mapper/vg_temporaclelinux6u9-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/sdb1 /data ext4 defaults 1 1
root@WAS01-DEV01:/root>#
root@WAS01-DEV01:/root>#
# Block Device 속성조회
root@WAS01-DEV01:/root># blkid
/dev/sda1: UUID="0ccab54b-42fb-45ef-909e-76ca0263c406" TYPE="ext4"
/dev/sda2: UUID="qxvjHg-oUyF-MHFy-qjFs-VYGX-0CTR-fa47f8" TYPE="LVM2_member"
/dev/sdb1: UUID="d401434a-23b3-4d05-9807-40955c5e3cef" TYPE="ext4"
/dev/mapper/vg_temporaclelinux6u9-lv_root: UUID="5b2c05ec-bfb7-4388-8e27-304e9d6ef6b7" TYPE="ext4"
/dev/mapper/vg_temporaclelinux6u9-lv_swap: UUID="a8dec53f-c71d-4363-8c99-09aa2cc46239" TYPE="swap"
root@WAS01-DEV01:/root>#
root@WAS01-DEV01:/root># 1004lucifer
# fstab 내용 수정
# 추후 디바이스 이름(/dev/sdb1)이 충돌날 우려를 막기위해 UUID로 강제 지정
# 마운트 이름을 /data => /log 변경
root@WAS01-DEV01:/root># vi /etc/fstab
#
# /etc/fstab
# Created by anaconda on Wed Jul 18 09:47:39 2018
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_temporaclelinux6u9-lv_root / ext4 defaults 1 1
UUID=0ccab54b-42fb-45ef-909e-76ca0263c406 /boot ext4 defaults 1 2
/dev/mapper/vg_temporaclelinux6u9-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
UUID=d401434a-23b3-4d05-9807-40955c5e3cef /log ext4 defaults 1 1
root@WAS01-DEV01:/root>#
root@WAS01-DEV01:/root>#
# /log 디렉토리가 없는경우 생성 (옵션)
# 기존에 디렉토리가 있는경우 내용이 모두 삭제되니 백업 필수
root@WAS01-DEV01:/root># mkdir /log
root@WAS01-DEV01:/root>#
root@WAS01-DEV01:/root>#
# /data 디렉토리에 접속한 사람이 있는경우 아래와 같이 나오며 unmount 되지 않는다.
root@WAS01-DEV01:/root># umount /data
umount: /data: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
root@WAS01-DEV01:/root>#
root@WAS01-DEV01:/root>#
root@WAS01-DEV01:/root>#
# 기존 라벨의 unmount 작업
root@WAS01-DEV01:/root># umount /data
root@WAS01-DEV01:/root>#
root@WAS01-DEV01:/root>#
# fstab에 기술된 모든 파일시스템을 마운트한다.
root@WAS01-DEV01:/root># mount -a
root@WAS01-DEV01:/root>#
root@WAS01-DEV01:/root>#
# 정상적으로 마운트 되었는지 확인
root@WAS01-DEV01:/root># df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_temporaclelinux6u9-lv_root
35G 29G 5.0G 85% /
tmpfs 1.9G 0 1.9G 0% /dev/shm
/dev/sda1 477M 83M 369M 19% /boot
/dev/sdb1 50G 7.1G 40G 16% /log
root@WAS01-DEV01:/root>#
root@WAS01-DEV01:/root>#
댓글
댓글 쓰기