当前位置: 首页 > news >正文

安徽设计网站建设百度北京总部电话

安徽设计网站建设,百度北京总部电话,手机百度关键词排名 网站优化软件,微信官方网站 - 百度-百度首先创建一块虚拟硬盘: dd bs512 count204800 if/dev/zero ofhd.img然后使用 losetup -f 将其关联为本地回环设备 losetup -f hd.img # 关联 hd.img 到空闲回环设备上 losetup -a /dev/loop0: [2080]:409 (/root/code/demo05/hd.img) # 查看刚刚关联到了哪里,这里关联到了 /d…首先创建一块虚拟硬盘: dd bs512 count204800 if/dev/zero ofhd.img然后使用 losetup -f 将其关联为本地回环设备 losetup -f hd.img # 关联 hd.img 到空闲回环设备上 losetup -a /dev/loop0: [2080]:409 (/root/code/demo05/hd.img) # 查看刚刚关联到了哪里,这里关联到了 /dev/loop0 回环设备文件上使用系统工具 fdisk 为虚拟硬盘创建分区系统,这里选择使用 GPT 分区系统,并创建了两块分区. 这里需要注意不要配置为 MBR 分区系统,会导致系统无法启动,grub-install 目前没找到如何设置支持 MBR 分区系统. fdisk hd.img ghimi-surface# fdisk hd.imgWelcome to fdisk (util-linux 2.37.2). Changes will remain in memory only, until you decide to write them. Be careful before using the write command.Device does not contain a recognized partition table. Created a new DOS disklabel with disk identifier 0x7b76f30f.Command (m for help): g # 创建分区系统为 gpt 格式 Created a new GPT disklabel (GUID: AC9ECA30-457D-1742-B3B7-75E228F7F59B).Command (m for help): n # 新建分区 Partition number (1-128, default 1): # 分区号 First sector (2048-204766, default 2048): # 起始扇区 Last sector, /-sectors or /-size{K,M,G,T,P} (2048-204766, default 204766): 50M # 结束扇区 Created a new partition 1 of type Linux filesystem and of size 50 MiB.Command (m for help): n # 新建分区 Partition number (2-128, default 2): # 分区号 First sector (104448-204766, default 104448): # 起始扇区 Last sector, /-sectors or /-size{K,M,G,T,P} (104448-204766, default 204766): # 结束扇区 Created a new partition 2 of type Linux filesystem and of size 49 MiB.Command (m for help): t # 修改分区类型 Partition number (1,2, default 2): 1 Partition type or alias (type L to list all): 4 # 设置分区类型为 BIOS boot 类型Changed type of partition Linux filesystem to BIOS boot.Command (m for help): p # 打印当前分区结果 Disk hd.img: 100 MiB, 104857600 bytes, 204800 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 Disklabel type: gpt Disk identifier: AC9ECA30-457D-1742-B3B7-75E228F7F59BDevice Start End Sectors Size Type hd.img1 2048 104447 102400 50M BIOS boot # 注意这里类型为 BIOS boot 类型 hd.img2 104448 204766 100319 49M Linux filesystemCommand (m for help): w # 同步分区结果到虚拟硬盘文件中 The partition table has been altered.在创建完成后通过 kpartx -av 识别分区信息: kpartx -av /dev/loop0 add map loop0p1 (252:0): 0 32768 linear 7:0 2048 add map loop0p2 (252:1): 0 67584 linear 7:0 34816 # -a 添加映射到系统设备文件中 # -v 详细打印映射结果然后在 /dev/mapper 目录下可以看到刚刚识别的分区信息 ls -l /dev/mapper/loop* brw------- 1 root root 252, 0 Dec 11 22:56 /dev/mapper/loop0p1 brw------- 1 root root 252, 1 Dec 11 22:56 /dev/mapper/loop0p2 # 或者通过 kpartx 查看kpartx -l /dev/loop0 loop0p1 : 0 102400 /dev/loop0 2048 loop0p2 : 0 100319 /dev/loop0 104448现在我们可以为这两个分区进行格式化. mkfs.ext4 /dev/mapper/loop0p1 mke2fs 1.46.5 (30-Dec-2021) Discarding device blocks: done Creating filesystem with 8448 4k blocks and 8448 inodesAllocating group tables: done Writing inode tables: done Creating journal (1024 blocks): done Writing superblocks and filesystem accounting information: done第二个分区一般为系统分区,这里格式化为 ext4 类型: mkfs.ext4 /dev/mapper/loop0p2 mke2fs 1.46.5 (30-Dec-2021) Discarding device blocks: done Creating filesystem with 8448 4k blocks and 8448 inodesAllocating group tables: done Writing inode tables: done Creating journal (1024 blocks): done Writing superblocks and filesystem accounting information: done接下来挂在启动分区 /dev/mapper/loop0p1 ,为其安装 grub: mkdir hdisk mount /dev/mapper/loop0p1 hdisk为其安装 grub: grub-install --boot-directory./hdisk/boot --no-floppy --force /dev/loop0 # --boot-directory 指定启动目录,未来内核存放的位置 # --no-floppy 不设置软盘 # --force 发生警告不停止安装 # /dev/loop0 注意这里指定的是磁盘而不是分区 # grub-install --boot-directoryhdisk/boot --no-floppy /dev/loop0 Installing for i386-pc platform. Installation finished. No error reported.接下来就可以通过 qemu 启动这块虚拟硬盘了: qemu-system-x86_64 -drive filehd.img,mediadisk,formatraw,index0 # drive 指定设备 # filehd.img 指定虚拟磁盘文件 # mediadisk 指定设备类型为硬盘 # formatraw 指定虚拟磁盘格式为 raw 格式,其他还有 vhdi,vdx,qcow2等格式 # index0 指定设备索引号(总线中的识别顺序)为0操作回滚 umount hdisk # 移除子分区关联映射kpartx -dv /dev/loop0 del devmap : loop0p1 del devmap : loop0p2 # 移除回环设备关联映射 losetup -D
http://wiki.neutronadmin.com/news/30088/

