Chinaunix首页 | 论坛 | 博客
  • 博客访问: 286139
  • 博文数量: 65
  • 博客积分: 1490
  • 博客等级: 上尉
  • 技术积分: 835
  • 用 户 组: 普通用户
  • 注册时间: 2009-01-16 20:00
文章分类

全部博文(65)

文章存档

2015年(1)

2012年(3)

2010年(7)

2009年(54)

我的朋友

分类: LINUX

2009-07-29 19:21:08

 
用fdisk来看每个分区的起始逻辑扇区号,扇区号乘以512就是所要的偏移值offset,
mount时用:mount xx.img -o loop,offset=offset xx/
如:
#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)
 
可以看出有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 
 

/*

*By Neil Chiao ()

*转载请注明出处:neilengineer.cublog.cn

*本文内容来自网络

*欢迎到“新星湾()”指导

*/

 
 
 
阅读(2009) | 评论(0) | 转发(0) |
0

上一篇:Linux中的LVM

下一篇:堆和栈的区别

给主人留下些什么吧!~~