검색

이 콘텐츠는 선택한 언어로 제공되지 않습니다.

6.5. Restore an ext2/3/4 File System

download PDF

Procedure 6.2. Restore an ext2/3/4 File System Example

  1. If you are restoring an operating system partition, bootup your system into Rescue Mode. This step is not required for ordinary data partitions.
  2. Rebuild sda1/sda2/sda3/sda4/sda5 by using the fdisk command.

    Note

    If necessary, create the partitions to contain the restored file systems. The new partitions must be large enough to contain the restored data. It is important to get the start and end numbers right; these are the starting and ending sector numbers of the partitions.
  3. Format the destination partitions by using the mkfs command, as shown below.

    Important

    DO NOT format /dev/sda6 in the above example because it saves backup files.
    # mkfs.ext3 /dev/sda1
    # mkfs.ext3 /dev/sda2
    # mkfs.ext3 /dev/sda3
    
  4. If creating new partitions, re-label all the partitions so they match the fstab file. This step is not required if the partitions are not being recreated.
    # e2label /dev/sda1 /boot1
    # e2label /dev/sda2 /
    # e2label /dev/sda3 /data
    # mkswap -L SWAP-sda5 /dev/sda5
    
  5. Prepare the working directories.
    # mkdir /mnt/sda1
    # mount -t ext3 /dev/sda1 /mnt/sda1
    # mkdir /mnt/sda2
    # mount -t ext3 /dev/sda2 /mnt/sda2
    # mkdir /mnt/sda3
    # mount -t ext3 /dev/sda3 /mnt/sda3
    # mkdir /backup-files
    # mount -t ext3 /dev/sda6 /backup-files
    
  6. Restore the data.
    # cd /mnt/sda1
    # restore -rf /backup-files/sda1.dump
    # cd /mnt/sda2
    # restore -rf /backup-files/sda2.dump
    # cd /mnt/sda3
    # restore -rf /backup-files/sda3.dump
    
    If you want to restore from a remote host or restore from a backup file on a remote host you can use either ssh or rsh. You will need to configure a password-less login for the following examples:
    Login into 10.0.0.87, and restore sda1 from local sda1.dump file:
    # ssh 10.0.0.87 "cd /mnt/sda1 && cat /backup-files/sda1.dump | restore -rf -"
    
    Login into 10.0.0.87, and restore sda1 from a remote 10.66.0.124 sda1.dump file:
    # ssh 10.0.0.87 "cd /mnt/sda1 && RSH=/usr/bin/ssh restore -r -f 10.66.0.124:/tmp/sda1.dump"
    
  7. Reboot.
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.