设为首页 - 加入收藏 ASP站长网(Aspzz.Cn)- 科技、建站、经验、云计算、5G、大数据,站长网!
热搜: 创业者 手机 数据
当前位置: 首页 > 服务器 > 系统 > 正文

使用Clonezilla迁移到虚拟Linux环境(6)

发布时间:2018-04-22 12:07 所属栏目:52 来源:ibm.com
导读:步骤 3. 将映像恢复到虚拟机 当虚拟机从 Clonezilla Live 映像启动之后,Clonezilla Live 为恢复提供了和备份过程相同的基于 GUI 的向导界面,引导您选择模式。在本例中,我们将直接输入基于 Debian 的 Clonezilla

步骤 3. 将映像恢复到虚拟机

当虚拟机从 Clonezilla Live 映像启动之后,Clonezilla Live 为恢复提供了和备份过程相同的基于 GUI 的向导界面,引导您选择模式。在本例中,我们将直接输入基于 Debian 的 Clonezilla Live shell,以选择一个手动恢复。

图 8. Clonezilla Live shell

Clonezilla Live shell

要在 Clonezilla Live shell 下恢复映像,必须以根用户身份登录;随后可以完全地访问 Clonezilla。

清单 1. 成为根用户

user@debian:~$ sudo su -

debian:~#

现在,需要为恢复确定一个目标磁盘以及将要放置源映像的磁盘。清单 2 展示了两个本地硬盘。

清单 2. 查看磁盘信息

debian:~# fdisk -l

Disk /dev/sda: 42.9 GB, 42949672960 bytes

255 heads, 63 sectors/track, 5221 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x00000000

Disk /dev/sda doesn‘t contain a valid partition table

Disk /dev/sdb: 160.0 GB, 160039272960 bytes

255 heads, 63 sectors/track, 19457 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0xa0bea0be

Device Boot Start End Blocks Id System

/dev/sdb1 1 19457 156288321 7 HPFS/NTFS

我们将 /dev/sda 虚拟磁盘创建为恢复的目标磁盘;它尚未格式化。/dev/sdb 是主机服务器的 PhysicalDrive 1,我们将把它作为直通式 SCSI 磁盘直接附加到虚拟机;我们将在其上放置克隆后的系统映像。

要恢复克隆后的分区映像,必须将格式化后的目标虚拟磁盘提供给 Clonezilla。您可以使用 fdisk 工具将标签写到虚拟磁盘上。该过程如清单 3 所示。

清单 3. 格式化目标磁盘

# fdisk /dev/sda

Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

Building a new DOS disklabel with disk identifier 0xee2955bc.

Changes will remain in memory only, until you decide to write them.

After that, of course, the previous content won’t be recoverable.

The number of cylinders for this disk is set to 5221.

There is nothing wrong with that, but this is larger than 1024,

and could in certain setups cause problems with:

1) software that runs at boot time (e.g., old versions of LILO)

2) booting and partitioning software from other OSs

(e.g., DOS FDISK, OS/2 FDISK)

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help):

Command action

e extended

p primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-5221, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-5221, default 5221):

Using default value 5221

Command (m for help):

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

[ 866.679048] sd 0:0:0:0: [sda] 83886080 512-byte hardware sectors (42950 MB)

[ 866.682658] sd 0:0:0:0: [sda] Write Protect is off

[ 866.683795] sd 0:0:0:0: [sda] Cache data unavailable

[ 866.683822] sd 0:0:0:0: [sda] Assuming drive cache: write through

[ 866.686443] sda: sda1

[ 866.695530] sd 0:0:0:0: [sda] 83886080 512-byte hardware sectors (42950 MB)

[ 866.698278] sd 0:0:0:0: [sda] Write Protect is off

[ 866.699422] sd 0:0:0:0: [sda] Cache data unavailable

[ 866.699495] sd 0:0:0:0: [sda] Assuming drive cache: write through

[ 868.702058] sda: sda1

Syncing disks.

我们可以使用清单 3 所示的默认值。这一次,不需要关心分区类型,因为 Clonezilla 将在映像恢复过程中重新创建它。

(编辑:ASP站长网)

网友评论
推荐文章
    热点阅读