TheKoguryo's 기술 블로그

 Version 2024.04.01

8.4 백업을 위한 스냅샷

실행한 시간 기준으로 File System의 Snapshot을 만들 수 있습니다. 만들어진 Snapshot을 통해 파일 또는 전체를 복구할 수 있습니다.

스냅샷 #1

  1. 테스트한 VM에 접속합니다.

  2. 마운트된 File System에 파일 하나를 복사합니다.

    [opc@examplelinuxinstance ~]$ cd /mnt/fss-system/
    [opc@examplelinuxinstance fss-system]$ wget https://github.com/oracle/oci-cli/releases/download/v3.26.0/oci-cli-3.26.0-Oracle-Linux-8-Offline.zip
    ...
    
    2023-05-08 09:34:54 (18.7 MB/s) - ‘oci-cli-3.26.0-Oracle-Linux-8-Offline.zip’ saved [67470000/67470000]
    
    [opc@examplelinuxinstance fss-system]$ ls -la
    total 67601
    drwxrwxrwx. 2 root root        3 May  8 09:34 .
    drwxr-xr-x. 4 root root       36 May  8 09:10 ..
    -rw-rw-r--. 1 opc  opc        19 May  8 09:10 hello1.txt
    -rw-rw-r--. 1 opc  opc        19 May  8 09:31 hello2.txt
    -rw-rw-r--. 1 opc  opc  67470000 May  4 14:08 oci-cli-3.26.0-Oracle-Linux-8-Offline.zip
    drwxrwxrwx. 2 root root        0 May  8 09:35 .snapshot
    
  3. 웹브라우저에서 OCI Console로 이동하여, 앞서 만든 File System의 상세화면으로 이동합니다.

  4. 왼쪽아래 Resources > Snapshots로 이동합니다.

  5. Snapshot을 만들기 위해 Create Snapshot 을 클릭합니다.

    image-20230508183623645

  6. Snapshot 생성화면

    image-20230508183649161

  7. 생성확인

    image-20230508183744928

  8. Compute Instance에서 확인

    마운트된 경로 바로 밑 .snapshot 폴더에 생성된 Snapshot과 파일들이 보입니다.

    [opc@examplelinuxinstance fss-system]$ ls -la .snapshot/
    total 2
    drwxrwxrwx. 3 root root 1 May  8 09:38 .
    drwxrwxrwx. 2 root root 3 May  8 09:34 ..
    drwxrwxrwx. 2 root root 3 May  8 09:34 Snapshot-20230508-0936-28
    [opc@examplelinuxinstance fss-system]$ ls -la .snapshot/Snapshot-20230508-0936-28/
    total 67601
    drwxrwxrwx. 2 root root        3 May  8 09:34 .
    drwxrwxrwx. 3 root root        1 May  8 09:38 ..
    -rw-rw-r--. 1 opc  opc        19 May  8 09:10 hello1.txt
    -rw-rw-r--. 1 opc  opc        19 May  8 09:31 hello2.txt
    -rw-rw-r--. 1 opc  opc  67470000 May  4 14:08 oci-cli-3.26.0-Oracle-Linux-8-Offline.zip
    

