TheKoguryo's 기술 블로그

 Version 2024.04.01

3.6.6 Block Volume 장착 해제하기

언마운트 하기

  1. Compute Instance에 SSH로 접속합니다.

  2. /etc/fstab 업데이트

    sudo vi /etc/fstab 명령을 수행하여 fstab 파일에서 언마운트할 Volume인 /mnt/vol1을 삭제합니다.

    sudo vi /etc/fstab
    
  3. 언마운트

    sudo umount /mnt/vol1
    

Volume에 연결 끊기

  1. OCI 콘솔에서 내비게이션 메뉴를 엽니다. Compute > Instances 항목으로 이동합니다.

  2. 앞서 생성한 대상 Instance의 이름을 클릭합니다.

  3. Instance 상세 페이지에서 왼쪽 아래의 Resources > Attached block volumes을 클릭합니다.

  4. 방금 장착한 Block Volume 옆에 있는 액션 아이콘(우측 점 3개)을 클릭한 다음 iSCSI commands and information을 클릭합니다.

    image-20230504154549304

  5. iSCSI Commands and Information 다이얼로그가 뜹니다.

    image-20230504160720611

  6. Disconnect의 명령을 복사해서 Instance에 접속한 SSH 세션에서 순서대로 하나씩 실행합니다.

    [opc@examplelinuxinstance ~]$ sudo iscsiadm -m node -T iqn.2015-12.com.oracleiaas:90414f1a-9432-47a0-bd3b-def97af8f86b -p 169.254.2.2:3260 -u
    Logging out of session [sid: 1, target: iqn.2015-12.com.oracleiaas:90414f1a-9432-47a0-bd3b-def97af8f86b, portal: 169.254.2.2,3260]
    Logout of [sid: 1, target: iqn.2015-12.com.oracleiaas:90414f1a-9432-47a0-bd3b-def97af8f86b, portal: 169.254.2.2,3260] successful.
    [opc@examplelinuxinstance ~]$ sudo iscsiadm -m node -o delete -T iqn.2015-12.com.oracleiaas:90414f1a-9432-47a0-bd3b-def97af8f86b -p 169.254.2.2:3260
    
  7. 장착해제 여부를 확인하기 위해 fdisk -l 명령으로 확인합니다.

    /dev/sdb 디스크가 없어진 것을 확인할 수 있습니다.

    [opc@examplelinuxinstance ~]$ sudo fdisk -l
    Disk /dev/sda: 46.6 GiB, 50010783744 bytes, 97677312 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 1048576 bytes
    Disklabel type: gpt
    Disk identifier: 812F8A56-E8ED-417C-BD3D-661E60705756
    
    Device       Start      End  Sectors  Size Type
    /dev/sda1     2048   206847   204800  100M EFI System
    /dev/sda2   206848  2303999  2097152    1G Linux filesystem
    /dev/sda3  2304000 97675263 95371264 45.5G Linux LVM
    
    
    Disk /dev/mapper/ocivolume-root: 35.5 GiB, 38088474624 bytes, 74391552 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 1048576 bytes
    
    
    Disk /dev/mapper/ocivolume-oled: 10 GiB, 10737418240 bytes, 20971520 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 1048576 bytes
    

Volume 장착 해제

  1. OCI 콘솔에서 장착 해제할 Block Volume 옆에 있는 액션 아이콘을 클릭한 다음 Detach를 클릭합니다.

    image-20230504161005188

  2. 경고문을 확인한 후 Detach volume을 클릭합니다. 우리는 /etc/fstab 정리, unmount, iSCSI Disconnect command를 앞서 모두 실행했습니다.

    image-20230504161050637

  3. Detaching 상태로 보입니다. 완료되면 Attached Block Volumes 목록에서 사라지게 됩니다.



이 글은 개인으로서, 개인의 시간을 할애하여 작성된 글입니다. 글의 내용에 오류가 있을 수 있으며, 글 속의 의견은 개인적인 의견입니다.

Last updated on 10 Jan 2022