• explor img file


    1, get offset

    # parted bone-debian-8.7-lxqt-4gb-armhf-2017-03-19-4gb.img 
    GNU Parted 3.1
    Using /workspace/bone-debian-8.7-lxqt-4gb-armhf-2017-03-19-4gb.img
    Welcome to GNU Parted! Type 'help' to view a list of commands.
    (parted) p                                                                
    Model:  (file)
    Disk /workspace/bone-debian-8.7-lxqt-4gb-armhf-2017-03-19-4gb.img: 3565MB
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    Disk Flags: 
    
    Number  Start   End     Size    Type     File system  Flags
     1      4194kB  3565MB  3561MB  primary  ext4         boot
    
    (parted) unit B
    (parted) p                                                                
    Model:  (file)
    Disk /workspace/bone-debian-8.7-lxqt-4gb-armhf-2017-03-19-4gb.img: 3565158400B
    Sector size (logical/physical): 512B/512B
    Partition Table: msdos
    Disk Flags: 
    
    Number  Start     End          Size         Type     File system  Flags
     1      4194304B  3565158399B  3560964096B  primary  ext4         boot
    
    (parted) 

    get the ext4 partation offset 4194304

    or u can use fdisk:

    fdisk -l /workspace/bone-debian-8.7-lxqt-4gb-armhf-2017-03-19-4gb.img
    
    Disk /workspace/bone-debian-8.7-lxqt-4gb-armhf-2017-03-19-4gb.img: 3565 MB, 3565158400 bytes, 6963200 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 label type: dos
    Disk identifier: 0xca52207f
    
                                                           Device Boot      Start         End      Blocks   Id  System
    /workspace/bone-debian-8.7-lxqt-4gb-armhf-2017-03-19-4gb.img1   *        8192     6963199     3477504   83  Linux

    the offset is 8192(sectors) * 512 = 4194304 Byte

    2,mount 

    mount -o loop,ro,offset=4194304 bone-debian-8.7-lxqt-4gb-armhf-2017-03-19-4gb.img  /mnt/
    http://www.cnblogs.com/skynext/
  • 相关阅读:
    16-异常
    Linux 常用命令
    项目依赖子项目的类
    Struts2
    博客园【上吊猫】
    LayUI【基本使用】
    idea中隐藏.iml文件
    Session 使用
    博客园右下角看板娘特效,多种样式可选
    枚举
  • 原文地址:https://www.cnblogs.com/skynext/p/7927632.html
Copyright © 2020-2023  润新知