下载中心  |   网站地图  |   站内搜索  |   加入收藏
最新更新
安恒动态
产品信息
业界动态
技术文章


安恒公司 / 技术文章 / 安恒公司网管员手记 / 磁盘完整映像的mount
磁盘完整映像的mount
2007-05-28    刘世伟       阅读:
在linux下我们常常用dd来对硬盘进行完整备份.本文告诉你如何把这个完整备份文件,mount到系统中加以利用.
dd做出来的备份,虽然没有压缩,体积巨大, 但是,我们可以把它的分区mount到系统中处理它的数据.

要mount磁盘映像,就要用到mount的-o office参数来指定分区的开始位置. offset的参数的单位是字节.
我们只要找到分区的开始位置字节数, 就能顺利的mount这个磁盘映像的分区.

可以使用fdisk来看每个分区的起始逻辑扇区号,扇区号乘以512就是我们所要的偏移值,
由下面的例子,我们可以看出有2个主分区,第2个是有效的,偏移分别是
hda1=2048*512=1048576,hda2=13672448*512=7000293376
因此mount命令分别是:
mount -o loop,offset=1048576 hda.img /mnt/hda1
mount -o loop,offset=7000293376 hda.img /mnt/hda2 

#fdisk -l -u -C 1  hda.img

Disk hda: 0 MB, 0 bytes
255 heads, 63 sectors/track, 1 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes

Device Boot      Start         End      Blocks   Id  System
  hda1            2048    13672447     6835200   27  Unknown
Partition 1 does not end on cylinder boundary.
  hda2   *    13672448   117208191    51767872    7  HPFS/NTFS
Partition 2 has different physical/logical endings:
     phys=(1023, 254, 63) logical=(7295, 222, 31)
责任编辑: admin
Email给朋友 打印本文
版权所有·安恒公司 Copyright © 2004   www.anheng.com   All Rights Reserved    
推荐: 综合布线工作组博客       北京市海淀区首体南路9号 主语国际商务中心4号楼8层 (邮编100048) 电话:010-88018877