카테고리 없음

오라클 프리티어 인스턴스 재부팅 후 드라이브 연결 해제 (홈페이지 403 에러) / 재부팅시 자동 마운팅하기

visualy 2025. 3. 18. 17:08

상황 : 오라클 프리티어로 인스턴스(가상서버)를 만들어 별도의 인스턴스로 50기가짜리 드라이브를 만들어 그 안에 호스팅 파일을 넣어서 홈페이지 운용중

아래와 같이 서버가 재부팅되었다는 메일을 받음


Oracle Cloud Infrastructure Compute - Reboot Detected on Virtual Machine Instance

Oracle Cloud Infrastructure Customer,

The Oracle Cloud Infrastructure team detected the instance(s) identified below rebooted one or more times during the incident window listed in this notification, due to an error within the underlying infrastructure.

The error has been corrected and our monitoring indicates these instance(s) are now in a healthy state. We recommend that you verify the affected instance(s) are performing as expected. If assistance is required, please contact support.

REF: COMPUTE-4

 

서버가 재부팅 되었다는 것

홈페이지 들어가보니 403 에러가 뜨면서 접속이 안된다.

확인해보니 연결은 되었지만 마운트가 풀린 상태. mnt 폴더 안에 파일이 보여야 하는데 비어 있음.

마운트 확인하는 방법  : lsblk 명령어

NAME    MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
loop0     7:0    0 55.4M  1 loop /snap/core18/2846
loop1     7:1    0 55.4M  1 loop /snap/core18/2855
loop2     7:2    0 63.7M  1 loop /snap/core20/2434
loop3     7:3    0 63.8M  1 loop /snap/core20/2496
loop4     7:4    0 91.9M  1 loop /snap/lxd/29619
loop5     7:5    0 77.3M  1 loop /snap/oracle-cloud-agent/72
loop6     7:6    0 44.5M  1 loop /snap/snapd/23771
loop7     7:7    0 44.4M  1 loop /snap/snapd/23545
loop8     7:8    0 91.9M  1 loop /snap/lxd/32662
sda       8:0    0 46.6G  0 disk
├─sda1    8:1    0 46.5G  0 part /
├─sda14   8:14   0    4M  0 part
└─sda15   8:15   0  106M  0 part /boot/efi
sdb       8:16   0   50G  0 disk
└─sdb1    8:17   0   50G  0 part     [이부분에 폴더명이 안보이면 마운트가 안된것]

 

sdb1 드라이브를 mnt폴더로 마운트하기  : sudo mount /dev/sdb1 /mnt

그래도 안되면 아파치 서버 재시작

sudo systemctl restart apache2

 

 

<서버가 재부팅될 경우 자동으로 마운팅하기 >

fstab 파일 편집하기 : sudo nano /etc/fstab

세팅이 아래와 같이  있었는데 제대로 작동을 안한 듯.

UUID=????????????????????     /mnt/ ext4 defaults,_netdev,nofail 0 2

이번엔

/dev/sdb1 /mnt ext4 defaults 0 2

로 일단 변경해둠.

 

서버 재부팅 테스트  :  sudo reboot

연결이 끊어지고 재부팅에 2분 이상 걸리는 듯

그래도 안됨. 아래로 변경.

/dev/sdb1    /mnt    ext4    defaults,_netdev    0  2

_netdev 옵션 추가

클라우드 환경에서처럼 원격 디스크를 마운트하는 경우에는 "_netdev" 옵션을 사용하는 것이 좋습니다. 이 옵션은 네트워크가 연결된 후에 마운트되도록 합니다. 로컬 디스크에서는 필요하지 않지만, 클라우드 서버나 네트워크 드라이브를 사용하고 있다면 "_netdev" 옵션을 추가해야 합니다.

 

재부팅 이후에도 잘 작동함!

sdb       8:16   0   50G  0 disk
└─sdb1    8:17   0   50G  0 part /mnt