grub配置详解

GRUB2 配置文件详解

1. GRUB2配置文件

GRUB2 的配置文件通常为 /boot/grub2/grub.cfg,虽然此文件很灵活,但是我们并不需要手写所有内容。可以通过程序自动生成,或是直接修改生成之后的文件。

2. 简单配置

通常情况下简单配置文件 /etc/default/grub ,然后用程序 grub-mkconfig 来产生文件 grub.cfg
文件 /etc/default/grub 是一个 shell 脚本,通常仅是 KEY=value 这样的连续行。如果值包含空格或特殊字符,必须用 " 引用。详看 GRUB Manual: Simple configuration。其常用关键字如下:

2.1. GRUB_DEFAULT

默认菜单项。默认值为 0。可选值有:

说明
菜单项的数字序号,从 0 开始
saved GRUB_SAVEDEFAULT 保存的上次选择项
菜单项的唯一标识(menuentry … –id xxxx

2.2. GRUB_TIMEOUT

自启超时时间。默认值为 5。可选值有:

说明
0 不等待
-1 永久等待
其他 等待对应秒

2.3. GRUB_TIMEOUT_STYLE

倒计时显示风格。默认值为 menu。可选值有:

说明
menu 显示菜单
countdown 显示倒计时
hidden 隐藏

2.4. GRUB_DISTRIBUTOR

被用于生成菜单项的更多信息。

2.5. GRUB_TERMINAL

设置输入、输出终端类型。可选值有:

说明
console 控制台
serial 串口
serial_ 具体串口号
gfxterm 图形模式输出
vga_text VGA 文本输出

2.6. GRUB_CMDLINE_LINUX

添加到菜单项中的启动 linux 的命令行参数。

2.7. GRUB_DISABLE_RECOVERY

设置此选项为 true,禁止产生恢复模式菜单项。

2.8. GRUB_DISABLE_SUBMENU

默认情况下,grub-mkconfig 会将低版本内核放在高版本内核子菜单里。设置此选项为 true,所有菜单项都将出现在顶层。

2.9. GRUB_DISABLE_OS_PROBER

默认情况下,grub-mkconfig 会使用外部程序 os-prober 检测其他已安装的操作系统,并产生菜单项。设置此选项为 true来禁止它。

3. 直接修改

我们也可以直接修改由 grub-mkconfig 生成之后的 grub.cfg ,其由 GRUB 内建的脚本语言组成,和 GNU bash 语法非常相似,比如定义函数、判断语句等。以下列出一些可调用的命令,详看 GRUB Manual: Commands

注意:

  1. 命令

    其中个别命令只能在 grub.cfg 中使用,不能在命令行模式使用。比如 menuentry等。

  2. 指定设备

    定位一个文件,需要指定它所在设备分区与路径。指定设备的语法如下:

    1
    2
    (<device-type><device-number>,<partition-number>)

    注解:

    1. 设备类型,有如下几种常用类型:

      类型 说明
      hd 硬盘
      fd 3.5 英寸软盘
      nd 网络
      cd CD/DVD等
    2. BIOS能够识别的设备号,下标从 0 开始计数。比如 hd0 表示主硬盘,等价于 linux 的 /dev/hda

    3. 分区号,比如 modos2 表示第 2 个分区。下标从 1 开始计数。

3.1. menuentry

定义 GRUB 的菜单项。当选中菜单项时,GRUB 将执行括号内的命令。如果最后的命令返回成功,并且内核被加载时,将自动执行 boot 命令。此命令不能在命令行模式执行。语法格式如下:

1
2
3
menuentry <title> [--class=<class> …] [--users=<users>] 
[--unrestricted] [--hotkey=<key>] [--id=<id>] [<arg> …] { <command>; … }

注解:

  1. </li> </ol> <p>菜单项的显示名称。</p> <ol start="2"> <li><p>[–class=<class> …]</p> <p>将菜单项指定为某一类。可指定多个类别。不同的菜单主题可能会显示不同的菜单类别。</p> </li> <li><p>[–users=<users>]</p> <p>授予指定用户访问菜单项的权利。</p> </li> <li><p>[–unrestricted]</p> <p>允许所有用户访问此菜单项。</p> </li> <li><p>[–hotkey=<key>]</p> <p>给菜单项指定一个快捷键。</p> </li> <li><p>[–id=<id>]</p> <p>给菜单项指定一个唯一的 <code>ASCII</code> 字符串标识。</p> </li> <li><p>[<arg> …]</p> <p>和 <title> 一起作为参数,传递给大括号里将要执行的命令。<title> 总是被指定为 <code>$1</code>。</p> </li> </ol> </blockquote> <h2 id="3-2-boot"><a href="#3-2-boot" class="headerlink" title="3.2. boot"></a>3.2. boot</h2><p>启动已加载的内核。</p> <h2 id="3-3-help"><a href="#3-3-help" class="headerlink" title="3.3. help"></a>3.3. help</h2><p>显示内建命令的帮助信息。语法格式如下:</p> <figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">help [<pattern> …]</span><br><span class="line"></span><br></pre></td></tr></table></figure> <blockquote> <p>注解:</p> <ol> <li><p>[<pattern> …]</p> <p>如果省略,则显示所有命令的简短描述。否则,显示指定命令的详细描述。</p> </li> </ol> </blockquote> <h2 id="3-4-linux"><a href="#3-4-linux" class="headerlink" title="3.4. linux"></a>3.4. linux</h2><p>从指定文件加载内核,并传递启动参数。任何 <code>initrd</code> 必须在此命令后重加载。语法格式如下:</p> <figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">linux <file> …</span><br><span class="line"></span><br></pre></td></tr></table></figure> <h2 id="3-5-initrd"><a href="#3-5-initrd" class="headerlink" title="3.5. initrd"></a>3.5. initrd</h2><p>为 <code>linux</code> 内核加载初始的 <code>ramdisk</code>,并在 <code>linux</code> 启动的内存区域,设置恰当的参数。语法格式如下:</p> <figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">initrd <file></span><br><span class="line"></span><br></pre></td></tr></table></figure> <h2 id="3-6-search"><a href="#3-6-search" class="headerlink" title="3.6. search"></a>3.6. search</h2><p>查找设备。语法格式如下:</p> <figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">search [--file|--label|--fs-uuid] [--set [<var>]] [--no-floppy] <name></span><br><span class="line"></span><br></pre></td></tr></table></figure> <blockquote> <p>注解:</p> <ol> <li><p>[–file|–label|–fs-uuid]</p> <p>分别表示按文件、文件系统标志、文件系统 <code>UUID</code> 查找设备。</p> </li> <li><p>[–set [<var>]]</p> <p>第一个找到的设备会被设置为环境变量 <code>var</code> 的值。默认变量是 <code>root</code>。</p> </li> <li><p>[–no-floppy]</p> <p>防止搜索软盘。</p> </li> </ol> </blockquote> <h2 id="3-7-set"><a href="#3-7-set" class="headerlink" title="3.7. set"></a>3.7. set</h2><p>设置环境变量。语法格式如下:</p> <figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">set [<envvar>=<value>]</span><br><span class="line"></span><br></pre></td></tr></table></figure> <blockquote> <p>注解:</p> <ol> <li><p>[<envvar>=<value>]</p> <p>如果省略此参数,打印所有变量。</p> </li> <li><p>根目录标识</p> <p>指定根目录后,可以像 <code>linux</code> 的绝对路径的方式去定位一个文件。语法格式如下:</p> <figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">set root=(<device-type><device-number>,<partition-number>)</span><br><span class="line"></span><br></pre></td></tr></table></figure></li> </ol> </blockquote> <h2 id="3-8-cat"><a href="#3-8-cat" class="headerlink" title="3.8. cat"></a>3.8. cat</h2><p>显示文件内容。</p> <h2 id="3-9-ls"><a href="#3-9-ls" class="headerlink" title="3.9. ls"></a>3.9. ls</h2><p>列出设备或文件。语法格式如下:</p> <figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">ls [<arg> …]</span><br><span class="line"></span><br></pre></td></tr></table></figure> <blockquote> <p>注解:</p> <ol> <li><p>[<arg> …]</p> <p>如果没有参数,则显示所有 GRUB 已知的设备。否则根据参数显示设备或者文件。</p> </li> </ol> </blockquote> <h2 id="3-10-lsmod和insmod"><a href="#3-10-lsmod和insmod" class="headerlink" title="3.10. lsmod和insmod"></a>3.10. lsmod和insmod</h2><p>显示或插入指定的动态模块。语法格式如下:</p> <figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">lsmod</span><br><span class="line">insmod <module></span><br><span class="line"></span><br></pre></td></tr></table></figure> </div> </div> <div class="copyright"> <p><span>本文标题:</span><a href="/linux/debian/grub-cfg/">grub配置详解</a></p> <p><span>文章作者:</span> <a title="访问 阿帅 的个人博客">阿帅</a> </p> <p><span>发布时间:</span>2023年05月25日 - 20时57分</p> <p><span>最后更新:</span>2023年05月25日 - 21时02分</p> <p> <span>原始链接:</span><a class="post-url" href="/linux/debian/grub-cfg/" title="grub配置详解">https://chengshea.github.io/linux/debian/grub-cfg/</a> <span class="copy-path" data-clipboard-text="原文: https://chengshea.github.io/linux/debian/grub-cfg/ 作者: 阿帅" title="点击复制文章链接"><i class="fa fa-clipboard"></i></span> <script src="/js/clipboard.min.js"></script> <script> var clipboard = new Clipboard('.copy-path'); </script> </p> <p> <span>许可协议:</span><i class="fa fa-creative-commons"></i> <a rel="license noopener" target="_blank" href="http://creativecommons.org/licenses/by-nc-sa/3.0/cn/" title="中国大陆 (CC BY-NC-SA 3.0 CN)" target = "_blank">"署名-非商用-相同方式共享 3.0"</a> 转载请保留原文链接及作者。 </p> </div> <div id="div1" onmouseenter="showDiv2()" onmouseleave="hideDiv2()"> 点击打赏 <div id="div2" style="display: none;"> <img src='/img/123.gif' alt="菜币"> <div >会心一笑</div> </div> </div> <script> function showDiv2() { var div2 = document.getElementById("div2"); div2.style.display = "block"; } function hideDiv2() { var div2 = document.getElementById("div2"); div2.style.display = "none"; } </script> <nav id="article-nav"> <a href="/services/database/influxdb/influxdb-zabbix/" id="article-nav-newer" class="article-nav-link-wrap"> <strong class="article-nav-caption"><</strong> <div class="article-nav-title"> influxdb存放zabbix监控数据 </div> </a> <a href="/lang/stable-diffusion/models/revAnimated/" id="article-nav-older" class="article-nav-link-wrap"> <div class="article-nav-title">revAnimated models</div> <strong class="article-nav-caption">></strong> </a> </nav> </article> <div id="toc" class="toc-article"> <strong class="toc-title">文章目录</strong> <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#GRUB2-%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E8%AF%A6%E8%A7%A3"><span class="toc-number">1.</span> <span class="toc-text">GRUB2 配置文件详解</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#2-1-GRUB-DEFAULT"><span class="toc-number">1.1.</span> <span class="toc-text">2.1. GRUB_DEFAULT</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-2-GRUB-TIMEOUT"><span class="toc-number">1.2.</span> <span class="toc-text">2.2. GRUB_TIMEOUT</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-3-GRUB-TIMEOUT-STYLE"><span class="toc-number">1.3.</span> <span class="toc-text">2.3. GRUB_TIMEOUT_STYLE</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-4-GRUB-DISTRIBUTOR"><span class="toc-number">1.4.</span> <span class="toc-text">2.4. GRUB_DISTRIBUTOR</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-5-GRUB-TERMINAL"><span class="toc-number">1.5.</span> <span class="toc-text">2.5. GRUB_TERMINAL</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-6-GRUB-CMDLINE-LINUX"><span class="toc-number">1.6.</span> <span class="toc-text">2.6. GRUB_CMDLINE_LINUX</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-7-GRUB-DISABLE-RECOVERY"><span class="toc-number">1.7.</span> <span class="toc-text">2.7. GRUB_DISABLE_RECOVERY</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-8-GRUB-DISABLE-SUBMENU"><span class="toc-number">1.8.</span> <span class="toc-text">2.8. GRUB_DISABLE_SUBMENU</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#2-9-GRUB-DISABLE-OS-PROBER"><span class="toc-number">1.9.</span> <span class="toc-text">2.9. GRUB_DISABLE_OS_PROBER</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#3-1-menuentry"><span class="toc-number">1.10.</span> <span class="toc-text">3.1. menuentry</span></a></li></ol></li></ol> </div> <input type="button" id="tocButton" value="隐藏目录" title="点击按钮隐藏或者显示文章目录"> <script src="/js/require-2.1.6.js"></script> <script src="/js/jquery-1.9.1.min.js"></script> <script> var valueHide = "隐藏目录"; var valueShow = "显示目录"; if ($(".left-col").is(":hidden")) { $("#tocButton").attr("value", valueShow); } $("#tocButton").click(function() { if ($("#toc").is(":hidden")) { $("#tocButton").attr("value", valueHide); $("#toc").slideDown(320); } else { $("#tocButton").attr("value", valueShow); $("#toc").slideUp(350); } }) if ($(".toc").length < 1) { $("#toc, #tocButton").hide(); } </script> <script src="/js/jquery-1.9.1.min.js"></script> <div id="gitment"></div> <!-- 主页不要加载gitment --> <script> var gitment = new Gitment({ owner: 'chengshea', repo: 'chengshea.github.io', oauth: { client_id: '3478952f5e3ade063629', client_secret: '3ca8b3ada58c7993cbb385839f83ba81eb04231a', }, }) gitment.render('gitment') </script> <div class="scroll" id="post-nav-button"> <a href="/services/database/influxdb/influxdb-zabbix/" title="上一篇: influxdb存放zabbix监控数据"> <i class="fa fa-angle-left"></i> </a> <a title="文章列表"><i class="fa fa-bars"></i><i class="fa fa-times"></i></a> <a href="/lang/stable-diffusion/models/revAnimated/" title="下一篇: revAnimated models"> <i class="fa fa-angle-right"></i> </a> </div> <ul class="post-list"><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/backup-k8s/">backup k8s velero</a></li><li class="post-list-item"><a class="post-list-link" href="/services/elk/prometheus-storage/">prometheus remote write storage</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/apm/sw-agent/">skywalking agent</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/apm/banyandb/">apm banyandb</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/apm/signoz/">signoz</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/apm/jaeger/">jaeger</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/apm/search/zincsearch/">zincsearch go</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/apm/victoriametrics/vmctl/">vmctl migrate data</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/apm/victoriametrics/vmauth/">vmauth http loadbalancer</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/apm/victoriametrics/victoriametrics/">victoria metrics</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/apm/victoriametrics/vmagent/">vmagent remote_write protocol</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/apm/otel/">OpenTelemetry</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/networkip/">network cidr ip</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/apm/exporter/">monitor exporter</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/devops/cicd/gitlabci/">gitlab ci</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/upgrade/">k8s upgrade</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/hpa/">k8s HorizontalPodAutoscaler</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/tool/keepalived/">keepalived HA</a></li><li class="post-list-item"><a class="post-list-link" href="/services/database/mysql/MHA/">mysql 主备故障切换</a></li><li class="post-list-item"><a class="post-list-link" href="/services/nginx/baseknowledge/">nginx knowledge</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/metallb/">k8s service LoadBalancer</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/tool/supervisor/">supervisor</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/apm/skywalking/">skywalking</a></li><li class="post-list-item"><a class="post-list-link" href="/other/LLM/ollama/">ollama webui</a></li><li class="post-list-item"><a class="post-list-link" href="/services/database/tidb/tidb/">TiDB</a></li><li class="post-list-item"><a class="post-list-link" href="/services/apisix/ingress/">APISIX ingress</a></li><li class="post-list-item"><a class="post-list-link" href="/services/apisix/apisix/">apisix</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/coredns/">K8S DNS CoreDNS</a></li><li class="post-list-item"><a class="post-list-link" href="/services/monitor/nightingale/">夜莺监控</a></li><li class="post-list-item"><a class="post-list-link" href="/services/nginx/function/">实用负载功能</a></li><li class="post-list-item"><a class="post-list-link" href="/services/elk/fklek/">FKLEK 采集展示</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/tool/portainer/">docker ui portainer</a></li><li class="post-list-item"><a class="post-list-link" href="/other/pxe/">PXE</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/devops/devops/">devops 概念</a></li><li class="post-list-item"><a class="post-list-link" href="/services/mq/compare/">MQ 比较</a></li><li class="post-list-item"><a class="post-list-link" href="/network/httpcode/">http code了解</a></li><li class="post-list-item"><a class="post-list-link" href="/services/mq/rabbitmq/check/">检查状态</a></li><li class="post-list-item"><a class="post-list-link" href="/services/database/mysql/index/">各种索引</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/debian/other/">常用软件ui</a></li><li class="post-list-item"><a class="post-list-link" href="/lang/python/pybase/">python 基础</a></li><li class="post-list-item"><a class="post-list-link" href="/lang/python/py3note/">py3笔记</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/storage/ceph/">ceph 分布式存储</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/storage/disk/">RAID 磁盘阵列</a></li><li class="post-list-item"><a class="post-list-link" href="/network/net/">network网络问题定位</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/tool/wikijs/">wiki.js</a></li><li class="post-list-item"><a class="post-list-link" href="/other/software/">linux 软件包</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/tool/ansible/galaxy/">ansible galaxy</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/devops/ansible/galaxy/">ansible galaxy</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/devops/gitlab/">gitlab 使用</a></li><li class="post-list-item"><a class="post-list-link" href="/services/database/postgresql/install/">postgresql介绍</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/thanos/">thanos storage</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/loki/">grafana loki logs</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/alert/">k8s alert</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/fluent/">k8s log apoll</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/devops/jenkins/">jenkins</a></li><li class="post-list-item"><a class="post-list-link" href="/services/nginx/nginx/">nginx 编译</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/apollo/">k8s config apollo</a></li><li class="post-list-item"><a class="post-list-link" href="/services/database/mysql/backup/">备份mysql</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/storage/">k8s storage</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/grafana/">k8s grafana</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/monitor/">monitor</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/istio/">istio</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/shell/fdisk/">磁盘 fdisk</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/PromQL/">promethus PromQL</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/prometheus/">promethus</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/question/">常见问题</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/cert-manager/">k8s cert manager</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/kubectl/">kubectl commands</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/dashboard/">Dashboard UI</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/mysql/">k8s mysql cluster</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/codetool/protobuf/">gogoprotobuf grpc</a></li><li class="post-list-item"><a class="post-list-link" href="/services/mq/kafka/kafka/">kafka介绍</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/Crossplane/">Crossplane控制面板</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/debian/dnsmasq/">dnsmasq</a></li><li class="post-list-item"><a class="post-list-link" href="/services/monitor/grafana/">grafana 安装配置</a></li><li class="post-list-item"><a class="post-list-link" href="/services/monitor/zabbix-sources/">zabbix 安装配置</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/tool/mycli/">MySQL AutoCompletion</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/tool/psensor/">psensor 监控</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/tool/vim/">vim 配置</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/debian/Xsession/">X session error</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/debian/grub/">grub主题样式</a></li><li class="post-list-item"><a class="post-list-link" href="/services/database/influxdb/influxdb-zabbix/">influxdb存放zabbix监控数据</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/debian/grub-cfg/">grub配置详解</a></li><li class="post-list-item"><a class="post-list-link" href="/lang/stable-diffusion/models/revAnimated/">revAnimated models</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/crack/unfreeze/">解除限制小魔法</a></li><li class="post-list-item"><a class="post-list-link" href="/network/Kcptun/">Kcptun安装使用</a></li><li class="post-list-item"><a class="post-list-link" href="/lang/stable-diffusion/models/processing/">picture processing models</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/shell/zimfw/">zimfw shell</a></li><li class="post-list-item"><a class="post-list-link" href="/lang/stable-diffusion/models/lora/">lora models说明</a></li><li class="post-list-item"><a class="post-list-link" href="/lang/stable-diffusion/deep/">Stable diffusion概念</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/gpu/">GPU CUDA安装</a></li><li class="post-list-item"><a class="post-list-link" href="/lang/python/venv/">venv虚拟环境</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/tool/nfs/">nfs介绍</a></li><li class="post-list-item"><a class="post-list-link" href="/lang/regular-expression/">regular expression</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/tool/ansible/ansible1/">ansible playbook</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/devops/ansible/ansible1/">ansible playbook</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/tool/ansible/ansible/">ansible安装使用入门</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/devops/ansible/ansible/">ansible安装使用入门</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/shell/customcmd/">自定义cmd命令</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/shell/split/">截取分割</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/containerd/">containerd安装</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/shell/scp/">scp上传下载</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/tool/harbor/">harbor容器仓库</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/k8s-compile/">k8s1.26.1编译部署</a></li><li class="post-list-item"><a class="post-list-link" href="/lang/go/environment/">go环境配置</a></li><li class="post-list-item"><a class="post-list-link" href="/lang/ruby/compile/">ruby从git拉取编译安装</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/shell/user-group/">用户组命令</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/text/process/svg/">svg.js示例</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/text/markdown/test/">md语法示例</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/tool/create_ap/">linux开启wifi</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/tool/ssh-tool/">ssh远程登陆工具</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/virtualization/kvm/">kvm安装入门</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/virtualization/container/docker-bit/">docker二进制安装</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/storage/fstab/">fstab挂盘</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/debian/os/">os信息备份</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/screenshot/">screenshot</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/vagrant/">vagrant</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/codetool/vscode/">visual studio code</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/codetool/vs-code/">visual studio code</a></li><li class="post-list-item"><a class="post-list-link" href="/other/sort/bubble/">冒泡排序</a></li><li class="post-list-item"><a class="post-list-link" href="/other/data-structure/binary-tree/">二叉树</a></li><li class="post-list-item"><a class="post-list-link" href="/services/database/mysql/explain/">explain执行计划</a></li><li class="post-list-item"><a class="post-list-link" href="/services/database/mysql/function/">mysql函数</a></li><li class="post-list-item"><a class="post-list-link" href="/services/database/mysql/my-conf/">mysql参数配置</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/text/markdown/pandoc/">pandoc文本格式转换</a></li><li class="post-list-item"><a class="post-list-link" href="/services/database/mysql/mysql-query/">mysql查询过程</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/databasetool/pl-sql/">PLSQL</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/codetool/idea-tool/">IDEA tool</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/codetool/sublime03/">Sublime设置</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/codetool/sublime02/">Sublime运行脚本</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/codetool/sublime01/">Sublime中文</a></li><li class="post-list-item"><a class="post-list-link" href="/lang/test/tests/">前置操作/后置操作</a></li><li class="post-list-item"><a class="post-list-link" href="/draft/">草稿</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/devops/drafts/">草稿</a></li><li class="post-list-item"><a class="post-list-link" href="/lang/node/hexo/hexo/">hexo插件</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/shell/decompress/">解压/压缩</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/shell/download/">download工具命令</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/helm/">helm工具</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/kubelet/">kubelet组件</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/text/markdown/formula/">Mathjax公式</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/harbor/">harbor镜像私库</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/kubeadm/">kubeadm容器化安装</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/flanneld/">flanneld虚拟网络</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/k8s/">kubernetes部署结构</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/shell/iptable/">iptable防火墙</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/shell/grep/">grep常用过滤</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/shell/tree/">tree工具</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/maven/">maven介绍</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/k8s01/">k8s集群</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/traefik/">traefik</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/etcd/">etcd集群</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/redis/">redis集群</a></li><li class="post-list-item"><a class="post-list-link" href="/services/database/redis/redis-cluster/">redis集群配置</a></li><li class="post-list-item"><a class="post-list-link" href="/services/database/mysql/my/">mysql配置文件</a></li><li class="post-list-item"><a class="post-list-link" href="/services/database/mysql/install/">mysql安装</a></li><li class="post-list-item"><a class="post-list-link" href="/lang/python/pip/">pip包管理</a></li><li class="post-list-item"><a class="post-list-link" href="/services/container/tomcat/">tomcat优化</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/debian/apt/">apt</a></li><li class="post-list-item"><a class="post-list-link" href="/lang/sawtl/">强弱类型语言</a></li><li class="post-list-item"><a class="post-list-link" href="/services/database/mongo/">mongodb</a></li><li class="post-list-item"><a class="post-list-link" href="/other/design-pattern/singleton/">singleton单例模式</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/docker1/">常用语法</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/shell/sed/">sed替换查找</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/shell/usage_high/">磁盘或Inode使用率高</a></li><li class="post-list-item"><a class="post-list-link" href="/network/network/">网络概念介绍</a></li><li class="post-list-item"><a class="post-list-link" href="/lang/node/npm/npm%E5%88%9D%E5%A7%8B/">npm初始</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/shell/vim/">vi/vim基本命令</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/shell/find/">find查找搜索</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/shell/top/">top排查服务器</a></li><li class="post-list-item"><a class="post-list-link" href="/lang/java/jvm-gc0/">初识jvm</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/text/markdown/flow/">markdown画图</a></li><li class="post-list-item"><a class="post-list-link" href="/services/zookeeper/%E9%80%89%E4%B8%BE%E6%9C%BA%E5%88%B6/">zk选举</a></li><li class="post-list-item"><a class="post-list-link" href="/lang/java/stream/">stream写法</a></li><li class="post-list-item"><a class="post-list-link" href="/lang/go/go%E5%88%9D%E8%AF%86/">go语法规则</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/shell/ps/">ps</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/text/markdown/mdgrammar/">md语法</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/%E5%88%9D%E8%AF%86K8S/">初识K8S</a></li><li class="post-list-item"><a class="post-list-link" href="/network/%E5%86%85%E7%BD%91%E7%A9%BF%E9%80%8F/">内网穿透</a></li><li class="post-list-item"><a class="post-list-link" href="/lang/node/hexo/%E8%AF%84%E8%AE%BA/">评论</a></li><li class="post-list-item"><a class="post-list-link" href="/network/on-line/">科学上网</a></li><li class="post-list-item"><a class="post-list-link" href="/services/elk/es-shield/">shield</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/devops/git/git-server/">git server 搭建</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/devops/git/git-cmd/">git命令</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/devops/git/git-pull/">git pull</a></li><li class="post-list-item"><a class="post-list-link" href="/other/avd/">avd</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/compose/">docker-compose</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/k8s/docker/">docker</a></li><li class="post-list-item"><a class="post-list-link" href="/linux/debian/dpkg/">dpkg</a></li><li class="post-list-item"><a class="post-list-link" href="/tool/redis-live/">live</a></li><li class="post-list-item"><a class="post-list-link" href="/services/elk/kibana/">kibana</a></li><li class="post-list-item"><a class="post-list-link" href="/services/elk/logstash/">logstash</a></li><li class="post-list-item"><a class="post-list-link" href="/services/elk/%E5%AE%89%E8%A3%85ElasticSearch/">安装elasticsearch</a></li><li class="post-list-item"><a class="post-list-link" href="/lang/node/hexo/%E6%90%AD%E5%BB%BAhexo/">搭建hexo</a></li><li class="post-list-item"><a class="post-list-link" href="/network/https%E8%87%AA%E5%B7%B1%E7%AD%BE%E5%90%8D/">https签名</a></li></ul> <script src="/js/require-2.1.6.js"></script> <script src="/js/jquery-1.9.1.min.js"></script> <script> $(".post-list").addClass("toc-article"); $(".post-list-item a").attr("target","_blank"); $("#post-nav-button > a:nth-child(2)").click(function() { $(".fa-bars, .fa-times").toggle(); $(".post-list").toggle(300); if ($(".toc").length > 0) { $("#toc, #tocButton").toggle(200, function() { if ($(".switch-area").is(":visible")) { $("#tocButton").attr("value", valueHide); } }) } else { } }) </script> <script> </script> </div> <!-- cpu --> <!--页面点击小心心--> <script> var newScript = document.createElement("script"); newScript.setAttribute("type","text/javascript"); newScript.setAttribute("src","/js/love.js"); document.body.appendChild(newScript); </script> <script> function prt(str) { let l = new String(str); return l.substring(l.indexOf("/*") + 3, l.lastIndexOf("*/")); } let str = function () { /* welcome to open console _____ _____ /\ \ /\ \ /::\ \ /::\ \ /::::\ \ /::::\ \ /::::::\ \ /::::::\ \ /:::/\:::\ \ /:::/\:::\ \ /:::/ \:::\ \ /:::/__\:::\ \ /:::/ \:::\ \ \:::\ \:::\ \ /:::/ / \:::\ \ ___\:::\ \:::\ \ /:::/ / \:::\ \ /\ \:::\ \:::\ \ /:::/____/ \:::\____\/::\ \:::\ \:::\____\ \:::\ \ \::/ /\:::\ \:::\ \::/ / \:::\ \ \/____/ \:::\ \:::\ \/____/ \:::\ \ \:::\ \:::\ \ \:::\ \ \:::\ \:::\____\ \:::\ \ \:::\ /:::/ / \:::\ \ \:::\/:::/ / \:::\ \ \::::::/ / \:::\____\ \::::/ / \::/ / \::/ / \/____/ \/____/ @阿帅 */ } console.log(prt(str)); var now = new Date(); function createtime() { var grt= new Date("12/03/2016 21:38:00");//在此处修改你的建站时间,格式:月/日/年 时:分:秒 now.setTime(now.getTime()+250); days = (now - grt ) / 1000 / 60 / 60 / 24; dnum = Math.floor(days); hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum); hnum = Math.floor(hours); if(String(hnum).length ==1 ){hnum = "0" + hnum;} minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum); mnum = Math.floor(minutes); if(String(mnum).length ==1 ){mnum = "0" + mnum;} seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum); snum = Math.round(seconds); if(String(snum).length ==1 ){snum = "0" + snum;} document.getElementById("timeDate").innerHTML = "本站已运行<span class='date_num'> "+dnum+"</span> 天 "; document.getElementById("times").innerHTML ="<span class='date_num'>"+ hnum + "</span> 小时 <span class='date_num'>" + mnum + "</span> 分 <span class='date_num'>" + snum + "</span> 秒 | "; } setInterval("createtime()",250); </script> <footer id="footer"> <div class="outer"> <div id="footer-info"> <div class="footer-left"> © 2024 阿帅 </div> <div class="footer-right"> <a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/luuman/hexo-theme-spfk" target="_blank">spfk</a> by luuman </div> </div> <div class="visit"> <!--计数设置--> <span id="timeDate">载入天数...</span><span id="times">载入时分秒...</span> <span id="busuanzi_container_site_pv" style='display:none'> <span id="site-visit" >海贼到访数: <span id="busuanzi_value_site_uv"></span> </span> </span> <span>, </span> <span id="busuanzi_container_page_pv" style='display:none'> <span id="page-visit">本页阅读量: <span id="busuanzi_value_page_pv"></span> </span> </span> </div> </div> </footer> </div> <script src="/js/require-2.1.6.js"></script> <script src="/js/jquery-1.9.1.min.js"></script> <script src="/js/main.js"></script> <script src="/js/busuanzi.pure.mini.js"></script> <script src="/js/search.js"></script> <script> $(document).ready(function() { var backgroundnum = 24; var backgroundimg = "url(/background/bg-x.jpg)".replace(/x/gi, Math.ceil(Math.random() * backgroundnum)); $("#mobile-nav").css({"background-image": backgroundimg,"background-size": "cover","background-position": "center"}); $(".left-col").css({"background-image": backgroundimg,"background-size": "cover","background-position": "center"}); }) </script> <div class="scroll" id="scroll"> <a href="#"><i class="fa fa-arrow-up"></i></a> <a href="#comments"><i class="fa fa-comments-o"></i></a> <a href="#footer"><i class="fa fa-arrow-down"></i></a> </div> <script> $(document).ready(function() { if ($("#comments").length < 1) { $("#scroll > a:nth-child(2)").hide(); }; }) </script> <script language="javascript"> $(function() { $("a[title]").each(function() { var a = $(this); var title = a.attr('title'); if (title == undefined || title == "") return; a.data('title', title).removeAttr('title').hover( function() { var offset = a.offset(); $("<div id=\"anchortitlecontainer\"></div>").appendTo($("body")).html(title).css({ top: offset.top - a.outerHeight() - 15, left: offset.left + a.outerWidth()/2 + 1 }).fadeIn(function() { var pop = $(this); setTimeout(function() { pop.remove(); }, pop.text().length * 800); }); }, function() { $("#anchortitlecontainer").remove(); }); }); }); </script> <!--搜索---> <script type="text/javascript"> var inputArea = document.querySelector("#local-search-input"); inputArea.onclick = function(){ getSearchFile(); this.onclick = null } inputArea.onkeydown = function(){ if(event.keyCode == 13) return false } var baseurl=document.domain;//del var getSearchFile = function(){ searchFunc("/" + "search.json", 'local-search-input', 'local-search-result',baseurl); } $(document).on('click', function(e) { var si= $(e.target).closest('#id_search').length; var d= $(e.target).closest('#local_search').length; //console.log(si+" "+" "+d)//si==0 && d==0 if(si==1){ document.body.style.overflow='hidden'; } // 关闭弹框 if( si==0 && d==0){ // console.log('弹出框以外的部分被点击了'); document.body.style.overflow='' $('#local_search').hide(); } }); </script> </div> </body> </html>