用Partimage创建或恢复分区备份

1 Preliminary Note

Partimage is part of the system rescue CD found on http://www.sysresccd.org which is a multi-functional rescue CD useful for both Linux and Windows operating systems. It boots into a live environment with a lot of tools for partitioning, editing, etc. Download the SystemRescueCD here: http://sourceforge.net/projects/systemrescuecd/files/sysresccd-x86/2.6.0/systemrescuecd-x86-2.6.0.iso/download and burn it.

Partimage does not work on ext4 file systems and is experimental for ntfs file systems. The complete list of supported file systems can be found onhttp://www.partimage.org/Supported-Filesystems.

In this tutorial, I will use a hard disk partitioned into three parts: sda1 which is my swap partition, sda2 that I have Ubuntu Linux 12.04 installed on, and sda3 that has nothing on it but enough space to carry an image of sda2.

2 Boot SystemRescueCd

Insert your burnt CD into your CD tray and boot into the start screen. This is what it looks like:

Since I like graphical environments and this one loads really fast, I go down to 5) and start the graphical environment. While loading, the system will ask you for your keymap. Within 20 seconds, type in the name or the appropriate number from the table above:

The environment looks as follows. A root terminal will be opened by default:

3 Create A Partition Image

I will create an image of my Linux partition, sda2, on my empty partition sda3. If you don‘t know what partitions you have, go to the terminal and enter:

fdisk -l

The output will look like this (the bottom three rows are my partitions):

[email protected] /root % fdisk -l

Disk /dev/sda: 34.5 GB, 34527510528 bytes 
255 heads, 63 sectors/track, 4197 cylinders, total 67436544 sectors 
Units = sectors of 1 * 512 = 512 bytes 
Sector size (logical/physical): 512 bytes / 512 bytes 
I/O size (minimum/optimal): 512 bytes / 512 bytes 
Disk identifier: 0x0001b9b7

Device Boot Start End Blocks Id System 
/dev/sda1 2048 7999487 3998720 82 Linux swap / Solaris 
/dev/sda2 * 7999488 28565503 10283008 83 Linux 
/dev/sda3 28565504 67436543 19435520 83 Linux

To start Partimage, open the main menu on the bottom left of the desktop and go to System > Partimage. It will open in a new terminal window:

But before we can begin to back up, we first have to mount the partition we want to save the backup on. Create a folder within /mnt and mount the partition on that point. I will use sda3 for saving, replace it with the appropriate partition on your system:

mkdir /mnt/save
mount /dev/sda3 /mnt/save

Now go to the Partimage terminal again. Navigate through it using the TAB, ENTER, SPACE and arrow keys. First select the partition to back up and go to the next field with TAB. In the next line, enter the full path of the backup, including the name. You can select the path by using the asterisk on the next field. I will save my backup as /mnt/save/Ubuntu.gz (I will choose gzip as compression level which is why the file extension is gz. You can also choose bz2):

All settings on this page should now be complete if you want a usual backup, so press F5 to go to the next page. The predefined settings on that page should also be okay, but take a look on all of them:

Again, continue with F5. Enter a description for the backup. This description will be shown upon restoring it, to make sure that you picked the right one. To be on the safe side, enter some representable name and the date the backup was made. For demonstrational purposes I‘ll use a simple one:

Upon going to the next page, Partimage will prepare the backup. For some reason you may now get an error - this may be caused by choosing a partition for backup that does not have a supported file system or some other strange reason - with the message Can‘t read bitmap block 0 from image. If you are certain that you have a supported file system, try remounting your destination partition, then creating a new mount directory and mounting your partition to back up and unmounting that again. In my case, the steps would be following:

umount /mnt/save
mount /dev/sda3 /mnt/save
mkdir /mnt/tmp
mount /dev/sda2 /mnt/tmp
umount /mnt/tmp

For some reason, that worked for me. If everything worked, you will see the following window:

Partimage will then create a backup of your partition in the specified location:

If everything went well, you will see this message. Partimage will close itself after confirming:

4 Restore A Partition Image

To restore an image you basically do the same as before but choose the appropriate options in Partimage. Open it up again and select the partition to restore on the first field (chose the partition that will be overwritten by the image here, not the one where the image is located), the location of the image file on the second field (notice the name extension - .000 was appended to the name. If you are not sure what your backup image is called use the next asterisk field to browse for the correct one. The partition where your image is located has to be mounted. Just like for creating an image, this can be done with:

mount /dev/sda3 /mnt/save

Replace my partition identifier with yours and choose an existing folder.) and use the SPACE bar to select Restore partition from an image file on the next field. Press F5 to move on:

You will now be shown the description of the image file, if you entered one while creating the backup:

If you want to make sure nothing goes wrong, you can do a simulation of the restoration process first. Erasing blocks will only wear out your hard drive and is no necessity. Continue with F5:

The general information is then shown once more...

... and you are asked to confirm your choice to restore your backup image. Keep in mind that data on the destination partition will be overwritten by the image:

The image is then restored to the specified partition:

Following message is shown on success:

时间: 2024-11-09 15:20:10

用Partimage创建或恢复分区备份的相关文章

GitLab备份的创建与恢复

