用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):
root@sysresccd /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:

用Partimage创建或恢复分区备份的更多相关文章
- GitLab备份的创建与恢复
使用Gitlab一键安装包安装Gitlab非常简单, 同样的备份恢复与迁移也非常简单. 使用一条命令即可创建完整的Gitlab备份: gitlab-rake gitlab:backup:create使 ...
- linux centos 恢复 还原 备份 Snapper 快照说明
为什么要使用Snapper快照? 我们可以想像以下场景: 1. 场景一:系统发生意外宕机,工程师无法快速定位问题,业务受到中断,客户十分不满意. 2. 场景二:项目会议上,就是否升级某软件到最新版本, ...
- 如何让阿三 Windows 10、11 的恢复分区(Recovery Partition)恢复到 “盖茨” 模式
如何将 Windows Server 2022 的恢复分区(Recovery Partition)移动到 C 盘之前,恢复 C 盘容量调整功能. 请访问原文链接:https://sysin.org/b ...
- SQL Server 批量主分区备份(Multiple Jobs)
一.本文所涉及的内容(Contents) 本文所涉及的内容(Contents) 背景(Contexts) 案例分析(Case) 方案一(Solution One) 方案二(Solution Two) ...
- SQL Server 批量主分区备份(One Job)
一.本文所涉及的内容(Contents) 本文所涉及的内容(Contents) 背景(Contexts) 案例分析(Case) 实现代码(SQL Codes) 主分区完整.差异还原(Primary B ...
- 烂泥:通过binlog恢复mysql备份之前的数据
本文由秀依林枫提供友情赞助,首发于烂泥行天下. 上一篇文章,我们讲解了如何通过mysql的binlog日志恢复mysql数据库,文章连接为<烂泥:通过binlog恢复mysql数据库>.其 ...
- Kafka 分区备份实战
1.概述 在 Kafka 集群中,我们可以对每个 Topic 进行一个或是多个分区,并为该 Topic 指定备份数.这部分元数据信息都是存放在 Zookeeper 上,我们可以使用 zkCli 客户端 ...
- Oracle数据库文件恢复与备份思路
怎样才能对Oracle数据库进行备份?如何才能对删除的数据再进行恢复?这是困扰着很多人的问题.大家都知道,任何数据库在长期使用过程中,都会存在一定的安全隐患.对于数据库管理员来说不能仅寄希望于计算机操 ...
- win10安装提示“我们无法创建新的分区”
今日于笔记本安装win10时突然出现提示:我们无法创建新的分区.网上搜了不少建议,尝试了都无果. 由于我的笔记本是固态硬盘与机械硬盘混合,所以情况可能更加特殊. 最后成功的方法是: 1. 先将Win1 ...
随机推荐
- 别致的语言GO(GO语言初涉)
最近由于各种原因(好吧,其实是犯懒)已经许久没有再写新的博文了!最近正好在学习一门新的语言,所以正好记录一下自己的学习成果!最近利用每天晚上下班回来后的几小时,学习了Google开发的Go语言,算是对 ...
- Python不支持函数重载
函数重载与Python: 函数重载的好处就是不用为了不同的参数类型或参数个数,而写多个函数.多个函数用同一个名字,但参数表,即参数的个数和数据类型可以不同.调用的时候,虽然方法名字相同,但根据参数表可 ...
- Mac Mini2018 开箱(视频)全球首映!Kindle 开箱一并奉上(文字)
2018.12.9更新 为了方便大家收看我的这个开箱视频,我把视频放在知乎上了,可以参考如下连接即可观看啦: https://zhuanlan.zhihu.com/p/51677467 ------- ...
- [No0000CB]如何在命令行(cmd)通过TCP/IP端口(port)查询所在的进程号(pid)或进程名称,并终止该进程
1)首先查找占用某个端口的进程PID netstat -ano | findstr [port] 2)根据该进程pid查询进程名称或标题,确认那个程序在占用该端口 tasklist /v | fi ...
- [No0000B3].NET C# 单体模式(Singleton)
单体模式(Singleton)是经常为了保证应用程序操作某一全局对象,让其保持一致而产生的对象,例如对文件的读写操作的锁定,数据库操作的时候的事务回滚,还有任务管理器操作,都是一单体模式读取的.创建一 ...
- ms sql server 游标
很简单的一个小例子. /****** Object: StoredProcedure [dbo].[usp_test] Script Date: 10/28/2016 15:08:31 ******/ ...
- JAVA常用的异常处理情况
从编程到现在,遇见过很多次程序崩的情况,好多时候都不知道怎么去解决才好,一般性解决就是百度或者问别人,但是每一次百度解决的下一次还是会遇见同样的问题,也没有系统的整理梳理过相关的处理异常的知识,再一次 ...
- word2vec训练好的词向量
虽然早就对NLP有一丢丢接触,但是最近真正对中文文本进行处理才深深感觉到自然语言处理的难度,主要是机器与人还是有很大差异的,毕竟人和人之间都是有差异的,要不然不会讲最难研究的人嘞 ~~~~~~~~~~ ...
- SpringBoot-整合@transactional注解
springboot默认集成事务,只主要在方法上加上@Transactional即可
- .NET Core 使用 Kestrel
Kestrel介绍 Kestrel是一个基于libuv的跨平台web服务器 在.net core项目中就可以不一定要发布在iis下面了 Kestrel体验 可以使用useUrls来设置一个请求的地址 ...