zoukankan      html  css  js  c++  java
  • 模拟虚拟的文件系统initrd/initramfs

    请看initramfs文件的以下解析:

     1 [root@ant-colonies boot]# ls
     2 config-2.6.32-573.el6.x86_64         lost+found
     3 efi                                  symvers-2.6.32-573.el6.x86_64.gz
     4 grub                                 System.map-2.6.32-573.el6.x86_64
     5 initramfs-2.6.32-573.el6.x86_64.img  vmlinuz-2.6.32-573.el6.x86_64
     6 [root@ant-colonies boot]# file initramfs-2.6.32-573.el6.x86_64.img 
     7 initramfs-2.6.32-573.el6.x86_64.img: gzip compressed data, from Unix, last modified: Thu Jan 19 21:36:05 2017, max compression
     8 [root@ant-colonies boot]# mkdir /initrd
     9 [root@ant-colonies boot]# cp initramfs-2.6.32-573.el6.x86_64.img /initrd
    10 [root@ant-colonies boot]# cd /initrd
    11 [root@ant-colonies initrd]# mv initramfs-2.6.32-573.el6.x86_64.img initramfs-2.6.32-573.el6.x86_64.gz
    12 [root@ant-colonies initrd]# gunzip initramfs-2.6.32-573.el6.x86_64.gz
    13 [root@ant-colonies initrd]# ls
    14 initramfs-2.6.32-573.el6.x86_64
    15 [root@ant-colonies initrd]# file initramfs-2.6.32-573.el6.x86_64 
    16 initramfs-2.6.32-573.el6.x86_64: ASCII cpio archive (SVR4 with no CRC)
    initramfs-2.6.32-573.el6.x86_64.img解压缩解析

     由以上图示可以看出:虚拟文件系统模拟的就是根的启动过程

    下面通过chroot来模拟一个虚拟的文件系统(虚拟根):

  • 相关阅读:
    Ruby--Array
    SQL--查询相同字段的数据
    Ruby--CSV
    Ruby--String
    Git常用命令
    JS Date函数操作
    FTP命令
    Rails--%w用法[转]
    Rails--export csv
    Mysql远程访问
  • 原文地址:https://www.cnblogs.com/ant-colonies/p/6476147.html
Copyright © 2011-2022 走看看