首页 > 系统相关 >在Linux系统中使用mount命令挂载后缀为.img的Ubuntu系统

在Linux系统中使用mount命令挂载后缀为.img的Ubuntu系统

时间:2022-11-14 10:45:21浏览次数:75  
标签:字节 img mount 扇区 Ubuntu 挂载 path 512

挂载步骤

  1. 使用 fdisk -l /path/to/image 命令查看 img 文件信息。输出如下:

Disk Orangepizero2_3.0.6_ubuntu_jammy_server_linux5.16.17.img:1.63 GiB,1744830464 字节,3407872 个扇区
单元:扇区 / 1 * > 512 = 512 字节
扇区大小(逻辑/物理):512 字节 / 512 字节
I/O 大小(最小/最佳):512 字节 / 512 字节
磁盘标签类型:dos
磁盘标识符:0x263fbbb8
设备 启动 起点 末尾 扇区 大小 Id 类型
Orangepizero2_3.0.6_ubuntu_jammy_server_linux5.16.17.img1 8192 3407871 3399680 1.6G 83 Linux

可以看到块大小为512,起始块为8192,offset=8192*512=4194304
  1. 挂载

sudo mount -o loop,offset=4194304 /path/to/img /path/to/mnt

卸载步骤

  1. 使用lsblk命令查看挂载的目录
  2. 卸载 sudo umount /path/to/img

参考

https://www.linuxquestions.org/questions/linux-general-1/how-to-mount-img-file-882386/

标签:字节,img,mount,扇区,Ubuntu,挂载,path,512
From: https://www.cnblogs.com/3yude/p/16888272.html

相关文章

  • ubuntu安装 MySql5.7.bundle.tar
    1.查询是否有残留软件rpm-qa|grepmysqlrpm-qa|grepmariadb2.上传解压并安装root@kht:/kht#tar-xvfmysql-5.7.40-1.el7.x86_64.rpm-bundle.tarmysql-communi......
  • Ubuntu: How to create a new file? This command you need to know: touch
    howtocreateanewfileinlinuxUbuntu.touchtouch1.txt2.txtandthenyoucangetthenewfileincurrentdirectory.>>1.txtecho'txtcontent.'>......
  • virtualbox下ubuntu 22.04固定ip设置
    virtualbox下ubuntu22.04固定ip设置找了很多方法,出现的问题有:1、语法错误2、货不对版记录下固定ip的过程:文件更改的位置:/etc/netplan/该文件夹下面一般只有一个文件su......
  • Ubuntu安装ssh服务
    安装sudoapt-getinstallopenssh-server启动systemctlstartssh重启systemctlrestartssh关闭systemctlstopssh......
  • Ubuntu 20.04 安装部署 MySQL 8.0
    1.规划官网:MySQL社区官网,下载包需要创建oracle账户,本地使用的是Linux通用的二进制包mysql-8.0.31-linux-glibc2.12-x86_64.tarmd5:89e902edeb75216c366e878f3c9e85be......
  • commands for use VIM in ubuntu
    Usevimxx.yytoopenafilefirstly.Theninputi,youcaninsertnewtextintheopenedfile.Whenyouwanttoendtheinput,youfirstlyclickEscbottom,t......
  • ubuntu install rapidjson
    1.Installsudoapt-getinstallrapidjson-dev2.Code#include<algorithm>#include<chrono>#include<ctime>#include<fstream>#include<iostream>#include......
  • ubuntu install jsoncpp and demos,StyledWriter,FastWriter,Reader,parse
    1.Installsudoapt-getinstalllibjsoncpp-dev2.Addusingheader.#include<jsoncpp/json/json.h>3.Use#include<algorithm>#include<chrono>#include<ct......
  • ubuntu安装搜狗输入法
    https://shurufa.sogou.com/linux?r=pinyin在如上链接下载,然后使用dpkg命令安装在电脑设置中找到“区域和语言”,然后点击“管理已安装的语言”,将系统输入法系统更改为“f......
  • ubuntu搭建sftp服务
    sftp直接使用系统的sshd服务,无需额外安装软件,配置也比较简单。一、添加用户添加一个sftp用户,不设置家目录,指定不能登录的shell,然后设置登录密码useradd-M-s/sbin/n......