mount 硬盘镜像的一般问题。

1. 要搞清楚文件是 是由整个分区来的,还是整个硬盘来的

 

也就是说,是 dd if=/dev/sda1 还是 dd if=/dev/sda

 

[root@oraclevmserver43 test_pvm_centos5.4_route]# file System.img


System.img: x86 boot sector; partition 1: ID=0x83, active, starthead 1, startsector 63, 208782 sectors; partition 2: ID=0x8e, starthead 0, startsector 208845, 16563015 sectors, code offset 0x48

 

[root@oraclevmserver43 test_pvm_centos5.4_route]# fdisk -l -u System.img
last_lba(): I don't know how to handle files with mode 81a4
You must set cylinders.
You can do this from the extra functions menu.

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

     Device Boot      Start         End      Blocks   Id  System
System.img1   *          63      208844      104391   83  Linux
System.img2          208845    16771859     8281507+  8e  Linux LVM
Partition 2 has different physical/logical endings:
     phys=(1023, 254, 63) logical=(1043, 254, 63)

 

2. 计算出 offset = 63*512

 

3. mount 非 lvm分区 mount -o loop,offset=32256 System.img /mnt/sda1

 

4. mount lvm 分区:

 

losetup -o 16515072 -f System.img

 

5. 激活它:

 

vgchange -a y
  2 logical volume(s) in volume group "VolGroup00" now active

 

6. 查看;

 

ls /dev/mapper/

 

7. 如何反激活?

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值