1. <dl id='8vzvx'></dl>
      <i id='8vzvx'><div id='8vzvx'><ins id='8vzvx'></ins></div></i>
    2. <tr id='8vzvx'><strong id='8vzvx'></strong><small id='8vzvx'></small><button id='8vzvx'></button><li id='8vzvx'><noscript id='8vzvx'><big id='8vzvx'></big><dt id='8vzvx'></dt></noscript></li></tr><ol id='8vzvx'><table id='8vzvx'><blockquote id='8vzvx'><tbody id='8vzvx'></tbody></blockquote></table></ol><u id='8vzvx'></u><kbd id='8vzvx'><kbd id='8vzvx'></kbd></kbd>

      <acronym id='8vzvx'><em id='8vzvx'></em><td id='8vzvx'><div id='8vzvx'></div></td></acronym><address id='8vzvx'><big id='8vzvx'><big id='8vzvx'></big><legend id='8vzvx'></legend></big></address>

        <span id='8vzvx'></span>

        <code id='8vzvx'><strong id='8vzvx'></strong></code>
        <ins id='8vzvx'></ins>
          <fieldset id='8vzvx'></fieldset>
        1. <i id='8vzvx'></i>

            通过Linux系统将Windows系统迁移到到新的磁盘上

            • 时间:
            • 浏览:9
            • 来源:124软件资讯网

                1. 概述

                这篇文章将告诉你怎样再 linux 系统下  ,将 安装好的windows版本 复制到新的磁盘上(新的磁盘大于即是window镜像巨细)

                2. 使用到的工具

                livecd 工具  ,可以是CD 也可以是USB启动的  ,需要有的工具 dd, fdisk, and ntfsresize.

                此例子中  ,使用如下假设:

                /dev/sdc (新硬盘)

                /dev/sdb (老硬盘  ,安装好的window版本数据在 /dev/sdb1 分区中)

                = 花样化新盘(/dev/sdc) =

                使用root 用户  ,举行如下分区操作

                代码如下:

                [root@centos6 ~]# fdisk /dev/sdc

                WARNING: DOS-compatible mode is deprecated. It's strongly recommended to

                switch off the mode (command 'c') and change display units to

                sectors (command 'u').

                Command (m for help): n

                Command action

                e extended

                p primary partition (1-4)

                p

                Partition number (1-4): 1

                First cylinder (1-2088, default 1):

                Using default value 1

                Last cylinder, +cylinders or +size{K,M,G} (1-2088, default 2088):

                Using default value 2088

                Command (m for help): p

                Disk /dev/sdc: 17.2 GB, 17179869184 bytes

                255 heads, 63 sectors/track, 2088 cylinders

                Units = cylinders of 16065 * 512 = 8225280 bytes

                Sector size (logical/physical): 512 bytes / 512 bytes

                I/O size (minimum/optimal): 512 bytes / 512 bytes

                Disk identifier: 0xa1c3a1c3

                Device Boot Start End Blocks Id System

                /dev/sdc1 1 2088 16771828+ 83 Linux

                在完成之前  ,我们必须设置启动标志和分区系统ID ,分区系统ID必须是WINDOWS的  ,ID值为 7.

                代码如下:

                Command (m for help): A

                Partition number (1-4): 1

                Command (m for help): t

                Selected partition 1

                Hex code (type L to list codes): 7

                Changed system type of partition 1 to 7 (HPFS/NTFS)

                Command (m for help): p

                Disk /dev/sdc: 17.2 GB, 17179869184 bytes

                255 heads, 63 sectors/track, 2088 cylinders

                Units = cylinders of 16065 * 512 = 8225280 bytes

                Sector size (logical/physical): 512 bytes / 512 bytes

                I/O size (minimum/optimal): 512 bytes / 512 bytes

                Disk identifier: 0xa1c3a1c3

                Device Boot Start End Blocks Id System

                /dev/sdc1 * 1 2088 16771828+ 7 HPFS/NTFS

                Command (m for help): w

                The partition table has been altered!

                Calling ioctl() to re-read partition table.

                Syncing disks.

                = 复制MBR =

                为了让新盘能够指导, 我们必须从Master Boot Record (MBR) 复制指导代码到新的磁盘上

                MBR 在磁盘的第一个扇区,由3部门组成:

                代码如下:

                Boot Code (446 bytes)

                Partition Table (64 bytes)

                Boot Code Signature = 55aa (2 bytes)

                我们只需要复制指导代码  ,起始的 446 bytes. 使用dd工具来复制:

               代码如下:

                # dd if=/dev/sdb of=/dev/sdc bs=446 count=1

                1+0 records in

                1+0 records out

                446 bytes transferred in 0.026312 seconds (16950 bytes/sec)

                = 复制分区 =

                下一步使命就是将文件系统从一个盘复制到另一个盘上.在这里我们使用 ntfsclone 工具来复制 NTFS 文件系统

                代码如下:

                [root@centos6 ~]# ntfsclone --overwrite /dev/sdc1 /dev/sdb1

              < p> ntfsclone v2013.1.13 (libntfs-3g)

                NTFS volume version: 3.1

                Cluster size : 4096 bytes

                Current volume size: 10725732352 bytes (10726 MB)

                Current device size: 10725732864 bytes (10726 MB)

                Scanning volume ...

                100.00 percent completed

                Accounting clusters ...

                Space in use : 7565 MB (70.5%)

                Cloning NTFS ...

                100.00 percent completed

                Syncing ...

                若是在源盘上有坏的扇区 ,则需要添加 --rescue 选项

                代码如下:

                # ntfsclone --rescue --overwrite /dev/sdc1 /dev/sdb1

                注重: 源盘 是 最后一个参数(/dev/sdb1)

                3. 改变分区巨细

                在新盘比源盘大的情形下  ,我们需要改变分区巨细来使用所有空间  ,这里我们使用 ntfsresize 下令

                代码如下:

                [root@centos6 ~]# ntfsresize /dev/sdc1

              < p> ntfsresize v2013.1.13 (libntfs-3g)

                Device name : /dev/sdc1

                NTFS volume version: 3.1

                Cluster size : 4096 bytes

                Current volume size: 10725732864 bytes (10726 MB)

                Current device size: 17174352384 bytes (17175 MB)

                New volume size : 17174348288 bytes (17175 MB)

                Checking filesystem consistency ...

                100.00 percent completed

                Accounting clusters ...

                Space in use : 7565 MB (70.5%)

                Collecting resizing constraints ...

                WARNING: Every sanity check passed and only the dangerous operations left.

                Make sure that important data has been backed up! Power outage or computer

                crash may result major data loss!

                Are you sure you want to proceed (y/[n])? y

                Schedule chkdsk for NTFS consistency check at Windows boot time ...

                Resetting $LogFile ... (this might take a while)

                Updating $BadClust file ...

                Updating $Bitmap file ...

                Updating Boot record ...

                Syncing device ...

                Successfully resized NTFS on device '/dev/sdc1'.

                4. 使用新盘重新启动系统

                重新启动后  ,windows 会自动检查文件系统如下(由于分区巨细有所转变),检查完成后自动重起就能进入windows系统了

                5. 总结

                固然这种方式的拷贝是在统一台服务器上操作的(驱动无转变),若是将一个洁净的windows裸系统通过这种方式安装到差别型号的服务器上时  , 就会泛起驱动问题  ,怎样解决  ,请看下回剖析!