关于磁盘的基础知识

 

  1. 为什么msdos类型的分区表支持的最大磁盘容量为2T, 参考: https://en.wikipedia.org/wiki/Master_boot_record#PTE
    1. 分区表中使用了4字节来定义一个分区起始的逻辑扇区号,4字节能支持的最大的逻辑扇区号为2^32 ,每个扇区 512 Byte; 2^32*512 = 2T

 

 

参考:

https://www.howtogeek.com/193669/whats-the-difference-between-gpt-and-mbr-when-partitioning-a-drive/

https://en.wikipedia.org/wiki/Cylinder-head-sector

https://en.wikipedia.org/wiki/Master_boot_record

https://en.wikipedia.org/wiki/GUID_Partition_Table

 

dd 之速度实时统计

dd命令正常情况下,完成之后才显示完成了多少,速度是多少;如果你感觉dd时间很长了,想知道啥时候能完成,可咋办?

man 手册中有说明: 给dd一个 USR1 信号就会打印统计信息到标准错误

这里想强调一个问题: 不管学啥,要多看文档,养成看文档的好习惯;从文档上学到的是“系统化”的东西; 从百度、google看到的都是零碎的东西

dd查看磁盘的mbr:

qemu 编译

qemu的编译是比较简单的: https://www.qemu.org/download/#source

qemu 的编译逻辑是:

如果你编译环境上有相关功能的库和开发包的支持,则编译出来的qemu就支持该功能,如果没有就自动不支持;所以,你基本不需要明确开启指定功能的选项,但是,如果你想明确禁止支持某功能,可以明确通过选项来禁止

 

我的环境下,安装了下面这么多包,enable了很多支持

 

pid namespace

The namespace init process
The first process created in a new namespace (i.e., the process
created using clone(2) with the CLONE_NEWPID flag, or the first child
created by a process after a call to unshare(2) using the
CLONE_NEWPID flag) has the PID 1, and is the “init” process for the
namespace (see init(1)). A child process that is orphaned within the
namespace will be reparented to this process rather than init(1)
(unless one of the ancestors of the child in the same PID namespace
employed the prctl(2) PR_SET_CHILD_SUBREAPER command to mark itself
as the reaper of orphaned descendant processes
).