스냅샷 #2

  1. 접속한 Compute Instance에서 마운트된 File System에 파일을 하나 더 복사합니다.

    [opc@examplelinuxinstance fss-system]$ wget https://github.com/oracle/oci-cli/releases/download/v3.26.0/oci-cli-3.26.0-Oracle-Linux-7.9-Offline.zip
    ...
    
    2023-05-08 09:39:56 (25.5 MB/s) - ‘oci-cli-3.26.0-Oracle-Linux-7.9-Offline.zip’ saved [66835442/66835442]
    
    [opc@examplelinuxinstance fss-system]$ ls -la
    total 133137
    drwxrwxrwx. 2 root root        4 May  8 09:39 .
    drwxr-xr-x. 4 root root       36 May  8 09:10 ..
    -rw-rw-r--. 1 opc  opc        19 May  8 09:10 hello1.txt
    -rw-rw-r--. 1 opc  opc        19 May  8 09:31 hello2.txt
    -rw-rw-r--. 1 opc  opc  66835442 May  4 14:08 oci-cli-3.26.0-Oracle-Linux-7.9-Offline.zip
    -rw-rw-r--. 1 opc  opc  67470000 May  4 14:08 oci-cli-3.26.0-Oracle-Linux-8-Offline.zip
    drwxrwxrwx. 3 root root        1 May  8 09:39 .snapshot
    
  2. 웹브라우저에서 OCI Console로 이동하여, Snapshot을 하나 더 만듭니다.

  3. 두 번째 Snapshot생성 확인

    image-20230508184229809

  4. Compute Instance에서 확인

    .snapshot 폴더에 생성된 Snapshot과 파일들이 보입니다.

    [opc@examplelinuxinstance fss-system]$ ls -la .snapshot/
    total 2
    drwxrwxrwx. 4 root root 2 May  8 09:42 .
    drwxrwxrwx. 2 root root 4 May  8 09:39 ..
    drwxrwxrwx. 2 root root 3 May  8 09:34 Snapshot-20230508-0936-28
    drwxrwxrwx. 2 root root 4 May  8 09:39 Snapshot-20230508-0941-33
    [opc@examplelinuxinstance fss-system]$ ls -ls .snapshot/Snapshot-20230508-0936-28/
    total 67600
        8 -rw-rw-r--. 1 opc opc       19 May  8 09:10 hello1.txt
        8 -rw-rw-r--. 1 opc opc       19 May  8 09:31 hello2.txt
    67584 -rw-rw-r--. 1 opc opc 67470000 May  4 14:08 oci-cli-3.26.0-Oracle-Linux-8-Offline.zip
    [opc@examplelinuxinstance fss-system]$ ls -ls .snapshot/Snapshot-20230508-0941-33/
    total 133136
        8 -rw-rw-r--. 1 opc opc       19 May  8 09:10 hello1.txt
        8 -rw-rw-r--. 1 opc opc       19 May  8 09:31 hello2.txt
    65536 -rw-rw-r--. 1 opc opc 66835442 May  4 14:08 oci-cli-3.26.0-Oracle-Linux-7.9-Offline.zip
    67584 -rw-rw-r--. 1 opc opc 67470000 May  4 14:08 oci-cli-3.26.0-Oracle-Linux-8-Offline.zip
    
  5. Snapshot은 읽기 전용 폴더입니다.

    [opc@examplelinuxinstance fss-system]$ cd .snapshot/Snapshot-20230508-0941-33/
    [opc@examplelinuxinstance Snapshot-20230508-0941-33]$ ls -la
    total 133137
    drwxrwxrwx. 2 root root        4 May  8 09:39 .
    drwxrwxrwx. 4 root root        2 May  8 09:44 ..
    -rw-rw-r--. 1 opc  opc        19 May  8 09:10 hello1.txt
    -rw-rw-r--. 1 opc  opc        19 May  8 09:31 hello2.txt
    -rw-rw-r--. 1 opc  opc  66835442 May  4 14:08 oci-cli-3.26.0-Oracle-Linux-7.9-Offline.zip
    -rw-rw-r--. 1 opc  opc  67470000 May  4 14:08 oci-cli-3.26.0-Oracle-Linux-8-Offline.zip
    [opc@examplelinuxinstance Snapshot-20230508-0941-33]$ rm -rf oci-cli-3.26.0-Oracle-Linux-8-Offline.zip 
    rm: cannot remove 'oci-cli-3.26.0-Oracle-Linux-8-Offline.zip': Read-only file system
    
  6. Snapshot에 있는 파일 또는 특정 Snapshot을 전체 복사하는 방법을 통해 복구할 수 있습니다.



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

Last updated on 14 Jan 2022