Linux 下ros img镜像挂载
本帖最后由 jifei 于 2011-10-30 00:20 编辑# ls
PHYSDISKWRITE.EXEros2.927.img安装.BAT
# file ros2.927.img
ros2.927.img: x86 boot sector; partition 1: ID=0x83, active, starthead 0, startsector 1, 209663 sectors, code offset 0x31
# fdisk -lu ros2.927.img
Disk ros2.927.img: 107 MB, 107348480 bytes
4 heads, 63 sectors/track, 832 cylinders, total 209665 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xcf28cf28
Device Boot Start End Blocks IdSystem
ros2.927.img1 * 1 209663 104831+83Linux
# mkdir /mnt/ros2.927
# losetup -a
/dev/loop2: :15 (/root/.gvfs/192.168.11.4 上的 wm2/外置程序/ros安装/ROS*), offset 512
/dev/loop3: :15 (/root/.gvfs/192.168.11.4 上的 wm2/外置程序/ros安装/ROS*), offset 512
/dev/loop4: :24 (/root/.gvfs/192.168.11.4 上的 wm2/外置程序/ros安装/ROS*), offset 512
# mount -o loop,offset=512 ros2.927.img /mnt/ros2.927
# ls /mnt/ros2.927
bin CDINSTALLetc initrdlost+foundold proc roottmpvar
bootdev homelib nova postlogREBOOTsbinusrx
第二种方法:
#fdisk ros2.927.img
计算出偏移offset=start_sector(Start) x sector_byte_size
#losetup -of 512 ros2.927.img
#losetup -a
/dev/loop0: :15 (/root/.gvfs/192.168.11.4 上的 wm2/外置程序/ros安装/ROS*), offset 512
查看默认使用那你一个loop
#mount /dev/loop0 /mnt
#ls /mnt
bin CDINSTALLetc initrdlost+foundold proc roottmpvar
bootdev homelib nova postlogREBOOTsbinusrx
备注:遇到不可挂载的ros img镜像可使用 file 查看ID=0x83 说明镜像为ext3磁盘格式
fdisk -lu xxx.img 查看镜像文件可以计算出文件的偏移offset=start_sector x sector_byte_size(即offse=1*512)
losetup -a 查看系统loop占用情况
然后就可以用mount挂载镜像了,如: mount -o loop,offset=512 ros2.927.img /mnt/ros2.927
这里系统使用的是Fedora14-live版进行测试,其他版本可自行探索 有点复杂,看不懂了
页:
[1]