Questo contenuto non è disponibile nella lingua selezionata.
6.5. Restore an ext2/3/4 File System
Procedure 6.2. Restore an ext2/3/4 File System Example
- If you are restoring an operating system partition, bootup your system into Rescue Mode. This step is not required for ordinary data partitions.
- 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. - 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
# mkfs.ext3 /dev/sda1 # mkfs.ext3 /dev/sda2 # mkfs.ext3 /dev/sda3
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 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
# e2label /dev/sda1 /boot1 # e2label /dev/sda2 / # e2label /dev/sda3 /data # mkswap -L SWAP-sda5 /dev/sda5
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Prepare the working directories.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Restore the data.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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 -"
# ssh 10.0.0.87 "cd /mnt/sda1 && cat /backup-files/sda1.dump | restore -rf -"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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"
# ssh 10.0.0.87 "cd /mnt/sda1 && RSH=/usr/bin/ssh restore -r -f 10.66.0.124:/tmp/sda1.dump"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Reboot.