Cloud_OCI

[OCI] Block Volume 마운트 하기

최선을 다하자! 2023. 5. 16. 13:46

1. OCI 에서 생성한 Block Volume 의 Device Path을 확인할 수 있다.

$ ls -arlt /dev/oracleoci/
total 0
lrwxrwxrwx.  1 root root    6 May 16 02:11 oraclevda -> ../sda
lrwxrwxrwx.  1 root root    7 May 16 02:11 oraclevda2 -> ../sda2
lrwxrwxrwx.  1 root root    7 May 16 02:11 oraclevda3 -> ../sda3
lrwxrwxrwx.  1 root root    7 May 16 02:11 oraclevda1 -> ../sda1
drwxr-xr-x. 21 root root 3300 May 16 02:19 ..
drwxr-xr-x.  2 root root  140 May 16 02:19 .
lrwxrwxrwx.  1 root root    6 May 16 04:25 oraclevdb -> ../sdb

 

2. 마운트할 디렉토리를 생성한다.

더보기

sudo mkdir /mnt/vol1 

 

3. /etc/fstab 수정하기 

OCI 도큐를 두번째 센텐스를 읽어보면 인스턴스 재기동시 장착한 Volume의 장애로 인한 영향을 줄이기 위해 _netdev,nofail 옵션을 반드시 추가하라는 내용이 있다.

 

4. 따라서 sudo vi /etc/fstab 수정하기 

가장 하단에 아래 내용을 추가한다.

더보기

/dev/oracleoci/oraclevdb /mnt/vol1 xfs defaults,_netdev,nofail 0 2 

 

 

 

5. sudo mount -a 마운트하기

 

attach된 block Volume이  /mnt/vol1 디렉토리에 마운트 되었다.

 

6.  인스턴스 재시작

/etc/fstab에 추가하였기 때문에 인스턴스 재시작시에도 자동으로 마운트됨.

재시작 후에도 /mnt/vol1으로 마운트 되어 있는 걸 알 수 있음.