폐쇄망 ubuntu 백업 및 버전 업그레이드 방법

thousand_yj·2024년 8월 13일
0

리눅스

목록 보기
1/3

현 상황

폐쇄망 ubuntu가 18.04 버전이라 호환가능한 nodeJS 버전이 너무 낮음
-> NextJS나 React 들여오기엔 한계가 있어서 업글 필요

업그레이드는 한번에는 불가능하고 18 -> 20 -> 22 해줘야 하는데, usb로 iso 파일을 가져다가 해보기로 했다

다만 문제점은 미리 백업을 해두고 작업을 진행하는 것이 안전할 것 같은데 백업할 수 있는 패키지가 폐쇄망에 없다

따라서 VM에 폐쇄망과 동일한 환경을 설정하여 timeshift 패키지를 설치 후, 해당 파일을 반입하여 설치해보려 한다.

인터넷 되는 PC에서

VM을 다운받고, ubuntu 18.04 환경으로 실행해주었다.
terminal도 안 켜져서 언어설정을 English(US) -> English(Canada)로 바꿔주고 하니까 된다..
물론 sudo 권한도 없어서 구글링을 통해 권한 부여하고 sudoers 폴더에도 넣어주었다.

timeshift는 20부터 제대로 지원하는지, 18은 다음과 같이 설치해야 함

sudo add-apt-repository -y ppa:teejee2008/ppa
sudo apt-get update
sudo apt-get install timeshift

(참고 블로그 : https://joggle.tistory.com/3)

deb 파일 만들기

https://tw0226.tistory.com/13 참고하여 진행함

VM VirbutalBox <-> Window 간 파일 옮기기

https://yeni03-0w0.tistory.com/34 & https://pururing-log.tistory.com/60
두 블로그 참고하여 진행
공유폴더 만들어서 deb 파일 내보낸 뒤, usb에 저장하기

폐쇄망 PC

deb 파일 설치하기

sudo dpkg -i /path/to/deb/file.deb 로 파일을 설치해준다.
(스택오버플로우 참고)

timeshift 실행하여 백업하기 (시스템 백업)

GUI 버전 링크 참고하여 진행
Command Line버전 링크 참고하여 진행
Command Line버전2 여기 링크를 봐도 괜찮았다.

tar 사용하여 백업하기 (데이터 백업)

참고블로그

timeshift는 데이터백업은 안된다고 하니... tar 사용해서 전체 서버 백업도 해두자


백업이 완료되면 다시 인터넷 되는 PC에서 ubuntu 20 iso 파일을 준비하자

인터넷 PC

iso 파일 다운받아 부팅디스크 만들기

  1. iso 파일 다운받기
    ubuntu desktop이랑 server 두개 있는데 GUI 유무 차이라고 한다. 기존 서버가 server여서 동일하게 다운받았다.
  2. Rufus 프로그램을 사용하여 usb에 부팅디스크 만들기

폐쇄망 PC

upgrade Ubunutu

  1. usb 꽂고 켜기 (bios에서 부팅을 usb를 먼저 인식하게 해줘야 한다)
    https://ubuntu.com/tutorials/install-ubuntu-server#1-overview 공식 페이지를 참고하자
    아니면 여기도 참고했다

    To upgrade Ubuntu using a bootable USB drive:
    1) Create a bootable USB drive with the latest Ubuntu installer. You can download the ISO from the Ubuntu website and use a tool like Rufus or balenaEtcher to create the bootable USB.
    2) Plug the bootable USB into the computer you want to upgrade.
    3) Reboot the computer and enter the BIOS or boot menu. This is usually done by pressing a key like F2, F12, or Del during boot.
    4) In the BIOS or boot menu, select the bootable USB drive as the boot device.
    5) The Ubuntu installer will load from the USB drive. Choose the "Upgrade Ubuntu" option and follow the on-screen instructions to complete the upgrade process.
    The installer will guide you through the steps to upgrade your existing Ubuntu installation to the newer version, preserving your personal files and settings where possible. Make sure to back up any important data beforehand just in case.

profile
함께 일하고 싶은 개발자가 되기 위해 노력합니다. 코딩테스트 관련 공부 및 이야기는 티스토리에도 업로드되어 있습니다.

0개의 댓글