相关文章:

  • 手机商城网站开发v9双语版网站怎么做
  • 自己做网站nas网站建设项目验收方案
  • 电商网站新闻怎么做的个人网站开发教程
  • 网站seo做点提升流量东莞建设局网
  • 制作网站哪里好网站推广工作总结
  • 做外卖的网站专业的无锡网站建设
  • 快速建站视频网站提示建设中
  • 网站开发框架拓扑服装设计参考网站
  • 广州网站开发培训企业信息查询平台有哪些
  • 十大摄影网站排名网络上做假网站做物流
  • 优化网站佛山厂商制作网站的公司还能赚钱吗
  • 网站浏览器兼容性通用做网站一定要备案吗
  • 湖南 微网站开发与设计比赛wordpress列表框内显示标题
  • 有做lol直播网站网站建设推广的软文
  • 云南省建设工程质量监督管理站网站专业的网络推广
  • 如何看到网站的制作公司四川建设网官网电话
  • 汕头网站建设技术托管土地流转网站建设项目
  • 福州seo公司网站asp.net网站开发教程
  • 企业网站个人可以备案吗网站 布局
  • 动易网站首页制作全屋定制十大名牌有哪些品牌
  • 怎么做网站服务器系统红番茄 网站点评
  • 网站设计规划方案做药材生意的网站
  • Wordpress数据怎么导出seo sem是什么职位
  • wordpress 歌词爱站seo
  • 做网站是不是很麻烦2024年楼市大局已定
  • 江门搜狗网站推广优化上海怎样建设网站
  • 网站建设推广报价安装wordpress教程
  • 门户网站建站目标顶呱呱做网站吗
  • 网站建设和维护要点广东省住房和建设网站
  • 滨州市住房和城乡建设局网站天水模板型网站建设