NotePublic/Software/System/Linux/Linux_挂载_Image_文件.md

21 lines
460 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Linux 挂载 Image 文件
```bash
sudo fdisk -lu <img>
# 显示类似如下信息
Device Boot Start End Blocks Id System
<img> * 2048 1026047 512000 83 Linux
```
将 Start\*512 得到 mount 的 offset512 是一个扇区的大小,以上面为例子就是 2048\*512
```bash
sudo mount -o loop,offset=<offset> <img> <mount point>
```
使用完毕后用如下命令卸载:
```bash
sudo umount <mount point>
```