img文件挂载 winmount 蓝屏

今天试图挂载arch的为u盘特制的img文件时,执行:"sudo mount -o loop xxx.img/mnt/xxx",系统提示:"mount: you must specify the filesystem type",加上"-text2"后仍然报错:"mount: wrong fs type, bad option, bad superblock on/dev/loop1...",看来又到搜索的时候了……

呵呵,还真让我找到了解决方案……

首先,要说明一下的是,这情况是由于img文件的开头包含了mbr,以致于系统无法识别……

怎么办?跳过mbr吧……执行:fdisk -ul xxx.img,和显示一大堆信息,如:

You must set cylinders.
You can do this from the extra functions menu.

Disk xxx.img: 0 MB, 0 bytes
171 heads, 23 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00000000

DeviceBootStartEnd Blocks Id System
xxx.img1 *63 332032165985 83 Linux
Partition 1 has different physical/logical beginnings(non-Linux?):
phys=(0, 1, 1) logical=(0, 2, 18)
Partition 1 has different physical/logical endings:
img文件挂载 winmount 蓝屏
phys=(20, 170, 23) logical=(84, 72, 5)

而你所要知道的就是在"Units"开头的那一行里,乘号后面的数字也就是扇区大小(不知是否该这样翻译,英文的单位为(bytes/sector)),一般是跟例中一样的512bytes……接着,找到"Start",记下下面的数字(例中为63),这是起始扇区(是这样译的吧?),再将这两个数字相乘,得到的结果(例中为32256)等一下要用到(说了句废话……)……

最后执行:

(sudo) mount -o loop,offset=32256(刚刚得出的结果) xxx.img/mnt/xxx……

大概就成功了……

another way

1. 先查看第一个空闲loop设备

代码:
sudo losetup -f/dev/loop0

2. 使用上一步得到的设备名,第一次创建loop设备

代码:
sudo losetup /dev/loop0archlinux-2008.06-core-i686.img

3. 查看信息

代码:
sudo fdisk -lu /dev/loop0Disk /dev/loop0: 322 MB, 322469376 bytes 53 heads, 12sectors/track, 990 cylinders, total 629823 sectors Units = sectorsof 1 * 512 = 512 bytes Disk identifier: 0x00000000 Device BootStart End Blocks Id System /dev/loop0p1 * 63 629822 314880 83 LinuxPartition 1 has different physical/logical beginnings (non-Linux?):phys=(0, 1, 1) logical=(0, 5, 4) Partition 1 has differentphysical/logical endings: phys=(39, 52, 12) logical=(990, 15,3)

我们可以看到,该镜像只有一个分区(loop0p1),从第63扇区开始(Start列),每扇区512字节(Units =sectors of 1 * 512 = 512 bytes),我们算出offset,下面mout命令会用到:

代码:
63*512=32256

4. mout

代码:
sudo losetup -o 32256/dev/loop1 archlinux-2008.06-core-i686.img sudo mount -o loop/dev/loop1 /mnt/ ls /mnt/ addons archlive.sqfs bootlost+found

事实上,fdisk可以直接查看img文件(虽然功能不全,下面会说到),mount可以自动创建loop设备,所以上面步骤可以简化为:
I. 查看信息

代码:
sudo fdisk -luarchlinux-2008.06-core-i686.img You must set cylinders. You can dothis from the extra functions menu. Diskarchlinux-2008.06-core-i686.img: 0 MB, 0 bytes 53 heads, 12sectors/track, 0 cylinders, total 0 sectors Units = sectors of 1 *512 = 512 bytes Disk identifier: 0x00000000 Device Boot Start EndBlocks Id System archlinux-2008.06-core-i686.img1 * 63 629822314880 83 Linux Partition 1 has different physical/logicalbeginnings (non-Linux?): phys=(0, 1, 1) logical=(0, 5, 4) Partition1 has different physical/logical endings: phys=(39, 52, 12)logical=(990, 15, 3)

第一行抱怨不能得到cylinders,原因是普通文件上没有实现ioctl操作,我们可以看到0cylinders,但这对我们不重要,关键是我们依然可以得到第一个分区(archlinux-2008.06-core-i686.img1)的偏移值

II. 直接mount

代码:
sudo mount -oloop,offset=32256 archlinux-2008.06-core-i686.img /mnt/ ls /mnt/addons archlive.sqfs boot lost+found

  

爱华网本文地址 » http://www.aihuau.com/a/25101011/99514.html

更多阅读

浏览器蓝屏怎么办 ie闪退打不开网页

浏览器蓝屏怎么办——简介微软发布kb2670838更新补丁后,部分双显卡笔记本(目前发现为载有AMD独显的笔记本)出现了打开浏览器蓝屏的现象,蓝屏代码为:igdpmd64.sys用户打开IE浏览器或为IE内核的浏览器会出现蓝屏现象这篇经验小编为主的

360安全卫士怎么启用系统蓝屏修复 系统蓝屏修复工具

360安全卫士怎么启用系统蓝屏修复——简介电脑使用不当会导致蓝屏甚至无法启动,可以开启360安全卫士的系统蓝屏修复功能。360安全卫士怎么启用系统蓝屏修复——工具/原料电脑360安全卫士360安全卫士怎么启用系统蓝屏修复——方法/步

电脑开机就蓝屏重启解决方法 电脑一开机就蓝屏

电脑开机就蓝屏重启解决方法——简介近日微软推送8月份的更新补丁,通过系统或安全软件进行补丁更新后,可能会导致用户电脑重启后出现开机0xc0000005,0xc0000008e蓝屏,同时无法开机的现象,反复重新启动。影响系统:XP(SP3);vista_32/64(SP2);20

蓝屏故障:19 0x00000077

蓝屏故障:[19]0x00000077——简介在百度经验《蓝屏故障代码:[1]前因后果》首篇经验中已经概述了导致蓝屏的原因和解决思路。此文着重于具体的蓝屏出错代码的具体原因分析,虽然不能良方治百病,但也能触类旁通解疑惑。蓝屏故障:[19]0x000

声明:《img文件挂载 winmount 蓝屏》为网友很靠谱的青年分享!如侵犯到您的合法权益请联系我们删除