使用Gitlab一键安装包安装Gitlab非常简单, 同样的备份恢复与迁移也非常简单. 使用一条命令即可创建完整的Gitlab备份: gitlab-rake gitlab:backup:create使用以上命令会在/var/opt/gitlab/backups目录下创建一个名称类似为1393513186_gitlab_backup.tar的压缩包, 这个压缩包就是Gitlab整个的完整部分, 其中开头的1393513186是备份创建的日期. Gitlab 修改备份文件默认目录 你也可以通过修改/

Symantec Backup Exec 2014 备份Exchange 2013之七创建RDB恢复邮件

下面开始创建RDB进行邮箱恢复执行如下命令创建一个名为EDB01的恢复数据库,并连接到我们恢复的数据中的数据库和日志 其中-EdbFilePath指定的是刚才我们恢复的数据库的数据库文件,而-LogFolderPath是日志文档的当前文件夹,-Recovery指定当前创建的数据库为恢复数据库,-Name指定创建的恢复数据库的名字,-Server指定恢复数据库的所在服务器 运行如下命令提交日志文件 接下来使用eseutil  /mh来检查后数据库的状态,如果"Status=Dirty Shutdo

linux centos 恢复 还原 备份 Snapper 快照说明

为什么要使用Snapper快照? 我们可以想像以下场景: 1. 场景一:系统发生意外宕机,工程师无法快速定位问题,业务受到中断,客户十分不满意. 2. 场景二:项目会议上,就是否升级某软件到最新版本,A和B争执不断,A认为为了保持与其他软件的兼容性不能轻易升级,B认为升级能充分利用软件包的最新功能以及享受到新版本性能的提升 3. 场景三:服务器突然无法访问了,导致业务中断,工程师A和B因为追究责任争得不可开交,A说是B修改了某项配置导致的,B反驳说我的配置都是正确的,不可能出错. 但是Snapp

2013 Mac Air 装Win7双系统问题-安装程序无法创建新的分区,也无法定位系统 & Windows无法安装所需的文件,错误代码0x80070570

此非主讲安装过程,主说明过程中遇到的两个问题自己的解决方式. 准备: 准备以下Win7纯净版iso镜像,用Boot Camp方式安装Windows到16GU盘. Win7纯净版资源 问题一: Boot Camp开始分区安装后,进放Windows安装界面,在加载完之前下的驱动和点南完格式化选项后显示 : 安装程序无法创建新的分区,也无法定位系统 . 1)  出现此问题后,参考以下链接. http://support.apple.com/zh-cn/TS4599 苹果官方说明 http://www.

烂泥:通过binlog恢复mysql备份之前的数据

本文由秀依林枫提供友情赞助,首发于烂泥行天下. 上一篇文章,我们讲解了如何通过mysql的binlog日志恢复mysql数据库,文章连接为<烂泥:通过binlog恢复mysql数据库>.其中我们提到了的备份数据库要晚与要恢复的数据库时间,即要恢复的数据库在前,而备份的数据库在后. 当时我提到说会单独写一篇文章讲解这个情况,本篇文章我就来介绍如何通过binlog日志恢复比备份数据库早时的数据库状态.我们还是以上篇文章的数据及备份文件为基础,来进行本篇文章的讲解. ailanni数据库完整备份时,

用createinstallmedia创建可恢复的OSX安装DMG

准备 从App Store下载OS X安装程序,下载完成,会在应用程序目录[/Application]下找到类似[Install OS X 10.11 Developer Beta.app](中文名如:安装 OS X 10.xxxxxxxx.app) 制作 假设下载的安装就是[Install OS X 10.11 Developer Beta.app],下面是步骤: 1. 在桌面创建一个文件夹,命名为:OS X 10.11 El Capitan Beta 2. 将应用程序文件夹里的Install

归档模式下恢复没有备份的数据文件

测试环境 SQL> select * from v$version; BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production PL/SQL Release 11.2.0.4.0 - Production CORE    11.

LVM创建,缩减及快照备份

管理逻辑卷工具:LVM 逻辑卷:灵活可动态存储的一种逻辑上的存储 最底层需要通过工具变成"物理卷":存储设备,Raid ,分区等 VG:(1)底层设备容量之和.(2)PE大小*数量 卷组上面一个块叫PE.默认每个块为4M,可更改. 一.首先创建分区 # fdisk /dev/sdb 二. 查看系统内是否已经安装LVM [[email protected] share]# rpm -qa |grep lvm lvm2-libs-2.02.98-9.el6.x86_64 lvm2-2.02

Active Directory 恢复与备份最佳实操

请问你,AD管理员,你有AD恢复预案吗?当被问到这个问题时,多数AD管理员只会告诉您对象恢复预案. 仅有一少部分管理员会准备充分,并且有域控制器恢复预案.管理员没有将灾难恢复预案放置优先表的一个最主要的原因是,AD作为基础设施服务到底有多稳固?然而,这会造成一种虚假的安全感,让您更加有理由有一份适当的灾难恢复预案.本博客会列出一些保障AD环境安全的实操案例.?制作灾难恢复预案在指定灾难恢复预案时,您需要注意以下几点:每个月至少配置一个域控制器最新的域控制器恢复不应早于tombstone生命周期的