mirror of
https://github.com/Dichgrem/Blog.git
synced 2025-08-01 09:19:32 -04:00
Compare commits
14 Commits
7f4708a6cd
...
main
Author | SHA1 | Date | |
---|---|---|---|
ae4e526ea2 | |||
c72880f07c | |||
defe396d05 | |||
23db8005e0 | |||
fd5d415988 | |||
80d8c193cc | |||
79c32ed073 | |||
de0f8c7094 | |||
d1436fdf3d | |||
b3e588daa6 | |||
71b4d83675 | |||
4c4fb9a5d6 | |||
dd3f7f4641 | |||
5a1be5b33b |
@ -29,25 +29,62 @@ tags = ["综合工程"]
|
||||
|
||||
## 安装软件
|
||||
|
||||
随后安装常用开源软件:
|
||||
随后安装常用开源软件(KDE环境省略file和wayland)
|
||||
|
||||
```
|
||||
# gui
|
||||
|
||||
paru -S alacritty zellij qemu-full virt-manager wireshark-qt floorp-bin foliate materialgram-bin legcord-bin keepassxc onlyoffice-bin kazumi-bin vlc krita qtscrcpy localsend-bin strawberry oculante obs-studio
|
||||
paru -S floorp-bin keepassxc qemu-full virt-manager materialgram-bin legcord-bin onlyoffice-bin localsend-bin kazumi-bin foliate vlc krita qtscrcpy strawberry oculante obs-studio
|
||||
|
||||
# tui
|
||||
|
||||
paru -S neovim yazi lazygit btop
|
||||
paru -S neovim yazi lazygit btop zellij termshark
|
||||
|
||||
# cli
|
||||
|
||||
paru -S nexttrace-bin android-tools syncthing aria2 zola fastfetch onefetch starship atuin bat fzf eza tree
|
||||
paru -S alacritty fish fastfetch tealdeer expac fish-autopair fish-pure-prompt fisher onefetch starship atuin bat fzf fd ripgrep eza tree android-tools payload-dumper-go-bin nexttrace-bin syncthing aria2
|
||||
|
||||
# other
|
||||
|
||||
paru -S ttf-jetbrains-mono-nerd fcitx5-chinese-addons fcitx5-skin-material fcitx5-im fcitx5-rime npm pnpm just go wl-clipboard
|
||||
# file
|
||||
|
||||
paru -S gvfs gvfs-mtp gvfs-afc gvfs-nfs nemo
|
||||
|
||||
# zip
|
||||
|
||||
paru -S peazip
|
||||
|
||||
# Type
|
||||
|
||||
paru -S fcitx5-configtool fcitx5-chinese-addons fcitx5-skin-material fcitx5-im fcitx5-rime
|
||||
|
||||
# Blog
|
||||
|
||||
paru -S zola npm pnpm just go
|
||||
|
||||
# ttf
|
||||
|
||||
paru -S ttf-jetbrains-mono-nerd
|
||||
|
||||
# Wayland
|
||||
|
||||
paru -S hyprland waybar wofi network-manager-applet swww wl-gammarelay-rs brightnessctl easyeffects wireplumber pipewire blueman wl-clipboard-rs swaync swayosd swappy grim wlogout hyprlock hyprpolkitagent
|
||||
```
|
||||
| 分类 | 软件列表 |
|
||||
| ------------ | ------------------------------------------------ |
|
||||
| **窗口管理器** | hyprland |
|
||||
| **状态栏** | waybar |
|
||||
| **启动器** | wofi |
|
||||
| **网络** | network-manager-applet |
|
||||
| **蓝牙** | blueman |
|
||||
| **音频** | pipewire, wireplumber |
|
||||
| **亮度** | brightnessctl, wl-gammarelay-rs |
|
||||
| **剪贴板** | wl-clipboard-rs,wl-clip-persist |
|
||||
| **通知** |swaync,swayosd |
|
||||
| **截图** | grim, swappy |
|
||||
| **壁纸管理** | swww |
|
||||
| **Polkit 授权代理** | hyprpolkitagent |
|
||||
| **锁屏/开始菜单** | hyprlock, wlogout |
|
||||
| **文件管理** | gvfs, gvfs-mtp, gvfs-afc, gvfs-nfs, nemo |
|
||||
|
||||
安装完毕后我们开始配置输入法与字体:
|
||||
|
||||
@ -309,6 +346,83 @@ sysctl net.ipv4.tcp_congestion_control
|
||||
```
|
||||
net.ipv4.tcp_congestion_control = bbr
|
||||
```
|
||||
|
||||
## 性能模式切换
|
||||
需要安装``power-profiles-daemon``
|
||||
```
|
||||
# 查看可用的电源配置文件(profiles)
|
||||
powerprofilesctl list
|
||||
|
||||
# 查看当前正在使用的 profile
|
||||
powerprofilesctl get
|
||||
|
||||
# 切换到“性能”模式
|
||||
sudo powerprofilesctl set performance
|
||||
|
||||
# 切换到“平衡”模式
|
||||
sudo powerprofilesctl set balanced
|
||||
|
||||
# 切换到“省电”模式
|
||||
sudo powerprofilesctl set power-saver
|
||||
```
|
||||
## 其他性能优化
|
||||
|
||||
```
|
||||
Profile‑sync‑daemon
|
||||
将浏览器配置文件和缓存挂载到内存,退出时再写回磁盘:
|
||||
|
||||
sudo pacman -S profile-sync-daemon
|
||||
systemctl --user enable --now psd.service
|
||||
|
||||
Systemd‑oomd
|
||||
启用 systemd 自带的内存超载保护守护进程:
|
||||
|
||||
sudo pacman -S systemd-oomd
|
||||
sudo systemctl enable --now systemd-oomd
|
||||
|
||||
Bpftune
|
||||
加载 BPF 性能调优脚本(网络、I/O、调度等):
|
||||
|
||||
sudo pacman -S bpftune
|
||||
sudo systemctl enable --now bpftune
|
||||
|
||||
Ananicy‑Cpp
|
||||
根据预设规则给游戏、多媒体和后台任务打优先级标签:
|
||||
|
||||
sudo pacman -S ananicy-cpp
|
||||
sudo systemctl enable --now ananicy-cpp
|
||||
```
|
||||
|
||||
## 常用命令
|
||||
|
||||
```
|
||||
更新系统:sudo pacman -Syu
|
||||
|
||||
重新安装所有软件包:sudo pacman -Qq | sudo pacman -S -
|
||||
|
||||
Reset keyrings:
|
||||
|
||||
sudo rm -rf /etc/pacman.d/gnupg
|
||||
sudo pacman-key --init
|
||||
sudo pacman-key --populate archlinux
|
||||
|
||||
移除数据库锁:sudo rm -f /var/lib/pacman/db.lck
|
||||
|
||||
清理软件包缓存:sudo pacman -Sc (或 -Scc 完全清空)
|
||||
|
||||
删除孤立软件包:sudo pacman -Rns $(pacman -Qtdq)
|
||||
|
||||
Install Gaming packages:sudo pacman -S steam wine lutris dxvk
|
||||
|
||||
排序镜像:
|
||||
|
||||
sudo pacman -S reflector
|
||||
sudo reflector --latest 10 --sort rate --save /etc/pacman.d/mirrorlist
|
||||
|
||||
更改 DNS 服务器:编辑 /etc/systemd/resolved.conf 中的 DNS=1.1.1.1 8.8.8.8,然后 sudo systemctl restart systemd-resolved
|
||||
```
|
||||
|
||||
|
||||
## 在Arch Linux上安装Docker
|
||||
|
||||
一般推荐在qemu虚拟机中安装,这里仅做示例:
|
||||
|
@ -22,8 +22,6 @@ tags = ["综合工程"]
|
||||
- 8.VPN配置回家;
|
||||
- 9.实现透明代理。
|
||||
|
||||
> 剩余专业路由功能可以由ROS替代,服务则跑在NAS系统上,避免ALL in Boom!
|
||||
|
||||
## 大致思路
|
||||
|
||||
- 使用高性能的X86主机管理拨号和 DHCP 内网的工作,其他无线路由器桥接做AP,Mesh组网;
|
||||
@ -52,14 +50,39 @@ tags = ["综合工程"]
|
||||
|
||||
## **如何得到一个openwrt系统**
|
||||
|
||||
- 可以在恩山论坛上使用他人编译好的现成的镜像,如"高大全","精品小包"等等,但存在一定风险;
|
||||
- 可以使用[官方固件](https://downloads.openwrt.org/)下载得到一个最小化的系统,再一步步添加自己要用的包;注意需要根据你的uboot来选择,注意固件名称是否带了uboot_mod!
|
||||
- 可以使用[Openwrt 在线编译](https://firmware-selector.openwrt.org/)或[Openwrt.ai](https://openwrt.ai/?target=x86%2F64&id=generic)在线编译
|
||||
1. 使用编译好的现成的镜像:
|
||||
|
||||
- 恩山论坛上的"高大全","精品小包"等等,但存在一定风险;
|
||||
- 使用[官方固件](https://downloads.openwrt.org)下载得到一个最小化的系统,再一步步添加自己要用的包;注意需要根据你的uboot来选择,注意固件名称是否带了uboot_mod!
|
||||
|
||||
2. 自行编译:
|
||||
|
||||
- [Openwrt.ai](https://openwrt.ai/?target=x86%2F64&id=generic)在线编译
|
||||
一个固件;
|
||||
- 可以使用GitHub action 云编译一个固件;
|
||||
- 可以在本地linux环境中进行编译。
|
||||
|
||||
## **X86平台安装准备:**
|
||||
3. ImageBuilder
|
||||
|
||||
- 使用[Openwrt 官方ImageBuilder编译](https://firmware-selector.openwrt.org/)
|
||||
- 自行下载对应的ImageBuilder包并构建.
|
||||
|
||||
## Toolchain/SDK/ImageBuilder
|
||||
|
||||
| 特性 | **Toolchain** | **SDK** | **Image Builder** |
|
||||
| -------- | -------------------------------------- | ---------------------------------------------- | ------------------------------------------------------------------------------ |
|
||||
| 包含内容 | 仅交叉编译工具链(二进制版 GCC、ld、musl、binutils) | 完整交叉编译环境 + feeds 脚本 + package 目录,用于 `.ipk` 包开发 | 预编译的根文件系统 + opkg 包(无需源码编译),用于快速定制固件映像 |
|
||||
| 典型用途 | 用于编译第三方程序或 CI,如 hello-world 示例 | 编写和编译 `.ipk` 包,本地或自动化环境中离线开发 | 快速生成可刷写的固件镜像,集成所需包且无需完整源码树 |
|
||||
| 解压即用 | ✅ | ✅ | ✅ |
|
||||
| 在源码树中的作用 | `make toolchain/install` 自动识别并使用跳过编译流程 | 源码树中不会触发 SDK 安装,需要手动解压并进入其目录使用 | 不使用源码树,直接在 Image Builder 根目录下运行 `make image` 等命令 |
|
||||
| 大小 | 较小(几十 MB) | 较大(上百 MB) | 中等(约数百 MB,因包含预编译包) |
|
||||
| 构建时间 | 几秒到几分钟 | 几分钟到十几分钟(取决于 feeds 大小) | 极快,可在几十秒到几分钟内完成定制镜像 |
|
||||
| 兼容性 | 与对应 Release 完全匹配 | 与对应 Release 完全匹配 | 与对应 Release 完全匹配 |
|
||||
| 使用难度 | 简单,只需解压并设置 PATH | 适中,需要理解 feeds 机制及包管理 | 最简单,适合终端用户或快速测试环境
|
||||
|
||||
## **X86平台安装流程:**
|
||||
|
||||
0. 安装准备:
|
||||
|
||||
- 一个U盘与一台双网口物理机
|
||||
|
||||
@ -72,26 +95,22 @@ tags = ["综合工程"]
|
||||
|
||||
- [img 写盘工具](https://www.roadkil.net/program.php?ProgramID=12#google_vignette)
|
||||
|
||||
|
||||
|
||||
## **X86平台安装流程:**
|
||||
|
||||
1.进入PE环境:
|
||||
1. 进入PE环境:
|
||||
|
||||
- 打开微PE,将其安装进U盘中,安装完成后将 img 工具和 openwrt 包一起放进去;
|
||||
- 将U盘插入目标主机,进入 BIOS-boot 设置U盘优先启动,各主板进入 BIOS 的按键不同,不确定的话建议都试一遍。
|
||||
|
||||
2.格式化硬盘并写盘
|
||||
2. 格式化硬盘并写盘
|
||||
|
||||
- 进入PE环境中,可以看到存在名为“分区助手”的软件,打开它并将目标主机硬盘格式化;注意不要分区!不要分区!不要设置文件系统!否则后续可能无法编译!点击左上角提交并执行
|
||||
- 打开img写盘工具,将openwrt包写入硬盘,注意不要写进U盘里。
|
||||
|
||||
3.进入配置界面
|
||||
3. 进入配置界面
|
||||
|
||||
- 重启系统并快速拔出U盘,避免重新进入PE;这时系统开始运行了。注意Esir固件是不跑码的,无需担心。- 一个U盘与一台双网口物理机
|
||||
- 当看到 `please press Enter to activate this console`这个提示的时候系统就安装完毕了。可使用 passwd 命令设置密码。软路由将自动获取IP地址,随后我们在浏览器中打开该地址,即可看到 Lucl 界面。
|
||||
|
||||
4.如果你使用官方固件,注意:
|
||||
4. 如果你使用官方固件,注意:
|
||||
- 硬盘空间有一部分没有被格式化,可以手动格式化为ext4并挂载。
|
||||
- 注意初始IP往往是192.168.1.1,如果和光猫冲突需要在网络-接口中更改。
|
||||
- 基本系统主题比较简陋,可以使用luci-theme-argon。
|
||||
@ -100,14 +119,8 @@ tags = ["综合工程"]
|
||||
uci commit luci
|
||||
/etc/init.d/uhttpd restart``
|
||||
然后重新访问 Web 界面,查看是否恢复正常。
|
||||
- 一般要安装的包:
|
||||
```
|
||||
openssh-sftp-server
|
||||
libpcap
|
||||
luci-app-upnp
|
||||
luci-app-ttyd
|
||||
kmod-nft-xxx
|
||||
```
|
||||
|
||||
|
||||
## **X86平台本地编译完整openwrt**
|
||||
|
||||
- **系统版本:Debian 11 或者 Ubuntu LTS**
|
||||
@ -144,7 +157,7 @@ sudo apt clean
|
||||
```
|
||||
useradd -m openwrt # 新建一个名为 openwrt 的用户
|
||||
```
|
||||
> 不可以使用Root用户进行编译!!!
|
||||
> 不可以使用Root用户进行编译!!!
|
||||
|
||||
- **修改用户默认的 Shell**
|
||||
```
|
||||
@ -158,50 +171,66 @@ su openwrt
|
||||
cd ~
|
||||
```
|
||||
|
||||
- **拉取源码,这里用的是 LEDE 分支源码:**
|
||||
- **拉取源码,这里用的是 ImmortalWrt 24.10 分支源码:**
|
||||
```
|
||||
git clone https://github.com/coolsnowwolf/lede
|
||||
cd lede
|
||||
git clone https://github.com/immortalwrt/immortalwrt.git
|
||||
cd immortalwrt
|
||||
```
|
||||
|
||||
- **选择分支**
|
||||
|
||||
如果你想要编译稳定版(stable),使用
|
||||
```
|
||||
git checkout xxx #例如git checkout v24.10.2
|
||||
```
|
||||
如果你想要编译最新版(snapshot),使用
|
||||
```
|
||||
git switch xxx #例如git switch openwrt-24.10
|
||||
```
|
||||
|
||||
### 目录说明
|
||||
|
||||
- buildroot: OpenWrt 的核心目录,包含构建系统相关的文件。
|
||||
- `feeds.conf.default`:定义软件包源的配置文件。
|
||||
- `files/`:存放自定义文件,用于覆盖默认的 root 文件系统。
|
||||
|
||||
- target: 包含目标设备架构的配置和构建信息。
|
||||
- `linux/`:包含与 Linux 内核相关的代码和配置。
|
||||
- `generic/`:通用配置文件。
|
||||
- `platform/`:针对具体设备平台的特定配置。
|
||||
|
||||
- package: 包含所有 OpenWrt 的软件包。
|
||||
- `base/`:基本功能相关的软件包(如 BusyBox、opkg)。
|
||||
- `kernel/`:与内核相关的补丁或模块。
|
||||
- `network/`:网络工具和协议(如 DHCP、DNS)。
|
||||
- `utils/`:各种实用工具(如编解码器、文件工具)。
|
||||
|
||||
- config: 存放默认配置文件,例如 `Config.in`,用于定义菜单项。
|
||||
- scripts: 构建过程中使用的辅助脚本(如生成补丁、编译镜像)。
|
||||
- toolchain: 构建工具链所需的文件,如编译器、链接器。
|
||||
- tools: 一些构建系统依赖的额外工具(如 `autoconf`、`zlib`)。
|
||||
- include: 存放 Makefile 的通用模板和其他全局定义文件。
|
||||
- feeds: 包含通过 `feeds.conf` 配置的外部软件包源。
|
||||
- documentation: 包含与 OpenWrt 项目相关的文档,如构建指南和开发文档。
|
||||
| 名称 | 作用 |
|
||||
| -------------------- | ---------------------------------------------------------------------- |
|
||||
| `Makefile` | **整个 OpenWrt 构建系统的总入口点**(顶层 Makefile),运行 `make menuconfig`、`make` 都依赖它 |
|
||||
| `Config.in` | Kconfig 系统的入口配置文件,决定 `make menuconfig` 菜单显示什么选项 |
|
||||
| `config/` | 构建系统的默认配置模板、菜单逻辑,和 `menuconfig` 相关 |
|
||||
| `include/` | 包含通用 makefile 片段的目录(比如编译选项、函数定义) |
|
||||
| `rules.mk` | 所有包编译通用规则都写在这里,`include $(TOPDIR)/rules.mk` 是常见语句 |
|
||||
| `feeds.conf.default` | 定义 Feed 源(即可选的软件源),可用于管理外部包,比如 `luci`、`packages` |
|
||||
| `feeds/` *(克隆后还没出现)* | `./scripts/feeds update -a` 后才会出现,用来保存外部 feed 的代码 |
|
||||
| `package/` | OpenWrt 自带的核心包和第三方包(除 feeds 外的)都在这,结构是 `package/<分类>/<包名>` |
|
||||
| `target/` | 支持的平台架构,比如 `x86`、`ramips`、`ath79`、`mediatek` 等都在里面 |
|
||||
| `toolchain/` | 编译器链、glibc/musl、binutils、gcc 都在这里构建 |
|
||||
| `tools/` | 构建工具目录,编译前工具如 `m4`、`autoconf`、`xz`、`patch` 等放在这 |
|
||||
| `scripts/` | 脚本工具目录,如 `feeds` 管理、镜像合并、menuconfig 支持等 |
|
||||
| `LICENSES/` | 所有包/组件的许可证归档 |
|
||||
| `COPYING` | OpenWrt 的主许可证(GPLv2) |
|
||||
| `README.md` | 简要介绍如何开始使用 OpenWrt 的说明文档 |
|
||||
| `BSDmakefile` | 为 BSD 系统一些兼容 makefile,Linux 用户用不到 |
|
||||
|
||||
|
||||
- **添加软件源,可自行添加软件源至 feeds.conf.default 文件,也可以直接git添加需要的软件到lede目录下:**
|
||||
- **添加软件源,可自行添加软件源至 feeds.conf.default 文件**
|
||||
```
|
||||
vim feeds.conf.default
|
||||
```
|
||||
|
||||
**常用源**
|
||||
```
|
||||
常用源
|
||||
src-git kenzo https://github.com/kenzok8/openwrt-packages
|
||||
src-git small https://github.com/kenzok8/small
|
||||
src-git haibo https://github.com/haiibo/openwrt-packages
|
||||
src-git liuran001 https://github.com/liuran001/openwrt-packages
|
||||
```
|
||||
|
||||
**常用仓库**
|
||||
```
|
||||
src/gz kwrt_core https://dl.openwrt.ai/releases/24.10/targets/x86/64/6.6.83
|
||||
src/gz kwrt_base https://dl.openwrt.ai/releases/24.10/packages/x86_64/base
|
||||
src/gz kwrt_packages https://dl.openwrt.ai/releases/24.10/packages/x86_64/packages
|
||||
src/gz kwrt_luci https://dl.openwrt.ai/releases/24.10/packages/x86_64/luci
|
||||
src/gz kwrt_routing https://dl.openwrt.ai/releases/24.10/packages/x86_64/routing
|
||||
src/gz kwrt_kiddin9 https://dl.openwrt.ai/releases/24.10/packages/x86_64/kiddin9
|
||||
```
|
||||
|
||||
- **单独添加**(在更新并安装插件之前执行)例如:
|
||||
|
||||
@ -215,126 +244,129 @@ git clone https://github.com/chenmozhijin/turboacc.git
|
||||
./scripts/feeds update -a
|
||||
./scripts/feeds install -a
|
||||
```
|
||||
|
||||
| `./scripts/feeds update -a` | 同步/更新 **外部 feed**(packages、luci、routing 等)的 Git 仓库到本地 `feeds/` 目录 |
|
||||
| ---------------------------- | ----------------------------------------------------------------- |
|
||||
| `./scripts/feeds install -a` | 把你在 feeds 里选要用的包 **链接** 到源码树的 `package/feeds/`,让它们参与编译 |
|
||||
|
||||
- **自定义配置**
|
||||
|
||||
**修改默认IP为 10.0.0.2**
|
||||
```
|
||||
sed -i 's/192.168.1.1/192.168.2.1/g' package/base-files/files/bin/config_generate
|
||||
```
|
||||
|
||||
#!/usr/bin/env bash
|
||||
# diy-part2.sh — 在镜像生成时注入默认设置和定制 SSH 横幅及模型修复
|
||||
|
||||
**修改默认主机名**
|
||||
```
|
||||
sed -i '/uci commit system/i\uci set system.@system[0].hostname='OpenWrt'' package/lean/default-settings/files/zzz-default-settings
|
||||
# 1. 默认 hostname(可选)
|
||||
sed -i 's/=ImmortalWrt/=my-device/' package/base-files/files/bin/config_generate
|
||||
|
||||
# 2. 默认 IP 地址(可选)
|
||||
sed -i 's/192.168.1.1/192.168.5.1/' package/base-files/files/bin/config_generate
|
||||
|
||||
# 3. 默认 root 密码(请换成安全密码)
|
||||
HASH=$(openssl passwd -1 'yourpassword')
|
||||
sed -i "s|root::0:0:99999|root:${HASH}:0:0:99999|" package/base-files/files/etc/shadow
|
||||
|
||||
# 4. 设置默认 LuCI 主题为 argon(内置在 luci feeds)
|
||||
cat >>package/base-files/files/etc/uci-defaults/99_set_theme <<'EOF'
|
||||
uci set luci.main.mediaurlbase=/luci-static/argon
|
||||
uci commit luci
|
||||
EOF
|
||||
chmod +x package/base-files/files/etc/uci-defaults/99_set_theme
|
||||
|
||||
# 5. 默认加载 BBR 拥塞控制算法
|
||||
mkdir -p package/base-files/files/etc/sysctl.d
|
||||
cat >>package/base-files/files/etc/sysctl.d/99-bbr.conf <<'EOF'
|
||||
net.core.default_qdisc=fq_codel
|
||||
net.ipv4.tcp_congestion_control=bbr
|
||||
EOF
|
||||
|
||||
# 检查BBR: sysctl net.ipv4.tcp_congestion_control
|
||||
|
||||
# 6. 将默认 shell 修改为 bash
|
||||
sed -i "s|/bin/ash|/bin/bash|g" package/base-files/files/etc/passwd
|
||||
# 请在 .config 中添加 TARGET_PACKAGES += bash
|
||||
|
||||
# 7. 自定义 SSH 登录横幅(banner)
|
||||
mkdir -p package/base-files/files/etc
|
||||
if [ -f "scripts/custom-files/banner.txt" ]; then
|
||||
cp scripts/custom-files/banner.txt package/base-files/files/etc/banner
|
||||
else
|
||||
cat >package/base-files/files/etc/banner <<'EOF'
|
||||
Welcome to MyDevice (ImmortalWrt)\n
|
||||
EOF
|
||||
fi
|
||||
|
||||
# 8. 自定义 LuCI 概览设备型号 🛠
|
||||
# 通过 uci-defaults 脚本写入 /tmp/sysinfo/model
|
||||
cat >>package/base-files/files/etc/uci-defaults/99-model-fix <<'EOF'
|
||||
#!/bin/sh
|
||||
# 设置自定义设备型号
|
||||
mkdir -p /tmp/sysinfo
|
||||
echo "Your Router Model" > /tmp/sysinfo/model
|
||||
exit 0
|
||||
EOF
|
||||
chmod +x package/base-files/files/etc/uci-defaults/99-model-fix
|
||||
```
|
||||
|
||||
**加入编译者信息**
|
||||
```
|
||||
sed -i "s/OpenWrt /smith build $(TZ=UTC-8 date "+%Y.%m.%d") @ OpenWrt /g" package/lean/default-settings/files/zzz-default-settings
|
||||
```
|
||||
|
||||
- 执行 **make menuconfig** 命令进入编译菜单。
|
||||
|
||||
**修改默认主题**
|
||||
```
|
||||
sed -i "s/luci-theme-bootstrap/luci-theme-argon/g" feeds/luci/collections/luci/Makefile
|
||||
```
|
||||
|
||||
执行 **make menuconfig** 命令进入编译菜单。
|
||||
| 命令 | 功能描述 | 优点 | 适用场景 |
|
||||
| ----------------- | ---------------------------------------------------- | -------------------- | -------------- |
|
||||
| `make menuconfig` | 以 ncurses 界面交互式地浏览、修改当前 `.config` 与最新 Kconfig 中的所有选项 | 界面友好,支持搜索和分类;可直观调整 | 想手动挑选/调整配置时 |
|
||||
| `make oldconfig` | 在命令行逐项对比 `.config` 与最新 Kconfig:保留原值、提示新增项、删除废弃项 | 快速同步,只对新增选项发出提示;无需界面 | 自动化脚本或快速同步配置时 |
|
||||
| `make defconfig` | 忽略当前 `.config`,直接加载架构/板级目录下的默认配置(`defconfig`) | 一键生成官方/平台推荐的「干净」配置 | 想重置到官方默认或重新开始时 |
|
||||
|
||||
|
||||
### **编译配置菜单说明(部分)**
|
||||
|
||||
```
|
||||
Target System (Broadcom BCM27xx) # 选择处理器架构
|
||||
└── Subtarget (BCM2711 boards (64 bit)) # 选择处理器
|
||||
└── Target Profile (Raspberry Pi 4B/400/4CM (64bit)) # 预制配置文件
|
||||
└── Target Images # 固件映像设置
|
||||
└── ramdisk # 内存盘
|
||||
├── Compression # 压缩等级 (none 表示不压缩)
|
||||
├── Root filesystem archives # 根文件系统存档类型
|
||||
│ ├── cpio.gz
|
||||
│ └── tar.gz
|
||||
├── Root filesystem images # 根文件系统格式
|
||||
│ ├── ext4 # 适用于大容量闪存
|
||||
│ ├── squashfs # 适用于小容量闪存
|
||||
│ └── Gzip images # Gzip 存档
|
||||
└── Image Options
|
||||
├── Kernel partition size # 内核分区大小
|
||||
├── Root filesystem partition size # 跟文件系统分区大小
|
||||
└── Make /var persistent # 持久化 /var
|
||||
Target System (x86) # 选择目标平台
|
||||
└── Subtarget (x86_64) # 选择 64-bit 子架构
|
||||
└── Target Profile (Generic) # “Generic” 表示通用 x86_64 设备
|
||||
└── Target Images # 固件镜像设置
|
||||
├── ramdisk # 可选内存盘镜像
|
||||
│ ├── Compression # 压缩类型(如 none 表示无压缩)
|
||||
│ ├── Root filesystem archives # 压缩存档:cpio.gz 或 tar.gz
|
||||
│ └── Root filesystem images # 文件系统镜像:ext4、squashfs、Gzip
|
||||
└── Image Options # 镜像选项
|
||||
├── Kernel partition size # 内核分配分区大小
|
||||
├── Root filesystem partition size # 根文件系统分区大小
|
||||
└── Make /var persistent # 是否保留 /var 持久化
|
||||
|
||||
Enable experimental features by default # 默认启用实验性功能
|
||||
Global build settings # 全局编译设置
|
||||
Advanced configuration options (for developers) # 高级选项(仅供开发者)
|
||||
Build the OpenWrt Image Builder # 编译 OpenWrt 镜像编译器
|
||||
Build the OpenWrt SDK # 编译 OpenWrt SDK
|
||||
Package the OpenWrt-based Toolchain # 打包 OpenWrt 工具链
|
||||
Image configuration # 镜像选项
|
||||
Global build settings # 全局构建设置
|
||||
Advanced configuration options (for developers) # 开发者高级选项
|
||||
Build the OpenWrt Image Builder # 编译镜像构建器
|
||||
Build the OpenWrt SDK # 构建交叉编译 SDK
|
||||
Package the OpenWrt‑based Toolchain # 打包 OpenWrt 工具链
|
||||
Image configuration # 镜像总体配置页面
|
||||
|
||||
Base system # 基本组件
|
||||
Administration # 管理员工具
|
||||
Boot Loaders # 引导程序
|
||||
Development # 开发者工具
|
||||
Extra packages # 额外包
|
||||
Firmware # 固件工具
|
||||
Fonts # 字体
|
||||
Kernel modules # 内核模块
|
||||
Languages # 额外的语言 (Python3, PHP, NodeJS 等)
|
||||
Libraries # 系统库
|
||||
LuCI # LuCI 插件(一般只需修改应用和主题)
|
||||
Base system # 系统基础组件
|
||||
Administration # 管理工具(如 ssh、管理员脚本)
|
||||
Boot Loaders # 引导程序(如 grub、syslinux)
|
||||
Development # 编译/调试辅助工具
|
||||
Extra packages # 附加应用(如 wget、curl)
|
||||
Firmware # 固件工具
|
||||
Fonts # 字体支持
|
||||
Kernel modules # x86 内核模块驱动
|
||||
Languages # 编程语言包(如 Python3、Node.js)
|
||||
Libraries # 系统库依赖
|
||||
LuCI # Web UI 前端
|
||||
└── Collections
|
||||
└── Modules
|
||||
└── Applications
|
||||
└── Themes
|
||||
└── Protocols
|
||||
└── Libraries
|
||||
└── default-settings # 默认选项(自动配置语言包)
|
||||
└── default‑settings
|
||||
|
||||
Mail # 邮件
|
||||
Multimedia # 多媒体
|
||||
Network # 网络相关
|
||||
Sound # 音频
|
||||
Utilities # 各类实用软件(比如 VIM)
|
||||
Xorg
|
||||
```
|
||||
Mail # 邮件客户端
|
||||
Multimedia # 媒体工具(如 ffmpeg)
|
||||
Network # 网络功能(如 openvpn、wireguard)
|
||||
Sound # 音频相关软件
|
||||
Utilities # 常用实用程序(如 vim、htop)
|
||||
Xorg # 桌面环境支持(X11 图形系统)
|
||||
|
||||
### **菜单选项说明**
|
||||
|
||||
**选择 CPU 类型**
|
||||
```
|
||||
Target System (x86) --> # 软路由选择 x86,硬路由根据型号厂家自行选择
|
||||
|
||||
Subtarget (x86_64) --> # CPU 子选项
|
||||
|
||||
Target Profile (Generic x86/64) --> # 厂家具体型号
|
||||
```
|
||||
**设置镜像编译的格式(squashfs,ext4)**
|
||||
```
|
||||
Target Images --> # 默认 squashfs
|
||||
```
|
||||
**添加较多插件时,为了避免空间不足,建议修改下面两项默认大小(x86/64)**
|
||||
```
|
||||
Target Images --> (16) Kernel partition size (in MB) # 默认是16,建议修改为256
|
||||
```
|
||||
|
||||
**开启 IPv6 支持**
|
||||
```
|
||||
Extra packages --> ipv6helper(选定这个后,下面几项会自动选择)
|
||||
```
|
||||
**开启适用于 VMware 的 VMware Tools**
|
||||
```
|
||||
Utilities --> open-vm-tools
|
||||
|
||||
Utilities --> open-vm-tools-fuse
|
||||
```
|
||||
**选择插件**
|
||||
```
|
||||
LuCI --> Applications # 根据需要选择,* 代表编入固件,M 表示编译成模块或者IPK包,为空表示不编译
|
||||
```
|
||||
**选择主题**
|
||||
```
|
||||
LuCI --> Themes # 选择喜欢的主题,可以选多个
|
||||
```
|
||||
配置完成后使用编译菜单底部的 Save 保存,然后退出菜单 Exit,开始下载软件包
|
||||
|
||||
- **预下载编译所需的软件包**
|
||||
```
|
||||
@ -349,115 +381,76 @@ find dl -size -1024c -exec ls -l {} \;
|
||||
```
|
||||
find dl -size -1024c -exec rm -f {} \;
|
||||
```
|
||||
最后编译固件,编译完成后输出路径是 **bin/targets**,默认密码是 **password**.
|
||||
|
||||
- **编译固件(-j 后面是线程数,首次编译推荐用单线程)**
|
||||
- **最后编译固件(-j 后面是线程数,首次编译推荐用单线程)编译完成后输出路径是bin/targets.**
|
||||
```
|
||||
make V=s -j1
|
||||
|
||||
或者使用 make world -j1 V=s 2>&1 | tee world_debug.log
|
||||
|
||||
如果报错可查看 grep -E "(error|fatal|Cannot install package)" world_debug.log -n
|
||||
```
|
||||
- **二次编译**
|
||||
| make层级 | 目录示例 | 说明 |
|
||||
| -------- | ---------------------------- | ---------------- |
|
||||
| make\[1] | 顶层 Makefile | 解析依赖,调度模块 |
|
||||
| make\[2] | `tools/` | 编译辅助工具 |
|
||||
| make\[2] | `toolchain/` | 编译交叉编译工具链 |
|
||||
| make\[2] | `target/linux/` | 编译内核及设备树 |
|
||||
| make\[2] | `package/` | 进入包管理,调度包构建 |
|
||||
| make\[3] | `package/libs/libc` | 单个包的 Makefile |
|
||||
| make\[3] | `package/utils/busybox` | 单个包的 Makefile |
|
||||
| make\[4] | `build_dir/target-...` | 包源码目录,运行源码的 make |
|
||||
| make\[4] | `build_dir/target-linux-...` | 内核源码目录 |
|
||||
|
||||
拉取最新 OpenWrt 源码和更新 feeds 源中的软件包源码
|
||||
## 二次编译
|
||||
|
||||
| 命令 | 清除内容 | 保留内容 | 适用场景 |
|
||||
| ---------------- | ------------------------------------------------------------- | --------------------------------------- | ---------------------------------------------- |
|
||||
| `make clean` | 删除 `bin/` 镜像、`build_dir/` 编译产物 | `.config`、`staging_dir/`、`toolchain/` 等 | 小修改后重建镜像,速度快,常用于增量编译。|
|
||||
| `make dirclean` | 和 `make clean` 一样,还删除 `staging_dir/`、`toolchain/`、`logs` | `.config` | 彻底重建交叉编译环境,适合更改编译配置如 `.config`、feeds 等。 |
|
||||
| `make distclean` | 删除 `make dirclean` 的所有内容 + feeds 下载文件 + `.config`、patch 等所有状态 | 只有源码目录保持不变 | 专用于回到一个“零配置、重做一切”的状态,完全从头开始构建。 |
|
||||
|
||||
恢复所有修改(包括未跟踪文件):
|
||||
```
|
||||
cd lede
|
||||
|
||||
git pull
|
||||
|
||||
./scripts/feeds update -a
|
||||
|
||||
./scripts/feeds install -a
|
||||
```
|
||||
清除旧的编译产物和目录(可选)
|
||||
```
|
||||
make clean
|
||||
```
|
||||
- 源码有大规模更新或者内核更新后执行,以保证编译质量;此操作会删除 /bin 和 /build_dir 目录中的文件
|
||||
|
||||
|
||||
```
|
||||
make dirclean
|
||||
```
|
||||
> 更换架构编译前必须执行
|
||||
|
||||
> 此操作会删除 /bin 和 /build_dir 目录的中的文件(make clean),以及 /staging_dir、/toolchain、/tmp 和 /logs 中的文件
|
||||
|
||||
同首次编译,多线程编译失败后自动进入单线程编译,失败则输出详细日志
|
||||
```
|
||||
make defconfig
|
||||
|
||||
make download -j8
|
||||
|
||||
find dl -size -1024c -exec ls -l {} \;
|
||||
|
||||
make -j$(nproc) || make -j1 || make -j1 V=s
|
||||
```
|
||||
|
||||
|
||||
### 如果需要重新配置
|
||||
```
|
||||
rm -rf ./tmp && rm -rf .config # 清除临时文件和编译配置文件
|
||||
|
||||
make menuconfig
|
||||
|
||||
make download -j8
|
||||
|
||||
find dl -size -1024c -exec ls -l {} \;
|
||||
|
||||
make -j$(nproc) || make -j1 || make -j1 V=s
|
||||
git clean -fd
|
||||
git restore --source=v24.10.2 --staged --worktree .
|
||||
```
|
||||
|
||||
## Dwrt 方案
|
||||
|
||||
| 作用 | 组件 |
|
||||
| ----------- | -------------------- |
|
||||
| 主题 | argon |
|
||||
| Shell | bash |
|
||||
| SSH 服务器 | dropbear |
|
||||
| Web 服务器 | uhttpd |
|
||||
| DNS/DHCP 服务 | dnsmasq‑full |
|
||||
| 加密库 | openssl |
|
||||
| 压缩算法 | zram+zstd |
|
||||
| 拥塞控制 | bbr |
|
||||
| 防火墙 | nftables + iptables |
|
||||
| 调度模块 | BPF + kmod-sched-xxx |
|
||||
| 时间同步 | ntpd-full |
|
||||
| 文本编辑 | vim-full vim-runtime |
|
||||
| 编译优化 | LTO + O3 |
|
||||
|
||||
## Arm平台安装OpenWrt:
|
||||
|
||||
相比X86平台,arm架构的设备兼容性不高,不能随便找一个包就能安装。以下是一般步骤:
|
||||
|
||||
- 首先得知道你的设备的CPU,比如ipq40XX系列,然后在对应的[仓库](https://archive.openwrt.org/releases/23.05.4/targets/)查看并下载包体。
|
||||
|
||||
- 当然也可以在[这里](https://firmware-selector.openwrt.org/)直接下载相关型号对应的固件,其中 Sysupgrade 映像是用来更新现有运行 OpenWrt 的设备,使用 Factory 映像在首次刷机时刷入。
|
||||
|
||||
- 随后开启Telnet或者SSH或者TTL串口连接到路由器,将对应的Uboot刷入,如果没有适配的包就无法刷openwrt。
|
||||
|
||||
- 通过Uboot的网络界面刷入Factory包,随后就可以在后台(如192.168.1.1)进入openwrt的管理界面。
|
||||
|
||||
|
||||
|
||||
## 在ubuntu上单独编译openwrt的ipk包
|
||||
|
||||
这里以ubuntu环境为例,我们假设你有一台虚拟机或者WSL。
|
||||
|
||||
> ``注意编译不能使用Root用户!``
|
||||
|
||||
**随后安装编译依赖的各个包:**
|
||||
要启用的软件包:
|
||||
|
||||
**base**
|
||||
```
|
||||
sudo apt update
|
||||
sudo apt install -y \
|
||||
ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \
|
||||
bzip2 ccache clang cmake cpio curl device-tree-compiler diffutils diffstat findutils flex gawk \
|
||||
gcc-multilib g++-multilib git gettext gperf grep haveged help2man intltool \
|
||||
libelf-dev libfuse-dev libgmp3-dev libgl1-mesa-dev libgraphene-1.0-dev libglib2.0-dev \
|
||||
libltdl-dev libmpc-dev libmpfr-dev libncurses-dev libpython3-dev libreadline-dev libssl-dev \
|
||||
libtool lrzsz make mesa-common-dev msmtp ninja-build p7zip p7zip-full patch pkgconf \
|
||||
perl python-is-python3 python3 python3-dev python3-distutils-extra python3-pip python3-pyelftools \
|
||||
python3-setuptools qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs \
|
||||
upx-ucl unzip vim wget gnu-which xmlto xxd zlib1g-dev genisoimage llvm llvm-runtime docutils-common \
|
||||
ecj fastjar java-wrappers libeclipse-jdt-core-java libgnutls-dane0t64 \
|
||||
libgnutls-openssl27t64 libgnutls28-dev libidn2-dev libp11-kit-dev libtasn1-6-dev libtasn1-doc \
|
||||
libunbound8 libyaml-dev lld lld-18 nettle-dev python3-docutils python3-ply python3-roman re2c
|
||||
autocore base-files bash block-mount ca-bundle coremark curl dnsmasq-full dropbear ds-lite e2fsprogs fdisk firewall4 fstools grub2-bios-setup htop kmod-8139cp kmod-8139too kmod-amazon-ena kmod-amd-xgbe kmod-atlantic kmod-bnx2 kmod-bnx2x kmod-button-hotplug kmod-drm-amdgpu kmod-drm-i915 kmod-dwmac-intel kmod-e1000 kmod-e1000e kmod-forcedeth kmod-fs-f2fs kmod-fs-vfat kmod-i40e kmod-iavf kmod-igb kmod-igbvf kmod-igc kmod-ixgbe kmod-ixgbevf kmod-lib-zstd kmod-mlx4-core kmod-mlx5-core kmod-mmc kmod-pcnet32 kmod-phy-broadcom kmod-r8101 kmod-r8125 kmod-r8126 kmod-r8168 kmod-sdhci kmod-tcp-bbr kmod-tg3 kmod-tulip kmod-usb-hid kmod-vmxnet3 libc libgcc libustream-mbedtls lm-sensors-detect logd lsblk luci-app-fan luci-app-filemanager luci-app-firewall luci-app-log-viewer luci-app-package-manager luci-app-syscontrol luci-app-upnp luci-base luci-compat luci-lib-fs luci-lib-ipkg mkf2fs mtd nano netifd odhcp6c odhcpd-ipv6only openssh-sftp-server opkg partx-utils pciutils ppp ppp-mod-pppoe resolveip swconfig uci uclient-fetch urandom-seed urngd usbutils wget-ssl zram-swap
|
||||
```
|
||||
随后下载我们**刷入openwrt的对应的SDK包**,如
|
||||
**cli**
|
||||
```
|
||||
btop iperf3 tcpdump
|
||||
```
|
||||
**luci**
|
||||
```
|
||||
luci-app-argon luci-app-upnp luci-app-ttyd luci-app-eqosplus luci-app-timecontrol luci-app-parentcontrol luci-app-homeproxy luci-app-daed
|
||||
```
|
||||
## 单独编译openwrt的ipk包
|
||||
|
||||
```
|
||||
git clone https://github.com/immortalwrt/immortalwrt.git
|
||||
```
|
||||
|
||||
**下载和安装仓库信息**
|
||||
```
|
||||
./scripts/feeds update -a
|
||||
./scripts/feeds install -a
|
||||
```
|
||||
**下载并选中我们需要编译的包,这里以inyn为例:**
|
||||
**其他步骤同上,下载并选中我们需要编译的包,这里以inyn为例:**
|
||||
```
|
||||
git clone https://github.com/diredocks/openwrt-inyn.git ./package/inyn
|
||||
make menuconfig
|
||||
@ -471,30 +464,6 @@ make package/inyn/compile V=s
|
||||
## 如果不行则需要先编译工具链,即为 make j=4 ,j为CPU核数
|
||||
```
|
||||
|
||||
## Github Actions 编译OpenWrt
|
||||
|
||||
Github为我们提供了免费的E5主机用来编译。
|
||||
|
||||
- 首先Fork[这个仓库](https://github.com/hugcabbage/shared-lede),可以看到有许多现成的配置,在**顶栏actions里面可以直接启动一个Workflow**来编译。
|
||||
|
||||
- 大体架构是选择**源码 -- 机型 -- 版本 -- 插件/主题 -- 配置(IP/密码/Hostname/编译者)**,由一个config文件管理,这个文件在前面也提到过,可以在本地生成并上传;
|
||||
|
||||
- 想要什么插件可以直接git clone过来原仓库,如果你想要添加其他架构和设备,这里**使用templet里面的init.toml来创建**,按照类似的格式填好;
|
||||
|
||||
- 在actions里面运行produce,注意这需要**GitHub Personal Access Token (PAT)**;如果没有,必须先添加:
|
||||
|
||||
- 打开 GitHub,进入[GitHub Developer Settings](https://github.com/settings/tokens)点击 “Generate new token (classic)”,**勾选所需权限**(最关键的是 repo 和 workflow):✅ repo(所有子权限)✅ workflow✅ read:packages **Token 过期时间**:选择 “No expiration”(不过期),否则过期后需要重新生成。**点击** “Generate token”
|
||||
**复制 Token**(只显示一次,一定要保存好!)
|
||||
|
||||
- 然后添加 **PRODUCE_DEVICE** 到 **GitHub Secrets**,
|
||||
首先进入你的 GitHub 仓库,``依次进入:Settings(设置)-
|
||||
Secrets and variables-Actions-New repository secret
|
||||
名称为PRODUCE_DEVICE``,值为粘贴刚刚复制的 GitHub Token,点击 “Add secret” 完成添加。
|
||||
|
||||
- 随后``在actions里面运行produce``,完成后即可出现新架构的编译按钮.
|
||||
|
||||
|
||||
|
||||
## 常用命令:
|
||||
```
|
||||
# 更新软件列表
|
||||
@ -505,8 +474,19 @@ opkg list-upgradable | grep luci- | cut -f 1 -d ' ' | xargs opkg upgrade
|
||||
|
||||
# 如果要更新所有软件,包括 OpenWRT 内核、固件等
|
||||
opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade
|
||||
|
||||
# 固件版本号
|
||||
vim /etc/os-release
|
||||
|
||||
# 脚本&脚注
|
||||
vim /etc/openwrt_release
|
||||
|
||||
# ASCII字符画
|
||||
vim /etc/banner
|
||||
|
||||
# 登录脚本显示
|
||||
vim /etc/profile
|
||||
```
|
||||
> 新版本的openwrt(24.10)已经改用APK包管理器。
|
||||
|
||||
## 常用科学插件
|
||||
|
||||
@ -516,6 +496,7 @@ opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade
|
||||
| **UI 管理** | ✅(Web UI、桌面端 GUI) | ✅(OpenClash Web UI) | ✅(Luci Web UI) | ❌(Shell 终端管理) |
|
||||
| **适用场景** | 性能较好,但分流设置复杂 | 适用于clash系,机场首选 | 操作简单,分流完善,但对路由器性能要求较高 | 没有UI界面,性能最好,支持完善,可以通过clashapi安装UI |
|
||||
|
||||
|
||||
## 校园网多设备防检测
|
||||
|
||||
**常见检测方法**:
|
||||
|
@ -1,100 +0,0 @@
|
||||
+++
|
||||
title = "Linux之旅(1):构成与发行版"
|
||||
date = 2023-07-20
|
||||
|
||||
[taxonomies]
|
||||
tags = ["Linux"]
|
||||
+++
|
||||
|
||||
|
||||
|
||||
前言 Linux 作为一款强大、灵活且免费的操作系统,吸引了越来越多的用户。然而,对于初学者来说,Linux 可能显得有些陌生,甚至有些令人望而生畏。本文旨在为那些刚踏入 Linux 世界的新手提供一份指南,帮助他们更好地了解、使用这个令人着迷的操作系统。我们将探讨Linux的基本概念,解释为何选择Linux,深入剖析其主要构成要素以及不同的发行版之间的差异。
|
||||
<!-- more -->
|
||||
## 一.什么是Linux?
|
||||
|
||||
Linux 是一种开源的类 UNIX 操作系统内核。它由芬兰的 Linus Torvalds 于1991年开始开发,是一个自由、免费的操作系统。Linux 内核是操作系统的核心,负责管理硬件资源,并提供各种系统服务。与 Windows 和 macOS 等操作系统不同,Linux 的源代码对所有人开放,任何人都可以查看、修改和重新分发。这使得 Linux 具有极高的自由度和可定制性,用户可以根据自己的需求和偏好来定制操作系统。Linux 广泛应用于各种设备,包括个人计算机、服务器、手机、嵌入式系统等,是一个功能强大且灵活多样的操作系统。
|
||||
|
||||
|
||||
## 二.为什么要用Linux?
|
||||
|
||||
1. **开源免费**:Linux 是完全开源的,用户可以免费使用和修改源代码。
|
||||
|
||||
2. **稳定性和安全性**:Linux 系统以其稳定性和安全性而闻名,适合长时间运行的服务。
|
||||
|
||||
3. **灵活性和可定制性**:用户可以根据需要定制 Linux 系统。
|
||||
|
||||
4. **广泛的软件支持**:有大量的开源软件可供选择,满足不同需求。
|
||||
|
||||
> Liunx可以用来玩游戏吗?
|
||||
实际上著名的 Steam Deck 的系统就是基于Arch linux 的。对于个人使用而言,现在有不少原生支持linux 的游戏;也可以使用Wine来运行Windows下的游戏。
|
||||
|
||||
>Linux上软件会不会太少?
|
||||
参见 [常用跨平台开源软件](https://blog.dich.ink/open-source-software)一文,在社区的努力下如今软件生态已经非常丰富,你也可以使用如Flatpak等商店安装软件,或者直接使用Wine。如果有不得不在Windows下使用的软件,可以装双系统。
|
||||
## 三.Linux的主要构成
|
||||
|
||||
Linux操作系统主要由以下几个部分组成:
|
||||
|
||||
1. **内核**:操作系统的核心,负责管理系统资源。如Zen内核,LTS内核等。
|
||||
|
||||
2. **Shell**:命令行界面,用户通过它与系统交互,如Bash,Zsh等。
|
||||
|
||||
3. **图形用户界面(GUI)**:提供图形化操作界面,如GNOME、KDE、XFCE等。
|
||||
|
||||
4. **文件系统**:如ext4、Btrfs等,用于组织和管理磁盘上的文件。
|
||||
|
||||
5. **系统库**:为应用程序提供运行时支持。
|
||||
|
||||
6. **应用程序**:用户可以直接使用的软件,如文本编辑器、网页浏览器等。其中也有著名的GNU工具,如Vim,GCC等。
|
||||
|
||||
|
||||
## 四.选择Linux发行版
|
||||
|
||||
从上文可以发现,选择Linux发行版实际上是在选择 **内核/包管理器/图形界面** 等组件的排列组合。其中最主要的因素是包管理器。
|
||||
|
||||
Linux有许多不同的发行版,但大致可以分为几个系:
|
||||
|
||||
|
||||
**Debian系:**
|
||||
Debian:Debian以稳定性,安全性和轻量级著称,适合用于服务器和桌面环境。我们常说的Ubuntu就是基于Debian的发行版,注重用户友好性和易用性。它提供了多种桌面环境选择,以及许多现成的软件包。
|
||||
```
|
||||
APT(Advanced Package Tool)是Debian系发行版的主要包管理器。它使用命令行工具如apt-get、aptitude等来管理软件包。
|
||||
```
|
||||
**Red Hat系:**
|
||||
- Red Hat Enterprise Linux(RHEL):RHEL是一款商业发行版,专注于企业级应用和支持。它提供了长期支持和专业技术支持服务,适用于企业级服务器和工作站。
|
||||
- CentOS:CentOS是基于RHEL源代码编译而成的免费发行版,与RHEL兼容并提供类似的功能和性能。它也提供了长期支持版本和稳定性较高的特点。
|
||||
- Fedora:Fedora是由Red Hat支持的社区驱动的发行版,注重提供最新的软件特性和技术。它适用于开发者和技术爱好者,提供了稳定的发布周期和丰富的软件包。
|
||||
```
|
||||
YUM(Yellowdog Updater, Modified)是Red Hat系发行版的主要包管理器。最近的版本也开始采用DNF(Dandified YUM)。
|
||||
```
|
||||
**Arch系:**
|
||||
Arch Linux:Arch Linux是一个简洁、轻量级且灵活的发行版,注重简洁性和滚动更新。它采用“滚动发布”的方式,用户可以通过自定义安装来构建自己的系统,适合有一定Linux经验的用户。
|
||||
```
|
||||
Pacman(Package Manager)是Arch Linux的主要包管理器。它使用简洁的命令来管理软件包,如pacman -S安装软件包、pacman -Syu更新系统等。
|
||||
```
|
||||
**Gentoo系:**
|
||||
Gentoo:Gentoo是一个源码驱动的发行版,用户可以通过源代码自定义编译软件包以满足自己的需求。它注重性能和灵活性,适合高级用户和技术爱好者。
|
||||
```
|
||||
Portage是Gentoo的包管理器,它是一个源代码驱动的包管理器,允许用户从源代码构建和安装软件包。
|
||||
```
|
||||
除了以上列举的包管理器外,还有其他一些较为特殊的包管理器,如Slackware系的pkgtool、SUSE系的zypper等。
|
||||
|
||||
对于个人使用而言,我个人建议新手使用Ubuntu,有比较易用的界面和完善的资料参考;如果你是一个系统极客,可以使用Arch linux 或者 NixOS。
|
||||
|
||||
## 五.个人日常使用需要注意什么?
|
||||
|
||||
1. **学习命令行**:命令行是Linux的强大工具,学习基本命令可以提高效率。
|
||||
|
||||
2. **选择合适的发行版**:根据个人需求和技术水平选择适合的发行版。
|
||||
|
||||
3. **系统备份**:定期备份重要数据,以防意外丢失。
|
||||
|
||||
4. **软件管理**:了解如何安装、更新和卸载软件。
|
||||
|
||||
5. **安全设置**:设置强密码,定期更新系统以修复安全漏洞。
|
||||
|
||||
6. **社区参与**:Linux社区非常活跃,遇到问题可以寻求社区帮助。
|
||||
|
||||
7. **硬件兼容性**:检查你的硬件是否与选择的Linux发行版兼容。
|
||||
|
||||
8. **驱动程序**:确保你的硬件设备有可用的驱动程序,以避免兼容性问题。
|
||||
|
@ -1,127 +0,0 @@
|
||||
+++
|
||||
title = "Linux之旅(2):FHS与目录结构"
|
||||
date = 2023-07-21
|
||||
|
||||
[taxonomies]
|
||||
tags = ["Linux"]
|
||||
+++
|
||||
|
||||
前言 在Linux世界中,Filesystem Hierarchy Standard(FHS)是一座引导我们进入系统核心的桥梁,它定义了Linux系统中目录结构的规范与作用,为我们提供了一张清晰的地图,指引我们轻松管理和理解系统。本文将深入探讨FHS规范与Linux系统目录结构,解释各个目录的用途与功能,帮助我们更好地理解和利用Linux系统。
|
||||
<!-- more -->
|
||||
|
||||
## 一.认识FHS
|
||||
|
||||
FHS是Filesystem Hierarchy Standard(文件系统层次结构标准)的缩写。它是一个定义了Linux系统中目录结构和各个目录作用的规范。FHS规定了Linux系统中各个目录的用途和预期内容,以便确保不同Linux发行版之间的兼容性,并使得用户能够更轻松地理解和管理系统。
|
||||
|
||||
FHS规范最初由Linux基金会(Linux Foundation)和自由软件基金会(Free Software Foundation)共同发布,并经过多次修订和更新。该规范不仅对Linux系统本身有用,也适用于其他类UNIX操作系统。
|
||||
|
||||
FHS规范定义了一些基本的目录,如/bin、/boot、/dev等,并规定了每个目录的作用和预期内容。这样做有助于系统管理员和开发人员更好地组织和管理文件系统,并使得用户能够更轻松地找到所需的文件和数据。
|
||||
|
||||
## 二.常见目录结构
|
||||
|
||||
在刚刚由Windows切换至Linux时,往往会对目录感到不解,不知道安装的软件放在哪个目录之下?
|
||||
|
||||
以下是对Linux系统目录结构的详细说明:
|
||||
|
||||
- **/(根目录)**:
|
||||
根目录是整个文件系统的起点,包含了系统中所有其他目录和文件。在Linux系统中,根目录被表示为/。
|
||||
- **/bin(二进制文件)**:
|
||||
/bin目录存放着一些最基本的系统命令,如ls、cp、mv等,这些命令通常被所有用户使用。
|
||||
- **/boot(引导文件)**:
|
||||
/boot目录存放着启动Linux系统所需的引导文件,如内核映像(vmlinuz)、引导加载程序(boot loader)配置文件(如GRUB配置文件)等。
|
||||
- **/dev(设备文件)**:
|
||||
/dev目录包含了系统中所有设备的特殊文件,如硬盘、键盘、鼠标等。在Linux中,一切皆文件,设备被抽象为文件,通过/dev目录中的特殊文件来表示。
|
||||
- **/etc(配置文件)**:
|
||||
/etc目录包含了系统的配置文件,如网络配置、用户账户信息、服务配置等。这些配置文件通常以纯文本的形式存在,可以由系统管理员进行编辑和修改。
|
||||
- **/home(用户主目录)**:
|
||||
/home目录是系统中所有普通用户的主目录所在地,每个用户通常都有一个对应的子目录,用于存放用户的个人文件和数据。
|
||||
- **/lib(库文件)**:
|
||||
/lib目录存放着系统所需的共享库文件,这些库文件包含了一些程序运行所需的函数和数据,为程序提供了基本的支持。
|
||||
- **/mnt(挂载点)**:
|
||||
/mnt目录用于挂载临时文件系统,如光盘、移动硬盘等。系统管理员可以将其他设备或文件系统挂载到/mnt目录下,以便访问其中的文件和数据。
|
||||
- **/opt(可选软件包)**:
|
||||
/opt目录用于存放一些可选的软件包和应用程序,这些软件包通常不属于Linux发行版的默认安装范围,但可以被用户自行安装和管理。
|
||||
- **/proc(进程信息)**:
|
||||
/proc目录是一个虚拟的文件系统,包含了系统运行时的各种进程信息和系统状态信息。用户可以通过读取/proc目录中的特殊文件来获取系统信息。
|
||||
- **/sbin(系统命令)**:
|
||||
/sbin目录存放着一些系统管理和维护命令,这些命令通常只能由超级用户(root)执行,用于系统的管理和维护。
|
||||
- **/srv(服务数据)**:
|
||||
/srv目录用于存放一些服务相关的数据文件,如Web服务器的网站数据、FTP服务器的文件等。每个服务通常都会有一个对应的子目录。
|
||||
- **/tmp(临时文件)**:
|
||||
/tmp目录用于存放临时文件和临时数据,这些文件通常在系统重启时会被删除。任何用户都可以在/tmp目录下创建临时文件。
|
||||
- **/usr(用户程序)**:
|
||||
/usr目录包含了系统中大部分用户可用的程序和文件,如用户应用程序、共享库文件、文档等。它通常是系统的二级目录,类似于Windows系统中的Program Files目录。
|
||||
- **/var(可变数据)**:
|
||||
/var目录用于存放系统运行时产生的可变数据,如日志文件、邮件、缓存文件等。这些数据通常会随着系统的运行而不断变化。
|
||||
|
||||
> 注意:NixOS不符合FHS标准!
|
||||
|
||||
## 三.分区大小
|
||||
|
||||
对各个分区进行容量分配时,需要根据系统的实际需求和用途来进行规划。一般而言在安装引导时可以选择让程序自动分区。
|
||||
|
||||
- **根目录(/)**:根目录是整个文件系统的起点,通常会分配较大的空间,以确保系统和应用程序有足够的空间运行。建议分配至少20GB的空间给根目录。
|
||||
- **/home目录**:/home目录用于存放用户的个人文件和数据,因此需要根据用户数量和存储需求来进行容量分配。一般情况下,建议为每个用户分配至少10GB的空间。
|
||||
- **/var目录**:/var目录用于存放系统运行时产生的可变数据,如日志文件、邮件、缓存文件等。根据系统的运行情况和日志文件的大小来进行容量分配,一般建议分配10-20GB的空间。
|
||||
- **/tmp目录**:/tmp目录用于存放临时文件和临时数据,通常不需要分配太大的空间。建议分配至少1-2GB的空间给/tmp目录。
|
||||
- **/boot目录**:/boot目录存放着启动Linux系统所需的引导文件,通常只需要分配几百MB的空间即可。
|
||||
- **Swap分区**:Swap分区是一种虚拟内存,用于暂时存放不常用的内存数据。当系统内存不足时,Linux会将一部分内存数据移动到Swap分区中,以避免内存耗尽导致系统崩溃。Swap分区的大小通常与系统内存大小有关,一般建议为系统内存的1.5-2倍。例如,如果系统内存为4GB,则建议设置Swap分区大小为6-8GB。
|
||||
|
||||
> 这里特别讲讲Swap分区
|
||||
|
||||
Swap分区可以通过以下几种方式实现:
|
||||
|
||||
- 交换分区(Swap Partition):创建一个独立的交换分区,通常是一个专门的分区,用于存放Swap数据。
|
||||
- 交换文件(Swap File):创建一个专门的文件用于存放Swap数据,而不是创建独立的分区。这种方式更加灵活,可以根据需要动态调整Swap的大小。
|
||||
- Swap大小:Swap的大小应该根据系统的内存大小和使用情况来确定,一般建议为系统内存的1.5-2倍。
|
||||
- Swap分区/文件的位置:Swap分区/文件应该位于较快的存储介质上,以确保交换操作的效率。
|
||||
Swap的优先级:如果同时存在多个Swap分区/文件,可以通过设置优先级来指定系统使用的Swap空间。
|
||||
|
||||
## 四.将 `home` 目录下的文件夹改为英文
|
||||
|
||||
可以使用 `xdg-user-dirs-update` 工具来更新用户目录为英文版本。你可以按照以下步骤进行:
|
||||
|
||||
1. **编辑用户目录配置文件**:
|
||||
打开或创建 `~/.config/user-dirs.dirs` 文件,用文本编辑器编辑它:
|
||||
```bash
|
||||
nano ~/.config/user-dirs.dirs
|
||||
```
|
||||
|
||||
2. **将目录名称更改为英文**:
|
||||
在该文件中,你可以看到类似以下的条目:
|
||||
```bash
|
||||
XDG_DESKTOP_DIR="$HOME/桌面"
|
||||
XDG_DOWNLOAD_DIR="$HOME/下载"
|
||||
XDG_DOCUMENTS_DIR="$HOME/文档"
|
||||
XDG_MUSIC_DIR="$HOME/音乐"
|
||||
XDG_PICTURES_DIR="$HOME/图片"
|
||||
XDG_VIDEOS_DIR="$HOME/视频"
|
||||
```
|
||||
将这些路径改为英文,例如:
|
||||
```bash
|
||||
XDG_DESKTOP_DIR="$HOME/Desktop"
|
||||
XDG_DOWNLOAD_DIR="$HOME/Downloads"
|
||||
XDG_DOCUMENTS_DIR="$HOME/Documents"
|
||||
XDG_MUSIC_DIR="$HOME/Music"
|
||||
XDG_PICTURES_DIR="$HOME/Pictures"
|
||||
XDG_VIDEOS_DIR="$HOME/Videos"
|
||||
```
|
||||
|
||||
3. **重命名现有的文件夹**:
|
||||
手动将 `home` 目录下的文件夹重命名为英文版本:
|
||||
```bash
|
||||
mv ~/桌面 ~/Desktop
|
||||
mv ~/下载 ~/Downloads
|
||||
mv ~/文档 ~/Documents
|
||||
mv ~/音乐 ~/Music
|
||||
mv ~/图片 ~/Pictures
|
||||
mv ~/视频 ~/Videos
|
||||
```
|
||||
|
||||
4. **应用更改**:
|
||||
完成以上操作后,运行以下命令应用新配置:
|
||||
```bash
|
||||
xdg-user-dirs-update
|
||||
```
|
||||
|
||||
这样,`home` 目录下的文件夹就会改为英文,并且系统也会正确识别这些新的目录路径。
|
@ -1,176 +0,0 @@
|
||||
+++
|
||||
title = "Linux之旅(3):内核/shell/包管理/文件系统/桌面环境"
|
||||
date = 2023-07-22
|
||||
|
||||
[taxonomies]
|
||||
tags = ["Linux"]
|
||||
+++
|
||||
|
||||
前言 在Linux世界中,内核/shell/包管理/文件系统构成了Linux系统的核心,它们相互配合,共同构建了一个强大而稳定的操作环境。本文将深入探讨这些关键组成部分,解释它们的作用和原理,帮助读者更好地理解Linux系统的运作机制。
|
||||
<!-- more -->
|
||||
|
||||
## **一.Linux内核**
|
||||
|
||||
有许多不同的版本,每个版本都包含了一系列的功能改进、bug修复和性能优化。在Linux发行版中,通常会使用某个特定版本的Linux内核,或者在需要时进行升级。以下是一些常见的Linux内核及其主要特点:
|
||||
|
||||
**Zen内核**:
|
||||
- Zen内核是Linux内核的一个变体,旨在提供更好的性能和响应性。它通常包含了一些特定的调度程序和调优参数,以提高系统的负载均衡和响应速度。Zen内核也可能包含一些来自其他内核变体的功能和补丁,以进一步优化性能。
|
||||
|
||||
**LTS内核**:
|
||||
- LTS(Long-Term Support)内核是一种长期支持的内核版本,它会获得更长时间的更新和维护。LTS内核通常会选择一些相对稳定和经过充分测试的功能,并对其进行长期支持,以确保系统的稳定性和安全性。
|
||||
|
||||
**Real-Time内核**:
|
||||
- Real-Time内核是一种专门针对实时应用场景进行优化的内核变体。它通常包含了一些实时调度算法和机制,以确保系统能够及时响应各种事件,并满足实时性要求。Real-Time内核适用于一些对实时性要求较高的应用,如工业控制、机器人控制等领域。
|
||||
|
||||
**Hardened内核**:
|
||||
- Hardened内核是一种针对安全性进行优化的内核变体。它通常包含了一些安全增强功能和补丁,以提高系统的安全性和抵御攻击的能力。Hardened内核适用于一些对安全性要求较高的应用,如服务器、云计算等场景。
|
||||
|
||||
**XanMod内核**:
|
||||
- XanMod内核是一个基于Linux内核的自定义内核,旨在提供更好的响应性和性能。它包含了一些针对桌面和工作站系统优化的功能和补丁,如MuQSS调度器、BFQ I/O调度器等,以提高系统的响应速度和性能稳定性。XanMod内核还支持一些实时性应用,如音视频处理等,适用于对系统响应速度要求较高的用户。
|
||||
|
||||
**CachyOS内核**:
|
||||
- CachyOS内核是一个专门针对缓存优化的Linux内核变体。它包含了一些针对缓存系统优化的功能和调整,以提高系统的缓存性能和数据访问速度。CachyOS内核通常适用于需要高性能缓存的应用场景,如数据库服务器、Web服务器等。
|
||||
|
||||
这些内核变体针对不同的需求和使用场景进行了优化,可以根据具体的应用需求来选择合适的内核版本。例如,如果您需要更好的性能和响应性,可以选择Zen内核;如果您需要长期支持和稳定性,可以选择LTS内核;如果您需要实时性能,可以选择Real-Time内核;如果您需要更高的安全性,可以选择Hardened内核。
|
||||
|
||||
## **二.Linux Shell**
|
||||
|
||||
在Linux系统中,有许多不同的Shell(命令行解释器),每种Shell都有自己的特点和用途。以下是一些常见的Linux Shell及其主要特点:
|
||||
|
||||
**Bash(Bourne Again Shell)**:
|
||||
- Bash是Linux系统中最常用的Shell之一,也是默认的命令行解释器。它是Bourne Shell的增强版,提供了丰富的功能和扩展性,包括命令历史、命令补全、作业控制等。Bash具有良好的兼容性和易用性,适用于日常的系统管理和脚本编程。
|
||||
|
||||
**Zsh(Z Shell)**:
|
||||
- Zsh是一种功能强大的Shell,提供了丰富的功能和扩展性,如更强大的命令补全、自动纠正拼写错误、主题和插件系统等。Zsh具有良好的可定制性和用户体验,适用于高级用户和程序员。
|
||||
|
||||
**Fish(Friendly Interactive Shell)**:
|
||||
- Fish是一种用户友好的交互式Shell,提供了直观的命令提示和自动补全功能,以及丰富的语法高亮和命令提示信息。Fish具有良好的用户体验和易用性,适用于初学者和普通用户。
|
||||
|
||||
**Dash(Debian Almquist Shell)**:
|
||||
- Dash是一种轻量级的Shell,专门设计用于系统启动过程和脚本执行。Dash具有较高的执行速度和较低的内存占用,适用于系统启动脚本和简单的脚本编程。
|
||||
|
||||
Bash是最常用的Shell之一,具有良好的兼容性和功能性;Zsh提供了更多的高级特性和定制选项,适用于高级用户和程序员;Fish具有友好的交互式体验和直观的用户界面,适用于初学者和普通用户;Dash则是一个轻量级的Shell,专门用于系统启动过程和简单的脚本编程。用户可以根据自己的需求和偏好选择合适的Shell。
|
||||
|
||||
|
||||
## **三.Linux包管理器**
|
||||
|
||||
在Linux系统中,有几种常见的包管理器,它们各自管理着不同的发行版,具有不同的特点和用途。以下是一些常见的Linux包管理器及其主要特点:
|
||||
|
||||
**APT(Advanced Package Tool)**:
|
||||
- APT是Debian系(如Debian、Ubuntu)中最常用的包管理器之一。它使用基于命令行的工具,如`apt-get`、`apt-cache`等来安装、升级和删除软件包。APT还支持依赖关系的自动解决,使得软件包的安装和管理变得更加方便。
|
||||
|
||||
**YUM(Yellowdog Updater, Modified)**:
|
||||
- YUM是Red Hat系(如CentOS、Fedora)中常用的包管理器之一。它使用基于命令行的工具,如`yum`来管理软件包。YUM具有良好的依赖关系解决能力和事务处理功能,使得系统升级和软件包管理变得更加简单和可靠。
|
||||
|
||||
**DNF(Dandified YUM)**:
|
||||
- DNF是YUM的下一代版本,逐渐取代了YUM在Fedora和RHEL系列中的地位。DNF具有更快的包查询和事务处理能力,以及更友好的用户界面。它是未来主流的包管理器之一。
|
||||
|
||||
**Pacman(Package Manager)**:
|
||||
- Pacman是Arch Linux中常用的包管理器,也被一些其他发行版如Manjaro采用。Pacman使用简洁的命令,如`pacman -S`安装软件包、`pacman -Syu`更新系统等来管理软件包。Pacman具有简单、直观的界面和快速的操作速度,适用于对系统有一定了解的用户。
|
||||
|
||||
**zypper**:
|
||||
- zypper是openSUSE中常用的包管理器,它使用基于命令行的工具,如`zypper install`、`zypper update`等来管理软件包。zypper具有良好的依赖关系解决能力和事务处理功能,使得系统升级和软件包管理变得更加简单和可靠。
|
||||
|
||||
**dpkg**:
|
||||
- dpkg是Debian系(如Debian、Ubuntu)中的低级别软件包管理工具,用于直接管理软件包的安装、升级和删除。它提供了一系列的命令,如`dpkg -i`安装软件包、`dpkg -r`删除软件包等。
|
||||
|
||||
**RPM(RPM Package Manager)**:
|
||||
- RPM是Red Hat系(如CentOS、Fedora)中的低级别软件包管理工具,用于直接管理软件包的安装、升级和删除。它提供了一系列的命令,如`rpm -i`安装软件包、`rpm -e`删除软件包等。
|
||||
|
||||
**Portage**:
|
||||
- Portage是Gentoo Linux中的包管理器,它使用源代码进行软件包的安装和管理。Portage具有高度定制化和灵活性,允许用户根据需要自定义软件包的编译参数和依赖关系。
|
||||
|
||||
**Snap**:
|
||||
- Snap是一种跨发行版的软件包格式和包管理器,允许用户在不同的Linux发行版上安装和管理软件包。Snap具有自包含性和隔离性,使得软件包的安装和升级变得更加简单和安全。
|
||||
|
||||
**Flatpak**:
|
||||
- Flatpak是另一种跨发行版的软件包格式和包管理器,类似于Snap,允许用户在不同的Linux发行版上安装和管理软件包。Flatpak提供了一种统一的应用分发和运行环境,使得软件包的安装和升级更加简单和可靠。
|
||||
|
||||
|
||||
|
||||
## **四.Linux文件系统**
|
||||
|
||||
Linux系统支持多种文件系统,每种文件系统都有自己的特点和优势,适用于不同的应用场景和需求。以下是一些常见的Linux文件系统及其主要特点:
|
||||
|
||||
**ext4**:
|
||||
- ext4是Linux系统中最常用的文件系统之一,它是ext文件系统的后续版本,提供了更好的性能和扩展性。ext4支持更大的文件和分区大小,更快的文件系统检查和恢复速度,以及更高的性能和稳定性。
|
||||
|
||||
**Btrfs**:
|
||||
- Btrfs是一种先进的文件系统,具有许多先进的功能和特性,如快照、数据校验、数据压缩等。Btrfs支持在线扩展和收缩分区大小,以及动态添加和删除磁盘,适用于需要高级特性和灵活性的应用场景。此外,Btrfs对快照功能支持较好。
|
||||
|
||||
> 快照功能是一种文件系统的特性,它允许用户在特定时间点对文件系统的状态进行快照或备份,并且可以在需要时一键恢复到该时间点的状态。
|
||||
快照允许用户轻松地创建文件系统的历史版本,并在需要时回滚到特定的版本;快照允许用户在文件系统中进行实验和测试,并在测试失败或不需要时轻松地回滚到初始状态,以避免对系统造成影响。在升级或安装过程中出现问题时快速恢复到原始状态
|
||||
|
||||
|
||||
|
||||
**XFS**:
|
||||
- XFS是一种高性能的日志文件系统,适用于大型文件和高吞吐量的应用场景。XFS支持大容量的文件和分区,具有较低的碎片化和较高的并发性能,适用于大规模存储和数据分析等应用。
|
||||
|
||||
**ZFS**:
|
||||
- ZFS是一种先进的文件系统,具有强大的数据管理和保护功能,如快照、数据校验、数据压缩等。ZFS支持软件RAID和存储池(pool),以及动态添加和删除磁盘,适用于数据中心和大规模存储等应用场景。
|
||||
|
||||
**F2FS**:
|
||||
- F2FS是一种针对闪存存储设备进行优化的文件系统,具有高性能和高可靠性。F2FS支持闪存特性如块擦除计数(block erase count)和块生命周期管理(block lifetime management),适用于固态硬盘(SSD)和闪存卡等闪存设备。
|
||||
|
||||
## **五.Linux桌面环境**
|
||||
|
||||
Linux系统有多种不同的桌面环境,每种环境都有其独特的特点、风格和用户体验。以下是一些常见的Linux桌面环境及其主要特点:
|
||||
|
||||
**GNOME**:
|
||||
- GNOME是一个功能强大、现代化的桌面环境,具有直观的用户界面和丰富的功能。它采用了扁平化的设计风格和简洁的用户界面,提供了丰富的应用程序和插件,适用于普通用户和开发人员。
|
||||
|
||||
**KDE Plasma**:
|
||||
- KDE Plasma是一个灵活、可定制的桌面环境,提供了丰富的特性和选项,如桌面特效、窗口管理器、小部件等。它采用了现代化的设计风格和强大的桌面管理功能,适用于高级用户和技术爱好者。
|
||||
|
||||
**XFCE**:
|
||||
- XFCE是一个轻量级、快速的桌面环境,具有简洁的用户界面和低资源消耗。它采用了传统的桌面布局和简约的设计风格,提供了基本的桌面管理功能和应用程序,适用于老旧计算机和资源有限的环境。
|
||||
|
||||
**LXQt**:
|
||||
- LXQt是一个轻量级、快速的桌面环境,是LXDE和Razor-qt的合并项目。它采用了现代化的设计风格和简洁的用户界面,提供了丰富的特性和可定制选项,适用于资源有限的环境和嵌入式系统。
|
||||
|
||||
**Cinnamon**:
|
||||
- Cinnamon是一个基于GNOME的桌面环境,具有类似于传统Windows桌面的用户界面和功能。它采用了传统的桌面布局和直观的用户体验,提供了丰富的特性和可定制选项,适用于对传统桌面风格有需求的用户。
|
||||
|
||||
GNOME和KDE Plasma提供了丰富的特性和高度定制化选项,适用于高级用户和开发人员;XFCE和LXQt则提供了轻量级和快速的用户体验,适用于资源有限的环境;Cinnamon则提供了类似于传统Windows桌面的用户界面和功能,适用于对传统桌面风格有需求的用户。可以根据自己的需求和偏好选择合适的桌面环境。
|
||||
|
||||
> 当然,也可以使用轻量级的窗口管理器。
|
||||
窗口管理器是Linux系统中控制窗口布局、管理窗口行为的关键组件。它们决定了窗口的外观和行为方式,以及如何管理和排列窗口。以下是一些常见的窗口管理器及其主要特点:
|
||||
|
||||
**X Window Manager (XWM)**:
|
||||
- X Window Manager是最基本的窗口管理器,用于管理X Window系统中的窗口。它提供了最基本的窗口布局和管理功能,如窗口移动、调整大小、最小化等。XWM本身并不提供任何外观效果,但可以与其他工具配合使用来实现更丰富的窗口管理和外观特性。
|
||||
|
||||
**Openbox**:
|
||||
- Openbox是一个轻量级的窗口管理器,具有简洁的用户界面和低资源消耗。它提供了丰富的自定义选项和扩展功能,如虚拟桌面、窗口装饰、键盘快捷键等。Openbox适用于资源有限的环境和对简洁风格有需求的用户。
|
||||
|
||||
**i3**:
|
||||
- i3是一个动态平铺窗口管理器,采用了平铺式布局,将窗口按照一定规则自动排列在屏幕上。它提供了快速的窗口切换和管理功能,支持键盘操作和自动布局调整,适用于需要高效多任务处理的用户。
|
||||
|
||||
**Awesome**:
|
||||
- Awesome是一个高度可定制的动态平铺窗口管理器,具有丰富的特性和扩展功能。它采用Lua脚本语言进行配置和定制,支持强大的自定义选项和扩展功能,适用于高级用户和技术爱好者。
|
||||
|
||||
**KWin**:
|
||||
- KWin是KDE桌面环境中的默认窗口管理器,具有丰富的特性和功能。它提供了多种窗口布局和管理选项,支持虚拟桌面、窗口效果、窗口组织等功能,适用于需要丰富特性和高度定制化的用户。
|
||||
|
||||
这些窗口管理器之间的主要异同在于窗口布局、外观效果、自定义选项和功能特性等方面。Openbox和i3提供了简洁的用户界面和低资源消耗,适用于资源有限的环境;Awesome和KWin则提供了丰富的特性和扩展功能,适用于高级用户和技术爱好者。用户可以根据自己的需求和偏好选择合适的窗口管理器。
|
||||
|
||||
> Wayland和X11
|
||||
Wayland和X11都是用于Linux系统的图形显示协议,它们负责管理图形用户界面(GUI)的显示和交互。下面是它们的简要介绍以及异同点:
|
||||
|
||||
- **X11(X Window System)**:
|
||||
X11是一个由MIT开发的图形显示协议,长期以来一直是Linux系统中最常用的图形显示系统。它采用客户端-服务器模型,图形应用程序(客户端)通过X服务器与显示设备(服务器)进行通信。X11提供了丰富的图形特性和功能,如窗口管理、窗口装饰、多任务处理等。
|
||||
|
||||
- **Wayland**:
|
||||
Wayland是一个由Red Hat主导开发的新一代图形显示协议,旨在取代X11成为Linux系统的标准图形显示系统。Wayland采用了现代化的设计理念和架构,取消了X11中复杂的客户端-服务器模型,将图形显示功能直接集成到操作系统中。Wayland具有更低的延迟和更高的性能,支持更好的硬件加速和多触摸设备,以及更简洁的代码结构。
|
||||
|
||||
**异同点**:
|
||||
- **架构差异**:X11采用了客户端-服务器模型,图形应用程序通过X服务器与显示设备进行通信;而Wayland取消了这种模型,将图形显示功能直接集成到操作系统中,减少了中间层的复杂性。
|
||||
- **性能差异**:Wayland具有更低的延迟和更高的性能,支持更好的硬件加速和多触摸设备,使得图形显示更加流畅和响应。
|
||||
- **功能差异**:X11提供了丰富的图形特性和功能,如窗口管理、窗口装饰、多任务处理等;Wayland在功能上相对较少,但提供了更简洁的代码结构和更好的性能。
|
||||
- **兼容性差异**:X11在Linux系统中被广泛使用,拥有大量的应用程序和工具的支持;而Wayland在兼容性方面仍在发展中,尚未完全取代X11成为Linux系统的标准图形显示系统。
|
||||
|
||||
总的来说,Wayland是未来Linux系统中的趋势,具有更好的性能和更简洁的架构,但在兼容性和功能丰富度上仍有待改进。X11则是当前仍然广泛使用的图形显示系统,拥有丰富的生态和大量的应用程序支持。
|
||||
|
||||
|
||||
## **六.后记**
|
||||
|
||||
个人使用推荐Zen+Zsh+Pacman+Btrfs+Hyprland,并使用 paru xxx 来搜索软件包,使用paru -S xxx 安装软件。
|
@ -1,82 +0,0 @@
|
||||
+++
|
||||
title = "Linux之旅(4):Terminal,Console and Shell"
|
||||
date = 2023-07-23
|
||||
|
||||
[taxonomies]
|
||||
tags = ["Linux"]
|
||||
+++
|
||||
|
||||
|
||||
前言 在linux的学习过程中,我们常常遇到诸如 Terminal,Console,bash,zsh,shell,tty 等概念,这些概念常常被混淆,似乎都和命令行相关。本文从历史角度出发介绍它们的前世今生。
|
||||
<!-- more -->
|
||||
|
||||
|
||||
## 终端和控制台
|
||||
|
||||
终端,英文叫做 terminal ,通常简称为 term;控制台,英文叫做 console。
|
||||
|
||||
要明白这两者的关系,还得从最初的计算机说起。当时的计算机价格昂贵,一台计算机一般是由多个人同时使用的。在这种情况下一台计算机需要连接上许多套键盘和显示器来供多个人使用。在以前专门有这种可以连上一台电脑的设备,只有显示器和键盘,还有简单的处理电路,本身不具有处理计算机信息的能力,他是负责连接到一台正常的计算机上(通常是通过串口) ,然后登陆计算机,并对该计算机进行操作。当然,那时候的计算机操作系统都是多任务多用户的操作系统。这样一台只有显示器和键盘能够通过串口连接到计算机的设备就叫做终端。
|
||||
|
||||
|
||||
|
||||
|
||||
而控制台又是什么回事呢?其概念来自于管风琴的控制台。顾名思义,控制台就是一个直接控制设备的台面(一个面板,上面有很多控制按钮)。 在计算机里,把那套直接连接在电脑上的键盘和显示器就叫做控制台。
|
||||
|
||||
|
||||
|
||||
|
||||
终端是通过串口连接上的,不是计算机本身就有的设备,而控制台是计算机本身就有的设备,一个计算机只有一个控制台。计算机启动的时候,所有的信息都会显示到控制台上,而不会显示到终端上。也就是说,控制台是计算机的基本设备,而终端是附加设备。 当然,由于控制台也有终端一样的功能,控制台有时候也被模糊的统称为终端。
|
||||
|
||||
|
||||
|
||||
|
||||
以上是控制台和终端的历史遗留区别。现在由于计算机硬件越来越便宜,终端和控制台的概念也慢慢演化了。终端和控制台由硬件的概念,演化成了软件的概念。
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## 内核与外壳
|
||||
|
||||
内核( Kernel )和外壳( Shell )是 linux 的两个主要部分。Kernel 是操作系统的核心,系统的文件管理、进程管理、内存管理、设备管理这些功能,都是由 Kernel 提供的。
|
||||
|
||||
|
||||
|
||||
|
||||
用户和操作系统内核交流需要一个工具,那么这个工具就是 Shell。
|
||||
|
||||
|
||||
|
||||
|
||||
什么是 Shell?在 Linux 中,最常见的 Shell 形式有命令行界面命令行界面和图形界面两种。并不是打开的那个终端窗口就是 Shell,如Alacritty、Gnome-Terminal、xterm 、kitty等程序,它们不是 Shell,而它们里面运行的 Bash、Zsh、fish 等命令行解释器程序,才是 Shell。
|
||||
|
||||
|
||||
|
||||
|
||||
那 Alacritty、Gnome-Terminal、xtermxterm 是什么?
|
||||
|
||||
|
||||
|
||||
|
||||
它们是终端模拟器。
|
||||
|
||||
前面提到过,在远古时代,终端和控制台都是有实体的。控制台直接和计算机在一起,你可以通过控制台控制计算机。终端通过数据线和计算机连接,终端也提供一个键盘和一个屏幕,你可以通过键盘向计算机下达指令,然后通过屏幕观察输出。
|
||||
|
||||
|
||||
|
||||
|
||||
但是现在的计算机组成和以前不一样了,一般一台电脑都是自带键盘和屏幕,很少再外接终端设备。
|
||||
|
||||
所以 Linux 提供了另外一个更高级的功能,那就是虚拟终端。那就是在一台电脑上,通过软件的模拟,好像有好几个终端连接在这台计算机上一样。
|
||||
|
||||
|
||||
|
||||
|
||||
现在说的终端,比如 linux 中的虚拟终端,都是软件的概念。虚拟终端称之为 tty,tty 是电传打字机电传打字机 Teletypewriter 的缩写,在带显示屏的视频终端出现之前,tty是最流行的终端设备。每一个 tty 都有一个编号,在/dev目录下有相应的设备文件。其中/dev/tty1到/dev/tty7可以通过 Ctrl+Alt+F1 到 Ctrl+Alt+F7 进行切换,也可以通过 chvt 命令进行切换,就好比是以前多人公用的计算机中的六个终端设备,这就是为什么这个叫“虚拟终端”的原因。
|
||||
|
||||
|
||||
|
||||
|
||||
## 时代变迁
|
||||
|
||||
随着时间的推移,我们看到了从硬件到软件的转变,以及从多用户共享到个人使用的转变。这种变迁不仅影响了终端和控制台的概念,也塑造了我们对计算机的理解和期待。
|
@ -1,130 +0,0 @@
|
||||
+++
|
||||
title = "Linux之旅(5):BIOS-UEFI-MBR-GPT-GRUB"
|
||||
date = 2023-07-24
|
||||
|
||||
[taxonomies]
|
||||
tags = ["Linux"]
|
||||
+++
|
||||
|
||||
|
||||
前言 在计算机领域,系统引导和磁盘分区是至关重要的。本文将介绍BIOS与UEFI,MBR与GPT,以及它们之间的异同点。此外,我们还会讨论与这些概念密切相关的引导加载程序——GRUB。
|
||||
<!-- more -->
|
||||
## BIOS
|
||||
|
||||
> `BIOS(Basic Input Output System)`,直译成中文名称就是"`基本输入输出系统`"。它是一组固化到主板中一个ROM芯片上的程序,它可以从CMOS中读写系统设置的具体信息。此程序保存着计算机最重要的基本输入输出程序、开机后的自检程序和系统自启动程序。简单来说,BIOS只认识设备,不认识分区、不认识文件。
|
||||
|
||||
## UEFI
|
||||
|
||||
> UEFI(统一可扩展固件接口)是一个公开的规范,定义了操作系统和平台固件之间的软件接口。UEFI 是传统 PC BIOS 的继承者,是取代传统BIOS的,相比传统BIOS来说,它更易实现,容错和纠错特性也更强。 它将引导数据存储在 .efi 文件中,而不是固件中。你经常会在新款的主板中找到 UEFI 启动模式。UEFI 启动模式包含一个特殊的 EFI 分区,用于存储 .efi 文件并用于引导过程和引导加载程序。
|
||||
|
||||
> UEFI使用GPT的分区引导方案,支持更大的硬盘。由于省去了BIOS自检的过程,所以启动速度更快。传统BIOS主要支持MBR引导,UEFI则是取代传统BIOS,它加入了对新硬件的支持,其中就有支持2TB以上硬盘。
|
||||
|
||||
## MBR
|
||||
|
||||
> 全新硬盘在使用之前必须进行分区格式化,硬盘分区初始化的格式主要有两种,分别为`MBR`格式和`GPT`格式。MBR是传统的分区表类型,当一台电脑启动时,它会先启动主板上的BIOS系统,BIOS再从硬盘上读取MBR主引导记录,硬盘上的MBR运行后,就会启动操作系统,但最大的缺点则是不支持容量大于2T的硬盘。
|
||||
|
||||
## GPT
|
||||
|
||||
> 而GPT是另一种更先进的磁盘系统分区方式,它的出现弥补了MBR这个缺点,最大支持`18EB`的硬盘,是基于`UEFI`使用的磁盘分区架构。目前所有Windows系统均支持`MBR`,而`GPT`只有`64`位系统才能支持。`BIOS只支持MBR引导系统,而GPT仅可用UEFI引导系统`。正因为这样,现在主板大多采用BIOS集成UEFI,或UEFI集成BIOS,以此达到同时兼容MBR和GPT引导系统的目的。
|
||||
|
||||
## GRUB
|
||||
|
||||
> GRUB(GRand unified bootloader),多操作系统启动程序。它允许用户可以在计算机内同时拥有多个操作系统,并在计算机启动时选择希望运行的操作系统。
|
||||
>
|
||||
> GRUB可用于选择操作系统分区上的不同内核,也可用于向这些内核传递启动参数。`它是一个多重操作系统启动管理器,用来引导不同系统`,如Windows、Linux。Linux常见的引导程序包括LILO、GRUB、GRUB2。
|
||||
|
||||
## Legacy
|
||||
|
||||
> 如果你遇到过刚制作的U盘启动盘无法启动,或者新买的固态硬盘做好系统后无法启动,那么大概率的问题就出现在BIOS的引导模式的选择上,是UEFI还是Legacy。legacy启动模式是指BIOS 固件用来初始化硬件设备的引导过程,Legacy启动模式包含一系列已安装的设备,这些设备在引导过程中计算机执行 POST (开机自检)测试时会被初始化。传统引导将检查所有连接设备的主引导记录 (MBR),通常位于磁盘的第一个扇区。
|
||||
当它在设备中找不到引导加载程序时,Legacy会切换到列表中的下一个设备并不断重复此过程,直到找到引导加载程序,否则返回错误。
|
||||
|
||||
## 表格
|
||||
|
||||
### BIOS/UEFI
|
||||
|
||||
| BIOS | UEFI |
|
||||
| ---------------------------------- | --------------------------------------------------------------- |
|
||||
| 用于初始化计算机硬件并引导操作系统 | 在计算机启动时运行 |
|
||||
| 具有较少功能和灵活性 | 具有更多功能和灵活性 |
|
||||
| | 支持更大的硬盘容量、更快的启动速度、更好的安全性和更多的扩展性v |
|
||||
| | 通常具有图形用户界面(GUI) |
|
||||
|
||||
|
||||
### MBR/GPT
|
||||
| MBR | GPT |
|
||||
| ----------------------------------------- | ---------------------------------------------------------------------------------- |
|
||||
| 用于分区磁盘并存储分区布局信息 | 用于分区磁盘并存储分区布局信息 |
|
||||
| 支持最多4个主分区或3个主分区加1个扩展分区 | 支持最多4个主分区或3个主分区加1个扩展分区支持最多4个主分区或3个主分区加1个扩展分区 |
|
||||
| | 具有更好的数据完整性和可靠性,使用校验和检测数据损坏 |
|
||||
| | UEFI需要GPT格式的磁盘才能引导 |
|
||||
|
||||
### UEFI/Legacy
|
||||
| UEFI 引导模式 | Legacy引导模式 |
|
||||
| ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------- |
|
||||
| UEFI 提供了更好的用户界面 | Legacy引导模式是传统的且非常基本的 |
|
||||
| 使用 GPT 分区方案 | 使用 MBR 分区方案 |
|
||||
| UEFI 提供更快的启动时间 | 相比UEFI,它的速度较慢 |
|
||||
| 由于 UEFI 使用 GPT 分区方案,因此它可以支持多达 9 zB 的存储设备 | Legacy使用的 MBR 分区方案仅支持最多 2 TB 存储设备 |
|
||||
| UEFI 以 32 位和 64 位运行,支持鼠标和触摸板 | Legacy在仅支持键盘,仅 16 位模式下运行 |
|
||||
| 它允许安全启动,防止加载未经授权的应用程序它还可能阻碍双启动,因为它将操作系统(OS)视为应用程序 | 它不提供允许加载未经授权的应用程序的安全启动方法,未限制双启动 |
|
||||
| 它具有更简单的更新过程 | 与UEFI相比,它更复杂 |
|
||||
|
||||
## 组合
|
||||
|
||||
- **BIOS+MBR**:
|
||||
|
||||
这是最传统的,系统都会支持;唯一的缺点就是`不支持容量大于2T的硬盘`。
|
||||
|
||||
- **BIOS+GPT**:
|
||||
|
||||
BIOS是可以使用GPT分区表的硬盘来作为数据盘的,但不能引导系统;若电脑同时带有容量小于2T的硬盘和容量大于2T的硬盘,`小于2T的可以用MBR分区表安装系统,而大于2T的可以使用GPT分区表来存放资料`。但系统须使用64位系统。
|
||||
|
||||
- **UEFI+MBR**:
|
||||
|
||||
可以把UEFI设置成`Legacy模式`(传统模式)让其支持传统MBR启动,效果同`BIOS+MBR`;也可以建立FAT分区,放置UEFI启动文件来,可应用在U盘和移动硬盘上实现双模式启动。
|
||||
|
||||
- **UEFI+GPT**:
|
||||
|
||||
如果要把大于2T的硬盘作为系统盘来安装系统的话,就必须`UEFI+GPT`。而且系统须使用64位系统,否则无法引导。但系统又不是传统在PE下安装后就能直接使用的,引导还得经过处理才行。
|
||||
|
||||
## 系统的启动过程
|
||||
|
||||
从按下计算机的开机按钮到用户开始使用计算机,涉及了多个步骤和组件,让我们一起详细了解整个过程:
|
||||
|
||||
**1. 电源启动**:
|
||||
- 用户按下计算机的开机按钮,电源开始供电,计算机硬件开始初始化。电源将电流传递到主板上的BIOS/UEFI芯片。
|
||||
|
||||
**2. BIOS/UEFI启动**:
|
||||
- BIOS/UEFI芯片接收到电源信号后,开始执行初始化过程。它首先进行自检(POST),检测主板、CPU、内存等硬件设备的工作状态,并在显示屏上输出相关信息。
|
||||
- BIOS/UEFI根据配置的启动顺序(通常为硬盘、光盘、USB等)搜索启动设备,并加载位于启动设备上的引导加载程序。
|
||||
|
||||
**3. 引导加载程序加载**:
|
||||
- 引导加载程序(如GRUB)被加载到内存中,它负责后续的操作系统加载过程。GRUB通常会显示启动菜单,列出可用的操作系统选项。
|
||||
- 用户可以在GRUB菜单中选择要启动的操作系统,或者等待默认选项启动。
|
||||
|
||||
**4. 操作系统加载**:
|
||||
- 一旦选择了启动选项,引导加载程序会加载操作系统的内核和初始化RAM磁盘(initramfs/initrd)。
|
||||
- 内核加载完成后,操作系统开始启动初始化过程,包括加载系统服务、挂载文件系统、启动用户界面等。
|
||||
|
||||
**5. 用户登录**:
|
||||
- 操作系统初始化完成后,显示登录界面(如果配置了图形用户界面),用户输入用户名和密码登录系统。
|
||||
- 如果登录成功,操作系统加载用户的桌面环境或命令行界面,用户开始使用计算机。
|
||||
|
||||
## 各种引导加载程序
|
||||
|
||||
| 特性 | GRUB(GRand Unified Bootloader) | LILO(Linux Loader) | systemd-boot(前身为 gummiboot) | rEFInd(UEFI 引导管理器) |
|
||||
|--------------------|----------------------------------|-----------------------------------|----------------------------------|------------------------------------|
|
||||
| **支持的系统类型** | BIOS 和 UEFI | 仅支持 BIOS 模式 | 仅支持 UEFI | 仅支持 UEFI |
|
||||
| **多系统引导支持** | ✅ 强大支持 | ❌ 不支持多系统引导 | ✅ 支持(需手动配置) | ✅ 自动检测操作系统 |
|
||||
| **图形界面支持** | ✅ 支持(可自定义主题) | ❌ 不支持 | ❌ 不支持 | ✅ 支持(可自定义主题) |
|
||||
| **配置方式** | 配置文件(复杂) | 配置文件(简单) | 配置文件(简单) | 配置文件(简单) |
|
||||
| **命令行支持** | ✅ 支持(交互式命令行) | ❌ 不支持 | ❌ 不支持 | ❌ 不支持 |
|
||||
| **文件系统支持** | ✅ 支持多种文件系统 | ✅ 支持 ext2/ext3/ext4 等 | ✅ 支持 ext4、FAT 等 | ✅ 支持 ext4、FAT 等 |
|
||||
| **安全启动支持** | ✅ 支持(需配置) | ❌ 不支持 | ✅ 支持(需配置) | ✅ 支持(需配置) |
|
||||
| **安装复杂度** | 中等(需配置) | 较低 | 较低 | 中等(需配置) |
|
||||
| **适用场景** | 多系统引导、复杂配置 | 简单系统引导 | 简单系统引导 | 多系统引导、美观界面 |
|
||||
|
||||
## 后记
|
||||
|
||||
|
||||
- [聊聊BIOS、UEFI、MBR、GPT、GRUB……](https://segmentfault.com/a/1190000020850901)
|
@ -1,231 +0,0 @@
|
||||
+++
|
||||
title = "Linux之旅(6):常用命令与性能分析"
|
||||
date = 2023-07-25
|
||||
|
||||
[taxonomies]
|
||||
tags = ["Linux"]
|
||||
+++
|
||||
|
||||
前言 在学习Linux操作系统时,熟悉常用命令和性能分析工具是至关重要的。让我们一起探索Linux的世界,提升技能,解锁无限可能!
|
||||
<!-- more -->
|
||||
|
||||
> 翻译自https://medium.com/netflix-techblog/linux-performance-analysis-in-60-000-milliseconds-accc10403c55。
|
||||
|
||||
## **问题背景**
|
||||
当登录到一台有性能问题的Linux服务器,第一分钟要检查什么?
|
||||
|
||||
在Netflix,我们拥有庞大的EC2 Linux虚拟机云,我们有众多性能分析工具来监视和诊断这些Linux服务器的性能。这些工具包括Atlas(负责整个虚拟机云的监控)和Vector(负责按需对虚拟机实例进行性能分析)。这些工具可以帮助我们解决大多数问题,但有时我们需要登录到虚拟机实例,并运行一些标准的Linux性能工具。
|
||||
|
||||
## **前60秒:摘要**
|
||||
在本文中,Netflix性能工程团队将使用您应该使用的标准Linux工具在命令行中向您展示一个性能诊断过程的前60秒。在60秒内,您可以通过运行以下十个命令来了解有关系统资源使用和运行进程的信息。最应该关注的是一些很容易理解的错误、饱和度指标和资源利用率等指标。饱和度是衡量资源负载超出其处理能力的指标,它可以通过观察请求队列的长度或等待时间反映出来。
|
||||
|
||||
```
|
||||
uptime
|
||||
dmesg | tail
|
||||
vmstat 1
|
||||
mpstat -P ALL 1
|
||||
pidstat 1
|
||||
iostat -xz 1
|
||||
free -m
|
||||
sar -n DEV 1
|
||||
sar -n TCP,ETCP 1
|
||||
top
|
||||
```
|
||||
其中的一些命令需要安装sysstat软件包。这些命令暴露出的指标将帮助您完成一些USE方法:一种查找性能瓶颈的方法。它们涉及检查所有资源(CPU、内存、磁盘等)的利用率,饱和度和错误指标。在诊断过程中还应该注意检查和排除某些资源的问题。因为通过排除某些资源的问题,可以缩小诊断的范围,并指民后续的诊断。
|
||||
|
||||
|
||||
## **uptime**
|
||||
```
|
||||
$ uptime
|
||||
23:51:26 up 21:31, 1 user, load average: 30.02, 26.43, 19.02
|
||||
```
|
||||
这是快速查看平均负载的方法,该平均负载指标了要运行的任务(进程)的数量。在Linux系统上,这些数字包括要在CPU上运行的进程以及在不中断IO(通常是磁盘IO)中阻塞的进程。这里给出了资源负载高层次的概览,但是没有其它工具就很难正确理解,值得快速看一眼。
|
||||
|
||||
这三个数字是指数衰减移动平均值,分别代表了1分钟、5分钟、15分钟的平均值。这三个数字使我们对负载如何随时间变化有了一定的了解。例如,如果您去诊断一个有问题的服务器,发现1分钟的值比15分钟的值低很多,那么您可能已经登录得太晚了,错过了问题。
|
||||
|
||||
在上面的例子中,平均负载有所增加,因为1分钟的值30相对15分钟的值19来说大了一些。数字变大意味着很多种可能:有可能是CPU的需求变多了,使用3和4中提到的vmstat或mpstat命令将可以进一步确认问题。
|
||||
|
||||
## **dmesg|tail**
|
||||
```
|
||||
$ dmesg | tail
|
||||
[1880957.563150] perl invoked oom-killer: gfp_mask=0x280da, order=0, oom_score_adj=0
|
||||
[...]
|
||||
[1880957.563400] Out of memory: Kill process 18694 (perl) score 246 or sacrifice child
|
||||
[1880957.563408] Killed process 18694 (perl) total-vm:1972392kB, anon-rss:1953348kB, file-rss:0kB
|
||||
[2320864.954447] TCP: Possible SYN flooding on port 7001. Dropping request. Check SNMP counters.
|
||||
```
|
||||
该命令展示最近 10条系统消息。在这些系统消息中查找有可能引起性能问题的报错。上面的例子包括oom-killer和TCP丢弃了一个请求。
|
||||
|
||||
不能忘记这个步骤,dmesg通常对诊断问题很有价值。
|
||||
```
|
||||
## **vmstat 1**
|
||||
$ vmstat 1
|
||||
procs ---------memory---------- ---swap-- -----io---- -system-- ------cpu-----
|
||||
r b swpd free buff cache si so bi bo in cs us sy id wa st
|
||||
34 0 0 200889792 73708 591828 0 0 0 5 6 10 96 1 3 0 0
|
||||
32 0 0 200889920 73708 591860 0 0 0 592 13284 4282 98 1 1 0 0
|
||||
32 0 0 200890112 73708 591860 0 0 0 0 9501 2154 99 1 0 0 0
|
||||
32 0 0 200889568 73712 591856 0 0 0 48 11900 2459 99 0 0 0 0
|
||||
32 0 0 200890208 73712 591860 0 0 0 0 15898 4840 98 1 1 0 0
|
||||
```
|
||||
vmstat是虚拟内存统计(Virtual Memory Stat)的缩写,vmstat(8)是一个通常可用的工具(最初是在之前的BSD时代创建的),它每行打印一行服务器关键统计的概览。
|
||||
|
||||
vmstat使用参数1运行,意味着每1秒打印打印一次概览。命令输出的第一行展示的是从启动开始的平均值,而不是最近一秒的平均值。因此跳过第一行,除非您想学习并记住哪一列是哪一列。
|
||||
|
||||
要检查的列:
|
||||
|
||||
r:在CPU上运行并等待回合的进程数。由于它不包含IO,因此它比指示CPU饱和的平均负载提供了更多的信息。一个大于CPU核数的r值就是饱和的。
|
||||
free:空闲的内存(单位的KB)。如果计数很大,说明服务器有足够的内存,free -m命令将对空闲内存的状态有更好的说明。
|
||||
si、so:交换置入和交换置出。如果这两个值是非空,说明物理内存用完了,现在在使用交换内存了。
|
||||
us、sy、id、wa、st:这些是CPU时间的分类,其是所有CPU的平均值。它们是用户时间、系统时间(内核)、空闲时间、等待IO和被偷窃时间(被其它宾客系统进行使用,或宾客系统隔离的驱动程序域Xen)
|
||||
通过将用户时间和系统时间这两个分类相加,即可判断CPU是否繁忙。一定的等待IO时间说明磁盘有可能是性能瓶颈。你可以认为等待IO时间是另一种形式的空闲时间,它提供了它是如何空闲的线索。
|
||||
|
||||
IO处理需要占用CPU系统时间。一个较高的CPU系统时间(超过20%)可能会很有趣,有必要进一步研究:也许内核在很低效地处理IO。
|
||||
|
||||
在上面的示例中,CPU时间基本全在用户时间,这说明应用程序本身在大量占用CPU时间。CPU的平均利用率也远远超过90%。这不一定是问题,可以使用r列来检查饱和度。
|
||||
|
||||
## **mpstat -P ALL 1**
|
||||
```
|
||||
$ mpstat -P ALL 1
|
||||
Linux 3.13.0-49-generic (titanclusters-xxxxx) 07/14/2015 _x86_64_ (32 CPU)
|
||||
07:38:49 PM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
|
||||
07:38:50 PM all 98.47 0.00 0.75 0.00 0.00 0.00 0.00 0.00 0.00 0.78
|
||||
07:38:50 PM 0 96.04 0.00 2.97 0.00 0.00 0.00 0.00 0.00 0.00 0.99
|
||||
07:38:50 PM 1 97.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 2.00
|
||||
07:38:50 PM 2 98.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 1.00
|
||||
07:38:50 PM 3 96.97 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3.03
|
||||
[...]
|
||||
```
|
||||
此命令显示每个CPU的CPU时间明细,可用于检查不平衡的情况。单个热CPU说明是单线程应用程序在大量占用CPU时间。
|
||||
|
||||
## **pidstat 1**
|
||||
```
|
||||
$ pidstat 1
|
||||
Linux 3.13.0-49-generic (titanclusters-xxxxx) 07/14/2015 _x86_64_ (32 CPU)
|
||||
07:41:02 PM UID PID %usr %system %guest %CPU CPU Command
|
||||
07:41:03 PM 0 9 0.00 0.94 0.00 0.94 1 rcuos/0
|
||||
07:41:03 PM 0 4214 5.66 5.66 0.00 11.32 15 mesos-slave
|
||||
07:41:03 PM 0 4354 0.94 0.94 0.00 1.89 8 java
|
||||
07:41:03 PM 0 6521 1596.23 1.89 0.00 1598.11 27 java
|
||||
07:41:03 PM 0 6564 1571.70 7.55 0.00 1579.25 28 java
|
||||
07:41:03 PM 60004 60154 0.94 4.72 0.00 5.66 9 pidstat
|
||||
07:41:03 PM UID PID %usr %system %guest %CPU CPU Command
|
||||
07:41:04 PM 0 4214 6.00 2.00 0.00 8.00 15 mesos-slave
|
||||
07:41:04 PM 0 6521 1590.00 1.00 0.00 1591.00 27 java
|
||||
07:41:04 PM 0 6564 1573.00 10.00 0.00 1583.00 28 java
|
||||
07:41:04 PM 108 6718 1.00 0.00 0.00 1.00 0 snmp-pass
|
||||
07:41:04 PM 60004 60154 1.00 4.00 0.00 5.00 9 pidstat
|
||||
```
|
||||
pidstat有点像top的每个进程摘要,但是会滚动打印,而不是清屏再打印。这对于观察一段时间内的模式以及将所看到的内容(复制&粘贴)记录到调查记录中很有用。
|
||||
|
||||
上面的示例显示两个Java进程要为消耗大量CPU负责。%CPU这一列是所有CPU核的总和,1591%说明Java进程差不多消耗了16个核的CPU。
|
||||
|
||||
## **iostat -xz 1**
|
||||
```
|
||||
$ iostat -xz 1
|
||||
Linux 3.13.0-49-generic (titanclusters-xxxxx) 07/14/2015 _x86_64_ (32 CPU)
|
||||
avg-cpu: %user %nice %system %iowait %steal %idle
|
||||
73.96 0.00 3.73 0.03 0.06 22.21
|
||||
Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
|
||||
xvda 0.00 0.23 0.21 0.18 4.52 2.08 34.37 0.00 9.98 13.80 5.42 2.44 0.09
|
||||
xvdb 0.01 0.00 1.02 8.94 127.97 598.53 145.79 0.00 0.43 1.78 0.28 0.25 0.25
|
||||
xvdc 0.01 0.00 1.02 8.86 127.79 595.94 146.50 0.00 0.45 1.82 0.30 0.27 0.26
|
||||
dm-0 0.00 0.00 0.69 2.32 10.47 31.69 28.01 0.01 3.23 0.71 3.98 0.13 0.04
|
||||
dm-1 0.00 0.00 0.00 0.94 0.01 3.78 8.00 0.33 345.84 0.04 346.81 0.01 0.00
|
||||
dm-2 0.00 0.00 0.09 0.07 1.35 0.36 22.50 0.00 2.55 0.23 5.62 1.78 0.03
|
||||
[...]
|
||||
```
|
||||
这是了解块设备(磁盘),应用的工作负载和产生的性能影响的绝佳工具。重点关注下面的指标:
|
||||
|
||||
- r/s、w/s、 rkB/s、 wkB/s:这些是设备每秒交付的读取、写入、读取千字节和写入千字节。使用这些来表征块设备的工作负载。性能问题可能是由于向块设备施加了过多的工作负载。
|
||||
- await:IO的平均时间,以毫秒为单位。这是应用程序所感受到的时间,它包括IO排队时间和IO服务时间。大于预期的平均时间可能表示块设备饱和或设备出现问题了。
|
||||
- avgqu-sz:发给设备的平均请求数。值大于1可以表明已达到饱和状态(尽管设备通常可以并行处理请求,尤其是在多个后端磁盘所组成的前端虚拟设备的情况下)。
|
||||
- %util:设备利用率。这是一个表征繁忙度的百分比,它表示设备每秒工作的时间。尽管它的值取决于设备,但值大于60%通常会导致性能不佳(也会通过await的值观察到)。接近100%的值通常表示饱和。
|
||||
|
||||
如果存储设备是有许多后端磁盘组成的前端逻辑磁盘设备,则100%的利用率可能仅意味着100%的时间正在处理某些IO,但是后端磁盘可能远远没有饱和,并且可能还可以处理更多的工作。
|
||||
|
||||
请记住,性能不佳的磁盘IO不一定是应用问题,通常可以使用许多技术以执行异步IO,以便使应用程序不会被阻塞住而产生直接产生IO延迟(例如,预读和缓冲写入技术)
|
||||
|
||||
## **free -m**
|
||||
```
|
||||
$ free -m
|
||||
total used free shared buffers cached
|
||||
Mem: 245998 24545 221453 83 59 541
|
||||
-/+ buffers/cache: 23944 222053
|
||||
Swap: 0 0 0
|
||||
```
|
||||
右边两列:
|
||||
|
||||
buffers:缓冲区高速缓存,用于块设备I / O
|
||||
cached:页面缓存,由文件系统使用
|
||||
我们只需要检查下它们的大小是否接近零。如果接近零的话,这可能导致较高的磁盘IO(可以使用iostat进行确认)和较差的性能。上面的示例看起来不错,每列都有较大的数据。
|
||||
|
||||
-/+ buffers/cache为已用和空闲内存提供较少让人产生混乱的值。Linux将可用内存用于高速缓存,但是如果应用程序需要,它们可以快速被回收。因此应以某种方式将缓存的内存包括在free列中,这也就是这一行的所做的。甚至还有一个网站专门讨论了这种混乱。
|
||||
|
||||
如果在Linux上使用ZFS,就像我们对某些服务所做的那么,因为ZFS具有自己的文件系统缓存,它们并不会反映在free -m的列中,因此这种场景下这种混乱还将存在。所以会看到似乎系统的可用内存不足,而实际上可根据需要从ZFS缓存中申请到内存。
|
||||
|
||||
## **sar -n DEV 1**
|
||||
|
||||
```
|
||||
$ sar -n DEV 1
|
||||
Linux 3.13.0-49-generic (titanclusters-xxxxx) 07/14/2015 _x86_64_ (32 CPU)
|
||||
12:16:48 AM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil
|
||||
12:16:49 AM eth0 18763.00 5032.00 20686.42 478.30 0.00 0.00 0.00 0.00
|
||||
12:16:49 AM lo 14.00 14.00 1.36 1.36 0.00 0.00 0.00 0.00
|
||||
12:16:49 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
|
||||
12:16:49 AM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil
|
||||
12:16:50 AM eth0 19763.00 5101.00 21999.10 482.56 0.00 0.00 0.00 0.00
|
||||
12:16:50 AM lo 20.00 20.00 3.25 3.25 0.00 0.00 0.00 0.00
|
||||
12:16:50 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
|
||||
```
|
||||
此工具可以检查网络接口的吞吐量:rxkB/s和txkB/s,作为工作负载的度量,还可以检查是否已达到网络接口的限制。在上面的示例中,eth0接收速率达到22MB/s,即176Mbit/s(远低于1Gbit/s的网络接口限制,假设是千兆网卡)。
|
||||
|
||||
此版本还具有%ifutil用来指示设备利用率(全双工双向),这也是我们使用的Brendan的nicstat工具测量出来的。就像nicstat一样,这个指标很难计算正确,而且在本例中好像不起作用(数据是0.00)。
|
||||
|
||||
## **sar -n TCP,ETCP 1**
|
||||
```
|
||||
$ sar -n TCP,ETCP 1
|
||||
Linux 3.13.0-49-generic (titanclusters-xxxxx) 07/14/2015 _x86_64_ (32 CPU)
|
||||
12:17:19 AM active/s passive/s iseg/s oseg/s
|
||||
12:17:20 AM 1.00 0.00 10233.00 18846.00
|
||||
12:17:19 AM atmptf/s estres/s retrans/s isegerr/s orsts/s
|
||||
12:17:20 AM 0.00 0.00 0.00 0.00 0.00
|
||||
12:17:20 AM active/s passive/s iseg/s oseg/s
|
||||
12:17:21 AM 1.00 0.00 8359.00 6039.00
|
||||
12:17:20 AM atmptf/s estres/s retrans/s isegerr/s orsts/s
|
||||
12:17:21 AM 0.00 0.00 0.00 0.00 0.00
|
||||
```
|
||||
这是一些关键的TCP指标的摘要,包括:
|
||||
|
||||
- active / s:每秒本地启动的TCP连接数(例如,通过connect())。
|
||||
- passive/s:每秒远程启动的TCP连接数(例如,通过accept())。
|
||||
- retrans / s:每秒TCP重传的次数。
|
||||
主动和被动计数通常作为服务器TCP负载的粗略度量:新接受的连接数(被动)和新出站的连接数(主动)。将主动视为出站,将被动视为入站可能对理解这两个指标有些帮助,但这并不是严格意义上的(例如,考虑从localhost到localhost的连接)。
|
||||
|
||||
重新传输是网络或服务器问题的迹象;它可能是不可靠的网络(例如,公共Internet),也可能是由于服务器过载并丢弃了数据包。上面的示例仅显示每秒一个新的TCP连接。
|
||||
|
||||
## **top**
|
||||
|
||||
$ top
|
||||
```
|
||||
top - 00:15:40 up 21:56, 1 user, load average: 31.09, 29.87, 29.92
|
||||
Tasks: 871 total, 1 running, 868 sleeping, 0 stopped, 2 zombie
|
||||
%Cpu(s): 96.8 us, 0.4 sy, 0.0 ni, 2.7 id, 0.1 wa, 0.0 hi, 0.0 si, 0.0 st
|
||||
KiB Mem: 25190241+total, 24921688 used, 22698073+free, 60448 buffers
|
||||
KiB Swap: 0 total, 0 used, 0 free. 554208 cached Mem
|
||||
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
|
||||
20248 root 20 0 0.227t 0.012t 18748 S 3090 5.2 29812:58 java
|
||||
4213 root 20 0 2722544 64640 44232 S 23.5 0.0 233:35.37 mesos-slave
|
||||
66128 titancl+ 20 0 24344 2332 1172 R 1.0 0.0 0:00.07 top
|
||||
5235 root 20 0 38.227g 547004 49996 S 0.7 0.2 2:02.74 java
|
||||
4299 root 20 0 20.015g 2.682g 16836 S 0.3 1.1 33:14.42 java
|
||||
1 root 20 0 33620 2920 1496 S 0.0 0.0 0:03.82 init
|
||||
2 root 20 0 0 0 0 S 0.0 0.0 0:00.02 kthreadd
|
||||
3 root 20 0 0 0 0 S 0.0 0.0 0:05.35 ksoftirqd/0
|
||||
5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H
|
||||
6 root 20 0 0 0 0 S 0.0 0.0 0:06.94 kworker/u256:0
|
||||
8 root 20 0 0 0 0 S 0.0 0.0 2:38.05 rcu_sched
|
||||
```
|
||||
top命令包括我们之前检查的许多指标。运行它可以很方便地查看是否有任何东西与以前的命令有很大不同,这表明负载是可变的。
|
||||
|
||||
top命令不太好的地方是,随着时间的推移很难看到指标变化的模式,这在提供滚动输出的vmstat和pidstat之类的工具中可能更清楚一点。如果您没有足够快地暂停输出(Ctrl-S暂停,Ctrl-Q继续),在屏幕输出被top命令清除后,间歇性问题的证据也可能被丢失了。
|
@ -1,48 +0,0 @@
|
||||
+++
|
||||
title = "Linux之旅(7):系统与终端字体设置"
|
||||
date = 2023-08-01
|
||||
|
||||
[taxonomies]
|
||||
tags = ["Linux"]
|
||||
+++
|
||||
|
||||
前言 一个好看的字体会提高工作效率与审美.Linux 下的字体可以很漂亮,但需要一些设置.
|
||||
<!-- more -->
|
||||
|
||||
随着 FreeType2 由于专利过期默认开启了高质量的 LCD 优化,以及一批高质量的开源字体的公布,Linux 上的中文字体渲染比过去好了太多.
|
||||
|
||||
> Windows 的字体渲染从技术上来说是相当先进的,问题是在中文字体的选择上实在是一坨...
|
||||
|
||||
|
||||
## 选择字体
|
||||
|
||||
近几年来出现了一大批自由字体(包括工作量极大的 CJK 字体),使 Linux 下的字体选择一下子丰富了起来.如果愿意花一点时间的话,可以去[ArchWiki](https://wiki.archlinux.org/title/Fonts#Font_packages) 上看看,里面涵盖了相当多的自由字体.
|
||||
|
||||
### 终端字体
|
||||
|
||||
[Maple Mono](https://github.com/subframe7536/maple-font?tab=readme-ov-file),这是一款字形整洁、拥有手写风格的斜体、细粒度配置、内置 Nerd-Font、中英文2:1等宽 的字体.我使用的:
|
||||
```
|
||||
MapleMono-Bold
|
||||
```
|
||||
### 阅读器字体
|
||||
|
||||
[霞鹜文楷](https://github.com/lxgw/LxgwWenKai),一款开源中文字体,基于 FONTWORKS 出品字体 Klee One 衍生.我使用的:
|
||||
```
|
||||
LXGW WenKai
|
||||
```
|
||||
### 浏览器字体
|
||||
```
|
||||
拉丁字体
|
||||
├── Inter -无衬线,类似于 Roboto 但更适合屏幕显示的字体
|
||||
├── Noto Serif -衬线
|
||||
└── Sarasa Term SC -等宽,拉丁文字符严格为半宽的字体,中英文混排时较协调
|
||||
├── 如果不适应这种较瘦的字体风格, 则可以尝试使用:
|
||||
│ ├── Adobe Source Pro
|
||||
│ ├── Cascadia Code
|
||||
│ └── Fira Code
|
||||
中文字体
|
||||
├── Noto Sans CJK SC (思源黑体)
|
||||
└── Noto Serif CJK SC(思源宋体)
|
||||
```
|
||||
---
|
||||
**Done.**
|
6
content/links/link-7.md
Normal file
6
content/links/link-7.md
Normal file
@ -0,0 +1,6 @@
|
||||
+++
|
||||
title = "coperlm's Blog"
|
||||
weight = 7
|
||||
+++
|
||||
|
||||
[coperlm.github.io](https://coperlm.github.io)
|
213
content/windows-1-install.md
Normal file
213
content/windows-1-install.md
Normal file
@ -0,0 +1,213 @@
|
||||
+++
|
||||
title = "Windows系列(1):系统安装与设置"
|
||||
date = 2024-05-24
|
||||
|
||||
[taxonomies]
|
||||
tags = ["Windows"]
|
||||
+++
|
||||
|
||||
前言 由于厂商默认安装windows家庭版导致各种问题频发,这里对 widnows 安装做一个总结,以及附上我个人的windows配置。
|
||||
|
||||
<!-- more -->
|
||||
|
||||
## 总纲
|
||||
|
||||
安装Windows有两种情况:1.在一台全新的电脑上安装;2.想为现有的系统更换版本。本文主要介绍这两种情况。如果只想对现有的系统进行优化,推荐看下一篇的``"Windows系列(2):常用操作与配置"``.
|
||||
|
||||
**全新安装**
|
||||
- 获得一个Windows的ISO镜像;
|
||||
- 制作外部启动盘;
|
||||
- 做好环境准备,备份数据;
|
||||
- 引导外部启动盘安装系统;
|
||||
- 激活系统;
|
||||
- 进行安装后设置与优化;
|
||||
|
||||
**为现有系统更换版本**
|
||||
|
||||
- 做好环境准备,备份数据;
|
||||
- 方法一:获得ISO镜像,并选择从``本地升级``或``外部升级``;
|
||||
- 方法二:在设置中填写预安装密钥并切换系统;
|
||||
- 激活系统;
|
||||
- 进行安装后设置与优化;
|
||||
|
||||
**PS:**
|
||||
> ``本地升级``:即为不需要外部启动盘,不动你的任何东西的无损安装;但需要一些前提条件;
|
||||
|
||||
> ``外部升级``:即为外部启动盘安装系统,可以格式化全盘全新安装;也可以保留数据安装,会将你的的数据放在C盘的``windows.old``文件夹。
|
||||
|
||||
> 数据安全:不管是本地还是外部升级,除非你格式化全盘重新安装,否则安装只会动C盘,其他分区的数据(如D盘等)不会触碰,可放心;
|
||||
|
||||
## 获取ISO镜像
|
||||
|
||||
不管你是哪一种情况,都推荐你先下载ISO镜像,因为ISO镜像方法是最通用,最常用的。
|
||||
|
||||
|
||||
> 官方镜像:从[微软官网](https://www.microsoft.com/en-us/software-download/windows11)下载镜像或[MAS镜像站](https://massgrave.dev/genuine-installation-media)下载。
|
||||
|
||||
> Dichos镜像,是笔者个人制作的镜像,参考[乱七八糟:Windows封装与全自动安装](https://blog.dich.bid/windows-4-auto/);
|
||||
|
||||
**PS:**
|
||||
> 镜像大小从1G~8G左右不等,因为有的不知道哪来的镜像里面版本不全,我们要下载的是包括所有主流版本的ISO,即为里面包括家庭版教育版专业版等等。如果你从其他地方下载ISO镜像,里面可能会捆绑流氓软件甚至有病毒。
|
||||
|
||||
> 我们要使用的是``23H2专业工作站版本``,性能最强,功能最全面,适合日常使用和开发;笔记本自带的往往是24H2家庭中文版,bug多功能少,不建议使用。
|
||||
|
||||
> 以上说的是功能版本,还有大版本的区别,目前暂时用不上,详细可以看本系列第三篇``Windows系列(3):分类与激活``.
|
||||
|
||||
## 制作启动盘
|
||||
|
||||
在远古年代你可能看过电脑城老板使用Ghost安装系统,近一点的使用诸如“大白菜”,“老毛桃”以及各种PE安装系统,这是比较旧式的方法。
|
||||
|
||||
本文推荐使用Ventoy启动盘+windows镜像的方法安装Windows,好处在于:
|
||||
|
||||
- Ventoy开源;
|
||||
- 不必每次安装都格式化U盘,比如刷了某某PE整个盘就不能放数据,刷其他系统前需要格式化;
|
||||
- 兼容性好,可以放各种ISO到里面并直接启动,包括Windows/Linux等等;
|
||||
- 其他详见[乱七八糟:Ventoy战斗盘部署](https://blog.dich.bid/about-ventoy/)
|
||||
|
||||
### 制作流程
|
||||
|
||||
- 首先``在官网下载``[Ventoy](https://www.ventoy.net/cn/download.html)
|
||||
- 随后在``language``中改为中文显示,可以看到左上角有``配置选项``
|
||||
- 将分区类型设置为``GPT``,开启安全启动支持;
|
||||
- 将``分区格式``设置为NTFS;
|
||||
- 随后在``分区设置``中进行分区,选择在``磁盘后保留一段空间``,这里的空间将不被分区,即为空闲空间,可以稍后建立分区当作普通的文件存储盘;
|
||||
- Ventoy分区则会使用``U盘总容量-保留空间-ventoy保留分区``的空间新建一个盘,这里可以放``ISO、WIM、IMG、VHD(x)、EFI``等等
|
||||
- 随后``选择磁盘``并开始安装,过一会儿即可安装完成。
|
||||
- 安装完成后可以看到一个新分区,把我们的ISO镜像放在里面即可。
|
||||
- 随后下载[HotPE](https://github.com/VirtualHotBar/HotPEToolBox),也放在里面。
|
||||
|
||||
## 环境准备&数据备份
|
||||
|
||||
不管你使用哪种方法都建议做好这一步骤:
|
||||
|
||||
- 关闭Bitlocker;(防止磁盘访问受阻)
|
||||
- 关闭安全启动;(防止本地升级失败)
|
||||
- 关闭Intel VMD(如果有);(防止磁盘识别不到)
|
||||
- 确保C盘有足够的空间(9GB+);
|
||||
- 备份好数据以防万一,以及如果原厂系统有驱动安装包也备份起来。
|
||||
|
||||
`关闭Bitclocker`:打开设置,进入隐私与安全→ 设备加密,将其状态切换为关闭。系统会弹窗提示确认,点击关闭,系统将开始解密。解密过程中需要比较久的时间,解密完成后即可成功。
|
||||
|
||||
`关闭安全启动和Intel VMD`:查找你的笔记本的BIOS 进入键,一般为F2;在开机的时候一直按按按BIOS 进入键,即可进入BIOS/UEFI。在其中查找安全启动(Secure Boot)和Intel VMD(如果有)并将它们关闭(disable),随后按保存退出键(一般为F10或F12)。
|
||||
|
||||
`确保C盘有足够的空间`:重新进入BIOS,在其中的引导选项中选择USB设备(你的启动盘的设备名),将其调到第一个,然后保存退出;重新启动,这时候就会进入Ventoy的界面,可以看到我们放进去的两个ISO,我们直接选择HotPE进入并使用里面的Diskgenius,把其他盘的空间分给C盘一点点,使其有至少9GB可以使用。
|
||||
|
||||
## 安装系统
|
||||
|
||||
- 全新安装:进入BIOS选择Ventoy启动并选择Windows的ISO镜像,一路安装过去;
|
||||
- 更换版本外部升级:同上,记得选择保留当前数据,会保留C盘旧数据到Windows.old文件夹;
|
||||
- 更换版本本地升级:不用进BIOS,直接在文件管理器中打开ISO镜像并点击setup.exe,同样选择保留数据;
|
||||
- 更换版本预安装密钥:获得一个专业工作站版本的预安装密钥并在设置里面切换密钥,直接升级系统;
|
||||
|
||||
**PS:**
|
||||
> 无论你用什么方法都建议先备份好数据!!!
|
||||
|
||||
> 无损升级是有前提条件的!!!除了前面说的环境准备,还需要ISO镜像比原来的系统更新,比如23H2的镜像往往就不能无损更新24H2的系统,只能选择外部升级;
|
||||
|
||||
> 如果你选择预安装密钥的方法往往比较容易无损升级,但这样就不能使用Dichos的优化,需要手动优化。
|
||||
|
||||
## 激活系统
|
||||
|
||||
如果你没有购买正版Windows,上文安装的系统可以使用[MAS脚本](https://github.com/massgravel/Microsoft-Activation-Scripts)或者[HEU_KMS工具](https://github.com/zbezj/HEU_KMS_Activator)来激活.
|
||||
|
||||
|
||||
## 安装后优化
|
||||
|
||||
> 如果你使用Dichos,可以直接跳到**三.驱动级**开始.
|
||||
|
||||
#### **一.设备级:**
|
||||
|
||||
- 关闭 BIOS 安全启动,快速启动
|
||||
- 解锁 BitLocker
|
||||
- 删除 OEM 分区,恢复简洁的设备分区
|
||||
|
||||
|
||||
#### **二.系统级:**
|
||||
|
||||
- 家庭版升级为专业工作站版
|
||||
- 将用户名改为非中文
|
||||
- 退出云端账号,杀死家庭组策略
|
||||
- 激活 Windows 与 MS office
|
||||
- 停止自动更新并恢复单级菜单
|
||||
|
||||
|
||||
#### **三.驱动级:**
|
||||
|
||||
驱动的安装没有集成在Dichos中,而是作为手动安装的一部分避免出错。如自带系统有驱动包,先进系统拿出然后再安装新系统;一般来说,包括:
|
||||
|
||||
- 主板驱动和CPU驱动;
|
||||
- 显卡驱动(独显/核显);
|
||||
- Wifi网卡驱动和蓝牙驱动;
|
||||
- 声卡驱动;
|
||||
- 硬盘驱动(较少见);
|
||||
- Fn快捷键驱动(厂商自带);
|
||||
- 笔记本自带的其他某某中心/管家(不建议使用)
|
||||
|
||||
而根据来源,又可以分为``公版/通用驱动``和``笔记本厂商特调/专用驱动``,一般而言装公版驱动即可,保持通用性;如果你是重度游戏玩家则可以考虑特调驱动。
|
||||
|
||||
**常用驱动下载网站**:
|
||||
|
||||
| 分类 | 名称 | 下载 |
|
||||
|--------|----------|------|
|
||||
| 综合 | 驱动天空 | [链接](https://www.drvsky.com/) |
|
||||
| 厂商 | 吾空 | [链接](http://www.wooking.com.cn/drives) |
|
||||
| 厂商 | 华硕 | [链接](https://www.asus.com.cn/support/download-center/) |
|
||||
| 厂商 | 联想 | [链接](https://newsupport.lenovo.com.cn/driveDownloads_index.html) |
|
||||
| 三大件 | AMD | [链接](https://www.amd.com/en/support/download/drivers.html) |
|
||||
| 三大件 | Intel | [链接](https://www.intel.cn/content/www/cn/zh/support/detect.html) |
|
||||
| 三大件 | NVIDIA | [链接](https://www.nvidia.cn/geforce/drivers/) |
|
||||
|
||||
|
||||
#### **四.软件级:**
|
||||
|
||||
- 删除自带牛马以及不必要的管家类软件.
|
||||
|
||||
``使用开源软件!``
|
||||
|
||||
- **AI**: [GPT4All](https://github.com/nomic-ai/gpt4all)
|
||||
- **截图**: [ShareX](https://github.com/ShareX/ShareX)
|
||||
- **绘画**: [Krita](https://github.com/KDE/krita)
|
||||
- **办公**: [Microsoft Office](https://github.com/YerongAI/Office-Tool)
|
||||
- **PDF**: [Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF)
|
||||
- **游戏**: [Steam](https://store.steampowered.com/)
|
||||
- **抓包**: [Wireshark](https://www.wireshark.org/download.html)
|
||||
- **启动器**: [Flow.Launcher](https://github.com/Flow-Launcher/Flow.Launcher)
|
||||
- **输入法**: [Rime](https://rime.im/download/)
|
||||
- **浏览器**: [Floorp](https://github.com/Floorp-Projects/Floorp) / [Chrome](https://www.google.com/chrome/)
|
||||
- **编辑器**: [VSCodium](https://github.com/VSCodium/vscodium)
|
||||
- **虚拟机**: Hyper‑V
|
||||
- **科学上网**: [GFS](https://github.com/GUI-for-Cores/GUI.for.SingBox)
|
||||
- **书籍阅读**: [Readest](https://github.com/readest/readest)
|
||||
- **内网互传**: [LocalSend](https://github.com/localsend/localsend)
|
||||
- **文件同步**: [Syncthing](https://github.com/syncthing/syncthing)
|
||||
- **屏幕录制**: [OBS Studio](https://github.com/obsproject/obs-studio)
|
||||
- **手机投屏**: [QtScrcpy](https://github.com/barry-ran/QtScrcpy)
|
||||
- **包管理**: [UniGetUI](https://github.com/marticliment/UniGetUI)
|
||||
- **软件卸载**: [Geek Uninstaller](https://geekuninstaller.com/download)
|
||||
- **显示器亮度**: [Twinkle Tray](https://github.com/xanderfrangos/twinkle-tray)
|
||||
- **系统工具**: [Dism++](https://github.com/Chuyu-Team/Dism-Multi-language) / [NTLite](https://www.ntlite.com/)
|
||||
- **综合工具**: [图吧工具箱](https://www.tbtool.cn/)
|
||||
- **文件搜索**: [Everything](https://www.voidtools.com/zh-cn/)
|
||||
- **磁盘工具**: [DiskGenius](https://www.diskgenius.cn/)
|
||||
- **密码管理器**: [KeePassXC](https://github.com/keepassxreboot/keepassxc)
|
||||
- **终端/SSH**: [Electerm](https://github.com/electerm/electerm)
|
||||
|
||||
> Rime输入法在Windows端叫小狼毫,输入方案用的是[雾凇拼音](https://github.com/iDvel/rime-ice?tab=readme-ov-file) ,在``获取更多输入方案``中命令行输入``iDvel/rime-ice:others/recipes/full``安装。
|
||||
|
||||
#### **五.设置级**
|
||||
|
||||
- 设置简洁高效的浏览器
|
||||
- 优化桌面布局与任务栏布局
|
||||
- 关闭不必要的开机自启软件
|
||||
- 关闭 Windows Defender 等烦人的通知
|
||||
|
||||
|
||||
#### **六.测试级(可选)**
|
||||
|
||||
- 查看PC型号与配置是否相同
|
||||
- 测试GPU/CPU/硬盘速率与使用时间
|
||||
- 屏幕坏点/喇叭/蓝牙检测
|
||||
- 网络测速
|
||||
|
||||
---
|
||||
**Done.**
|
@ -1,13 +1,12 @@
|
||||
+++
|
||||
title = "Windows系列(1):常用操作"
|
||||
date = 2024-05-24
|
||||
title = "Windows系列(2):常用操作与配置"
|
||||
date = 2024-05-25
|
||||
|
||||
[taxonomies]
|
||||
tags = ["Windows"]
|
||||
+++
|
||||
|
||||
前言 Windows操作系统作为全球最为普及的桌面操作系统之一,其用户界面的设计非常经典,但存在许多不足之处,本篇记录一些常用脚本。
|
||||
|
||||
<!-- more -->
|
||||
|
||||
## **Windows11跳过联网激活 & 使用本地账号**
|
||||
@ -129,6 +128,8 @@ HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender
|
||||
- 将名为``DisableAntiSpyware``的 DWORD (32位) 值设置为1,如果没有就新建。
|
||||
- 重启后生效。
|
||||
|
||||
> 也可以使用[defendnot](https://github.com/es3n1n/defendnot)
|
||||
|
||||
## **Win11添加开机自启动项方法**
|
||||
|
||||
选择“开始”按钮 ,然后滚动查找你希望在启动时运行的应用。
|
@ -30,6 +30,18 @@ tags = ["Windows"]
|
||||
- 批量版(VOL,Volume Licensing for Organizations):企业批量购买,提供了方便大量激活的方案;
|
||||
- 厂商版(OEM,Original Equipment Manufacturer):随电脑整机附赠,主板BIOS内嵌激活信息;
|
||||
|
||||
**大版本分类**
|
||||
| 分类 | 消费者版(Consumer) | 商务版(Business) | 物联网版(IoT) | 长期服务版(LTSC) |
|
||||
|------------------|--------------------------------------------------|---------------------------------------------------|---------------------------------------------------|-----------------------------------------------------|
|
||||
| **目标用户** | 家庭用户、个人消费者 | 企业、机构、教育用户 | 嵌入式设备、工业控制、POS、医疗设备等 | 关键任务系统、长期稳定运行的设备 |
|
||||
| **主要版本** | Windows Home、Home Single Language、Education | Windows Professional、Enterprise、Education | Windows IoT Core、IoT Enterprise、IoT Enterprise LTSC | Windows Enterprise LTSC、IoT Enterprise LTSC |
|
||||
| **预装应用** | 包含 Microsoft Store、娱乐和社交类应用 | 精简部分消费类应用,保留企业管理工具 | 极度精简,移除大部分消费类应用 | 移除 Microsoft Store、Cortana 等非必要功能 |
|
||||
| **更新策略** | 定期推送功能和安全更新 | 可由企业控制更新策略,支持延迟功能更新 | 可选择常规更新或 LTSC 版本,更新策略灵活 | 仅推送安全补丁和关键修复,无新功能更新 |
|
||||
| **支持周期** | 通常为 18 个月 | 通常为 18~30 个月,取决于版本和配置 | IoT Enterprise LTSC 支持周期可达 10~15 年 | 通常为 5 年主流支持 + 5 年扩展支持,共 10 年 |
|
||||
| **授权方式** | 零售授权,需在线激活 | 批量许可(Volume Licensing)、OEM 授权 | OEM 授权,适用于特定硬件设备 | 批量许可,适用于特定行业和关键任务设备 |
|
||||
| **适用场景** | 日常办公、娱乐、学习 | 企业办公、教育机构、专业工作站 | 工业自动化、零售终端、医疗设备等嵌入式系统 | 医疗设备、金融终端、工业控制系统等需长期稳定运行的环境 |
|
||||
|
||||
|
||||
---
|
||||
|
||||
## **二.激活方法和原理**
|
@ -1,204 +0,0 @@
|
||||
+++
|
||||
title = "Windows系列(2):安装与环境配置"
|
||||
date = 2024-05-25
|
||||
|
||||
[taxonomies]
|
||||
tags = ["Windows"]
|
||||
+++
|
||||
|
||||
前言 由于厂商默认安装windows家庭版导致各种问题频发,这里对 widnows 安装做一个总结,以及附上我个人的windows配置。
|
||||
|
||||
<!-- more -->
|
||||
|
||||
> 从官方安装:从[微软官网](https://www.microsoft.com/en-us/software-download/windows11)下载镜像或[MAS镜像站](https://massgrave.dev/genuine-installation-media)下载。
|
||||
|
||||
|
||||
> 从Dichos安装,参考[乱七八糟:Windows封装与全自动安装](https://blog.dich.bid/windows-iso/);
|
||||
|
||||
> 二者都基于专业工作站版本,区别在于Dichos通过预应答文件和封装完成了许多设置与优化。Windows最新版本往往Bug比较多,推荐用上一版本;如最新版本为24H2,则推荐使用23H2.
|
||||
|
||||
**大版本分类**
|
||||
| 分类 | 消费者版(Consumer) | 商务版(Business) | 物联网版(IoT) | 长期服务版(LTSC) |
|
||||
|------------------|--------------------------------------------------|---------------------------------------------------|---------------------------------------------------|-----------------------------------------------------|
|
||||
| **目标用户** | 家庭用户、个人消费者 | 企业、机构、教育用户 | 嵌入式设备、工业控制、POS、医疗设备等 | 关键任务系统、长期稳定运行的设备 |
|
||||
| **主要版本** | Windows Home、Home Single Language、Education | Windows Professional、Enterprise、Education | Windows IoT Core、IoT Enterprise、IoT Enterprise LTSC | Windows Enterprise LTSC、IoT Enterprise LTSC |
|
||||
| **预装应用** | 包含 Microsoft Store、娱乐和社交类应用 | 精简部分消费类应用,保留企业管理工具 | 极度精简,移除大部分消费类应用 | 移除 Microsoft Store、Cortana 等非必要功能 |
|
||||
| **更新策略** | 定期推送功能和安全更新 | 可由企业控制更新策略,支持延迟功能更新 | 可选择常规更新或 LTSC 版本,更新策略灵活 | 仅推送安全补丁和关键修复,无新功能更新 |
|
||||
| **支持周期** | 通常为 18 个月 | 通常为 18~30 个月,取决于版本和配置 | IoT Enterprise LTSC 支持周期可达 10~15 年 | 通常为 5 年主流支持 + 5 年扩展支持,共 10 年 |
|
||||
| **授权方式** | 零售授权,需在线激活 | 批量许可(Volume Licensing)、OEM 授权 | OEM 授权,适用于特定硬件设备 | 批量许可,适用于特定行业和关键任务设备 |
|
||||
| **适用场景** | 日常办公、娱乐、学习 | 企业办公、教育机构、专业工作站 | 工业自动化、零售终端、医疗设备等嵌入式系统 | 医疗设备、金融终端、工业控制系统等需长期稳定运行的环境 |
|
||||
|
||||
> 安装完成后的优化:
|
||||
|
||||
## **一.设备级:**
|
||||
|
||||
- 关闭 BIOS 安全启动,快速启动
|
||||
- 解锁 BitLocker
|
||||
- 删除 OEM 分区,恢复简洁的设备分区
|
||||
|
||||
|
||||
## **二.系统级:**
|
||||
|
||||
- 家庭版升级为专业工作站版
|
||||
- 将用户名改为非中文
|
||||
- 退出云端账号,杀死家庭组策略
|
||||
- 激活 Windows 与 MS office
|
||||
- 停止自动更新并恢复单级菜单
|
||||
|
||||
|
||||
## **三.驱动级:**
|
||||
|
||||
驱动的安装没有集成在Dichos中,而是作为手动安装的一部分避免出错。如自带系统有驱动包,先进系统拿出然后再安装新系统;一般来说,包括:
|
||||
|
||||
- 主板驱动和CPU驱动;
|
||||
- 显卡驱动(独显/核显);
|
||||
- Wifi网卡驱动和蓝牙驱动;
|
||||
- 声卡驱动;
|
||||
- 硬盘驱动(较少见);
|
||||
- Fn快捷键驱动(厂商自带);
|
||||
- 笔记本自带的其他某某中心/管家(不建议使用)
|
||||
|
||||
而根据来源,又可以分为``公版/通用驱动``和``笔记本厂商特调/专用驱动``,一般而言装公版驱动即可,保持通用性;如果你是重度游戏玩家则可以考虑特调驱动。
|
||||
|
||||
**常用驱动下载网站**:
|
||||
|
||||
| 分类 | 名称 | 下载 |
|
||||
|--------|----------|------|
|
||||
| 综合 | 驱动天空 | [链接](https://www.drvsky.com/) |
|
||||
| 厂商 | 吾空 | [链接](http://www.wooking.com.cn/drives) |
|
||||
| 厂商 | 华硕 | [链接](https://www.asus.com.cn/support/download-center/) |
|
||||
| 厂商 | 联想 | [链接](https://newsupport.lenovo.com.cn/driveDownloads_index.html) |
|
||||
| 三大件 | AMD | [链接](https://www.amd.com/en/support/download/drivers.html) |
|
||||
| 三大件 | Intel | [链接](https://www.intel.cn/content/www/cn/zh/support/detect.html) |
|
||||
| 三大件 | NVIDIA | [链接](https://www.nvidia.cn/geforce/drivers/) |
|
||||
|
||||
|
||||
## **四.软件级:**
|
||||
|
||||
- 删除自带牛马以及不必要的管家类软件.
|
||||
|
||||
## 软件
|
||||
|
||||
- **AI**: [GPT4All](https://github.com/nomic-ai/gpt4all)
|
||||
- **截图**: [ShareX](https://github.com/ShareX/ShareX)
|
||||
- **绘画**: [Krita](https://github.com/KDE/krita)
|
||||
- **办公**: [Microsoft Office](https://github.com/YerongAI/Office-Tool)
|
||||
- **PDF**: [Stirling-PDF](https://github.com/Stirling-Tools/Stirling-PDF)
|
||||
- **游戏**: [Steam](https://store.steampowered.com/)
|
||||
- **抓包**: [Wireshark](https://www.wireshark.org/download.html)
|
||||
- **启动器**: [Flow.Launcher](https://github.com/Flow-Launcher/Flow.Launcher)
|
||||
- **输入法**: [Rime](https://rime.im/download/)
|
||||
- **浏览器**: [Floorp](https://github.com/Floorp-Projects/Floorp) / [Chrome](https://www.google.com/chrome/)
|
||||
- **编辑器**: [VSCodium](https://github.com/VSCodium/vscodium)
|
||||
- **虚拟机**: Hyper‑V
|
||||
- **科学上网**: [GFS](https://github.com/GUI-for-Cores/GUI.for.SingBox)
|
||||
- **书籍阅读**: [Readest](https://github.com/readest/readest)
|
||||
- **内网互传**: [LocalSend](https://github.com/localsend/localsend)
|
||||
- **文件同步**: [Syncthing](https://github.com/syncthing/syncthing)
|
||||
- **屏幕录制**: [OBS Studio](https://github.com/obsproject/obs-studio)
|
||||
- **手机投屏**: [QtScrcpy](https://github.com/barry-ran/QtScrcpy)
|
||||
- **包管理**: [UniGetUI](https://github.com/marticliment/UniGetUI)
|
||||
- **软件卸载**: [Geek Uninstaller](https://geekuninstaller.com/download)
|
||||
- **显示器亮度**: [Twinkle Tray](https://github.com/xanderfrangos/twinkle-tray)
|
||||
- **系统工具**: [Dism++](https://github.com/Chuyu-Team/Dism-Multi-language) / [NTLite](https://www.ntlite.com/)
|
||||
- **综合工具**: [图吧工具箱](https://www.tbtool.cn/)
|
||||
- **文件搜索**: [Everything](https://www.voidtools.com/zh-cn/)
|
||||
- **磁盘工具**: [DiskGenius](https://www.diskgenius.cn/)
|
||||
- **密码管理器**: [KeePassXC](https://github.com/keepassxreboot/keepassxc)
|
||||
- **终端/SSH**: [Electerm](https://github.com/electerm/electerm)
|
||||
|
||||
> 这里说一下Rime输入法在Windows端叫小狼毫,输入方案用的是[雾凇拼音](https://github.com/iDvel/rime-ice?tab=readme-ov-file) ,在``获取更多输入方案``中命令行输入``iDvel/rime-ice:others/recipes/full``安装。
|
||||
|
||||
> 传统意义上的三大件包括浏览器,编辑器以及密码管理器。
|
||||
|
||||
|
||||
## **五.设置级**
|
||||
|
||||
- 设置简洁高效的浏览器
|
||||
- 优化桌面布局与任务栏布局
|
||||
- 关闭开机自启软件
|
||||
- 关闭 Windows Defender 等烦人的通知
|
||||
|
||||
|
||||
## **六.测试级(可选)**
|
||||
|
||||
- 查看PC型号与配置是否相同
|
||||
- 测试GPU/CPU/硬盘速率与使用时间
|
||||
- 屏幕坏点/喇叭/蓝牙检测
|
||||
- 网络测速
|
||||
|
||||
---
|
||||
|
||||
## 开发环境
|
||||
|
||||
### 搭建虚拟机环境
|
||||
|
||||
- Hyper-V
|
||||
|
||||
在 BIOS 中找到类似``Intel VT-x”、“AMD-V”或“Virtualization Technology``的选项,确保它是“Enabled”(启用)。随后按下 Win + S,输入“打开或关闭 Windows 功能”,在弹出的窗口中,找到 Hyper-V并启用,重启后即可出现。
|
||||
|
||||
- VMware
|
||||
|
||||
首先下载 [Vmware](https://www.423down.com/14542.html),随后安装并[激活](https://www.ypojie.com/6066.html),然后提前下载好所需系统的镜像,这里推荐[整合镜像站](https://help.mirrorz.org/),并在Vmware中启动。
|
||||
|
||||
- Virtulbox
|
||||
|
||||
直接到[官网](https://www.virtualbox.org/wiki/Downloads)下载并安装。
|
||||
|
||||
- WSL
|
||||
|
||||
在``控制面板->程序->启用或关闭Windows功能``,选中适用于Linux的Windows子系统和虚拟机平台,待安装完成后重启电脑。
|
||||
|
||||
然后,在``管理员模式下打开 PowerShell 或 Windows 命令提示符``,方法是右键单击并选择“以管理员身份运行”,输入以下命令,然后重启计算机。
|
||||
|
||||
```
|
||||
wsl --install
|
||||
```
|
||||
此命令将启用运行 WSL 并安装 Linux 的 Ubuntu 发行版所需的功能。(可以更改此默认发行版)。
|
||||
|
||||
|
||||
> 使用 qemu-img 进行各种虚拟机格式转换
|
||||
|
||||
- qcow2 转 vmdk(VMware)
|
||||
```
|
||||
qemu-img convert -f qcow2 -O vmdk input.qcow2 output.vmdk
|
||||
```
|
||||
- qcow2 转 vdi(VirtualBox)
|
||||
```
|
||||
qemu-img convert -f qcow2 -O vdi input.qcow2 output.vdi
|
||||
```
|
||||
- qcow2 转 vhdx(新版 Hyper-V)
|
||||
|
||||
目前 qemu-img 不能直接输出 vhdx,但你可以先转成 vhd,再用微软工具(如 Convert-VHD)转换为 vhdx:
|
||||
```
|
||||
Convert-VHD -Path "output.vhd" -DestinationPath "output.vhdx" -VHDType Dynamic
|
||||
```
|
||||
- vmdk转vhdx
|
||||
```
|
||||
qemu-img convert -f vmdk -O vhdx input.vmdk output.vhdx
|
||||
```
|
||||
- vhd转vhdx
|
||||
在 PowerShell 中执行以下命令:
|
||||
```
|
||||
Convert-VHD -Path "C:\路径\源文件.vhd" -DestinationPath "C:\路径\目标文件.vhdx" -VHDType Dynamic
|
||||
|
||||
# -Path:指定原始 VHD 文件的路径。
|
||||
# -DestinationPath:指定转换后 VHDX 文件的保存路径。
|
||||
# -VHDType:指定磁盘类型,可选值为 Fixed(固定大小)或 Dynamic(动态扩展)。
|
||||
```
|
||||
请确保虚拟机已关闭,并且 PowerShell 以管理员权限运行。
|
||||
|
||||
|
||||
> Vscode SSH 连接
|
||||
|
||||
使用``Open Remote - SSH``插件,需要创建.ssh文件夹;Windows中在``C://users//username//``路径下。
|
||||
|
||||
随后使用插件新建一个连接,如:
|
||||
```
|
||||
Host myserver
|
||||
HostName 192.168.1.100
|
||||
User your_username
|
||||
```
|
||||
|
||||
---
|
||||
**Done.**
|
@ -326,7 +326,7 @@
|
||||
</div>
|
||||
<div class="pagination__buttons">
|
||||
<span class="button previous">
|
||||
<a href="https://blog.dich.bid/windows-conda-python/">
|
||||
<a href="https://blog.dich.bid/windows-5-py/">
|
||||
<span class="button__icon">←</span>
|
||||
<span class="button__text">Windows系列(5):Python开发配置</span>
|
||||
</a>
|
||||
|
@ -389,8 +389,8 @@
|
||||
|
||||
|
||||
<span class="button next">
|
||||
<a href="https://blog.dich.bid/windows-some-setting/">
|
||||
<span class="button__text">Windows系列(1):常用操作</span>
|
||||
<a href="https://blog.dich.bid/windows-1-install/">
|
||||
<span class="button__text">Windows系列(1):系统安装与设置</span>
|
||||
<span class="button__icon">→</span>
|
||||
</a>
|
||||
</span>
|
||||
|
@ -237,7 +237,7 @@
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/windows-conda-python/">
|
||||
<a href="https://blog.dich.bid/windows-5-py/">
|
||||
<span class="post-date">2024-05-31</span>
|
||||
:: <span class="post-list-title">Windows系列(5):Python开发配置</span></a>
|
||||
|
||||
@ -247,7 +247,7 @@
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/windows-vscode-gcc/">
|
||||
<a href="https://blog.dich.bid/windows-6-c/">
|
||||
<span class="post-date">2024-05-30</span>
|
||||
:: <span class="post-list-title">Windows系列(6):C/C++开发配置</span></a>
|
||||
|
||||
@ -257,7 +257,7 @@
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/windows-iso/">
|
||||
<a href="https://blog.dich.bid/windows-4-auto/">
|
||||
<span class="post-date">2024-05-29</span>
|
||||
:: <span class="post-list-title">Windows系列(4):封装与全自动安装</span></a>
|
||||
|
||||
@ -267,7 +267,7 @@
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/windows-activation/">
|
||||
<a href="https://blog.dich.bid/windows-3-jh/">
|
||||
<span class="post-date">2024-05-26</span>
|
||||
:: <span class="post-list-title">Windows系列(3):分类与激活</span></a>
|
||||
|
||||
@ -277,9 +277,9 @@
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/windows-all/">
|
||||
<a href="https://blog.dich.bid/windows-2-set/">
|
||||
<span class="post-date">2024-05-25</span>
|
||||
:: <span class="post-list-title">Windows系列(2):安装与环境配置</span></a>
|
||||
:: <span class="post-list-title">Windows系列(2):常用操作与配置</span></a>
|
||||
|
||||
<span class="post-tags-inline">
|
||||
::
|
||||
@ -287,9 +287,9 @@
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/windows-some-setting/">
|
||||
<a href="https://blog.dich.bid/windows-1-install/">
|
||||
<span class="post-date">2024-05-24</span>
|
||||
:: <span class="post-list-title">Windows系列(1):常用操作</span></a>
|
||||
:: <span class="post-list-title">Windows系列(1):系统安装与设置</span></a>
|
||||
|
||||
<span class="post-tags-inline">
|
||||
::
|
||||
@ -515,76 +515,6 @@
|
||||
::
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/zong-he-gong-cheng/">#综合工程</a></span>
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-7/">
|
||||
<span class="post-date">2023-08-01</span>
|
||||
:: <span class="post-list-title">Linux之旅(7):系统与终端字体设置</span></a>
|
||||
|
||||
<span class="post-tags-inline">
|
||||
::
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-6/">
|
||||
<span class="post-date">2023-07-25</span>
|
||||
:: <span class="post-list-title">Linux之旅(6):常用命令与性能分析</span></a>
|
||||
|
||||
<span class="post-tags-inline">
|
||||
::
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-5/">
|
||||
<span class="post-date">2023-07-24</span>
|
||||
:: <span class="post-list-title">Linux之旅(5):BIOS-UEFI-MBR-GPT-GRUB</span></a>
|
||||
|
||||
<span class="post-tags-inline">
|
||||
::
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-4/">
|
||||
<span class="post-date">2023-07-23</span>
|
||||
:: <span class="post-list-title">Linux之旅(4):Terminal,Console and Shell</span></a>
|
||||
|
||||
<span class="post-tags-inline">
|
||||
::
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-3/">
|
||||
<span class="post-date">2023-07-22</span>
|
||||
:: <span class="post-list-title">Linux之旅(3):内核/shell/包管理/文件系统/桌面环境</span></a>
|
||||
|
||||
<span class="post-tags-inline">
|
||||
::
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-2/">
|
||||
<span class="post-date">2023-07-21</span>
|
||||
:: <span class="post-list-title">Linux之旅(2):FHS与目录结构</span></a>
|
||||
|
||||
<span class="post-tags-inline">
|
||||
::
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-1/">
|
||||
<span class="post-date">2023-07-20</span>
|
||||
:: <span class="post-list-title">Linux之旅(1):构成与发行版</span></a>
|
||||
|
||||
<span class="post-tags-inline">
|
||||
::
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
165
public/atom.xml
165
public/atom.xml
@ -667,8 +667,8 @@
|
||||
</name>
|
||||
</author>
|
||||
|
||||
<link rel="alternate" type="text/html" href="https://blog.dich.bid/windows-conda-python/"/>
|
||||
<id>https://blog.dich.bid/windows-conda-python/</id>
|
||||
<link rel="alternate" type="text/html" href="https://blog.dich.bid/windows-5-py/"/>
|
||||
<id>https://blog.dich.bid/windows-5-py/</id>
|
||||
|
||||
<summary type="html"><p>前言 由于 Windows 中开发环境较 linux 复杂,这里总结 Windows 中使用 Jupyter 开发 Python 的环境配置。</p></summary>
|
||||
|
||||
@ -686,8 +686,8 @@
|
||||
</name>
|
||||
</author>
|
||||
|
||||
<link rel="alternate" type="text/html" href="https://blog.dich.bid/windows-vscode-gcc/"/>
|
||||
<id>https://blog.dich.bid/windows-vscode-gcc/</id>
|
||||
<link rel="alternate" type="text/html" href="https://blog.dich.bid/windows-6-c/"/>
|
||||
<id>https://blog.dich.bid/windows-6-c/</id>
|
||||
|
||||
<summary type="html"><p>前言 由于 Windows 中开发环境较 linux 复杂,这里总结 Windows 中使用 VScode 开发 C/C++ 的环境配置。</p></summary>
|
||||
|
||||
@ -705,8 +705,8 @@
|
||||
</name>
|
||||
</author>
|
||||
|
||||
<link rel="alternate" type="text/html" href="https://blog.dich.bid/windows-iso/"/>
|
||||
<id>https://blog.dich.bid/windows-iso/</id>
|
||||
<link rel="alternate" type="text/html" href="https://blog.dich.bid/windows-4-auto/"/>
|
||||
<id>https://blog.dich.bid/windows-4-auto/</id>
|
||||
|
||||
<summary type="html"><p>前言 由于厂商默认安装windows家庭版导致各种问题频发,这里作者封装了一个开箱即用的,全自动安装,激活和优化的Windows11镜像。</p></summary>
|
||||
|
||||
@ -724,14 +724,14 @@
|
||||
</name>
|
||||
</author>
|
||||
|
||||
<link rel="alternate" type="text/html" href="https://blog.dich.bid/windows-activation/"/>
|
||||
<id>https://blog.dich.bid/windows-activation/</id>
|
||||
<link rel="alternate" type="text/html" href="https://blog.dich.bid/windows-3-jh/"/>
|
||||
<id>https://blog.dich.bid/windows-3-jh/</id>
|
||||
|
||||
<summary type="html"><p>前言 Windows的正版售价十分昂贵,2025年的今天大部分人都使用着OEM厂商自带的windows系统或自己想办法激活,那么,激活到底是什么原理?</p></summary>
|
||||
|
||||
</entry>
|
||||
<entry xml:lang="en">
|
||||
<title>Windows系列(2):安装与环境配置</title>
|
||||
<title>Windows系列(2):常用操作与配置</title>
|
||||
<published>2024-05-25T00:00:00+00:00</published>
|
||||
<updated>2024-05-25T00:00:00+00:00</updated>
|
||||
|
||||
@ -743,14 +743,14 @@
|
||||
</name>
|
||||
</author>
|
||||
|
||||
<link rel="alternate" type="text/html" href="https://blog.dich.bid/windows-all/"/>
|
||||
<id>https://blog.dich.bid/windows-all/</id>
|
||||
<link rel="alternate" type="text/html" href="https://blog.dich.bid/windows-2-set/"/>
|
||||
<id>https://blog.dich.bid/windows-2-set/</id>
|
||||
|
||||
<summary type="html"><p>前言 由于厂商默认安装windows家庭版导致各种问题频发,这里对 widnows 安装做一个总结,以及附上我个人的windows配置。</p></summary>
|
||||
<summary type="html"><p>前言 Windows操作系统作为全球最为普及的桌面操作系统之一,其用户界面的设计非常经典,但存在许多不足之处,本篇记录一些常用脚本。</p></summary>
|
||||
|
||||
</entry>
|
||||
<entry xml:lang="en">
|
||||
<title>Windows系列(1):常用操作</title>
|
||||
<title>Windows系列(1):系统安装与设置</title>
|
||||
<published>2024-05-24T00:00:00+00:00</published>
|
||||
<updated>2024-05-24T00:00:00+00:00</updated>
|
||||
|
||||
@ -762,10 +762,10 @@
|
||||
</name>
|
||||
</author>
|
||||
|
||||
<link rel="alternate" type="text/html" href="https://blog.dich.bid/windows-some-setting/"/>
|
||||
<id>https://blog.dich.bid/windows-some-setting/</id>
|
||||
<link rel="alternate" type="text/html" href="https://blog.dich.bid/windows-1-install/"/>
|
||||
<id>https://blog.dich.bid/windows-1-install/</id>
|
||||
|
||||
<summary type="html"><p>前言 Windows操作系统作为全球最为普及的桌面操作系统之一,其用户界面的设计非常经典,但存在许多不足之处,本篇记录一些常用脚本。</p></summary>
|
||||
<summary type="html"><p>前言 由于厂商默认安装windows家庭版导致各种问题频发,这里对 widnows 安装做一个总结,以及附上我个人的windows配置。</p></summary>
|
||||
|
||||
</entry>
|
||||
<entry xml:lang="en">
|
||||
@ -1186,137 +1186,4 @@
|
||||
<summary type="html"><p>前言 linux搭建安卓虚拟机有Waydroid,QEMU和Docker三种方案,各有不同。</p></summary>
|
||||
|
||||
</entry>
|
||||
<entry xml:lang="en">
|
||||
<title>Linux之旅(7):系统与终端字体设置</title>
|
||||
<published>2023-08-01T00:00:00+00:00</published>
|
||||
<updated>2023-08-01T00:00:00+00:00</updated>
|
||||
|
||||
<author>
|
||||
<name>
|
||||
|
||||
Unknown
|
||||
|
||||
</name>
|
||||
</author>
|
||||
|
||||
<link rel="alternate" type="text/html" href="https://blog.dich.bid/learn-linux-for-pc-7/"/>
|
||||
<id>https://blog.dich.bid/learn-linux-for-pc-7/</id>
|
||||
|
||||
<summary type="html"><p>前言 一个好看的字体会提高工作效率与审美.Linux 下的字体可以很漂亮,但需要一些设置.</p></summary>
|
||||
|
||||
</entry>
|
||||
<entry xml:lang="en">
|
||||
<title>Linux之旅(6):常用命令与性能分析</title>
|
||||
<published>2023-07-25T00:00:00+00:00</published>
|
||||
<updated>2023-07-25T00:00:00+00:00</updated>
|
||||
|
||||
<author>
|
||||
<name>
|
||||
|
||||
Unknown
|
||||
|
||||
</name>
|
||||
</author>
|
||||
|
||||
<link rel="alternate" type="text/html" href="https://blog.dich.bid/learn-linux-for-pc-6/"/>
|
||||
<id>https://blog.dich.bid/learn-linux-for-pc-6/</id>
|
||||
|
||||
<summary type="html"><p>前言 在学习Linux操作系统时,熟悉常用命令和性能分析工具是至关重要的。让我们一起探索Linux的世界,提升技能,解锁无限可能!</p></summary>
|
||||
|
||||
</entry>
|
||||
<entry xml:lang="en">
|
||||
<title>Linux之旅(5):BIOS-UEFI-MBR-GPT-GRUB</title>
|
||||
<published>2023-07-24T00:00:00+00:00</published>
|
||||
<updated>2023-07-24T00:00:00+00:00</updated>
|
||||
|
||||
<author>
|
||||
<name>
|
||||
|
||||
Unknown
|
||||
|
||||
</name>
|
||||
</author>
|
||||
|
||||
<link rel="alternate" type="text/html" href="https://blog.dich.bid/learn-linux-for-pc-5/"/>
|
||||
<id>https://blog.dich.bid/learn-linux-for-pc-5/</id>
|
||||
|
||||
<summary type="html"><p>前言 在计算机领域,系统引导和磁盘分区是至关重要的。本文将介绍BIOS与UEFI,MBR与GPT,以及它们之间的异同点。此外,我们还会讨论与这些概念密切相关的引导加载程序——GRUB。</p></summary>
|
||||
|
||||
</entry>
|
||||
<entry xml:lang="en">
|
||||
<title>Linux之旅(4):Terminal,Console and Shell</title>
|
||||
<published>2023-07-23T00:00:00+00:00</published>
|
||||
<updated>2023-07-23T00:00:00+00:00</updated>
|
||||
|
||||
<author>
|
||||
<name>
|
||||
|
||||
Unknown
|
||||
|
||||
</name>
|
||||
</author>
|
||||
|
||||
<link rel="alternate" type="text/html" href="https://blog.dich.bid/learn-linux-for-pc-4/"/>
|
||||
<id>https://blog.dich.bid/learn-linux-for-pc-4/</id>
|
||||
|
||||
<summary type="html"><p>前言 在linux的学习过程中,我们常常遇到诸如 Terminal,Console,bash,zsh,shell,tty 等概念,这些概念常常被混淆,似乎都和命令行相关。本文从历史角度出发介绍它们的前世今生。</p></summary>
|
||||
|
||||
</entry>
|
||||
<entry xml:lang="en">
|
||||
<title>Linux之旅(3):内核/shell/包管理/文件系统/桌面环境</title>
|
||||
<published>2023-07-22T00:00:00+00:00</published>
|
||||
<updated>2023-07-22T00:00:00+00:00</updated>
|
||||
|
||||
<author>
|
||||
<name>
|
||||
|
||||
Unknown
|
||||
|
||||
</name>
|
||||
</author>
|
||||
|
||||
<link rel="alternate" type="text/html" href="https://blog.dich.bid/learn-linux-for-pc-3/"/>
|
||||
<id>https://blog.dich.bid/learn-linux-for-pc-3/</id>
|
||||
|
||||
<summary type="html"><p>前言 在Linux世界中,内核/shell/包管理/文件系统构成了Linux系统的核心,它们相互配合,共同构建了一个强大而稳定的操作环境。本文将深入探讨这些关键组成部分,解释它们的作用和原理,帮助读者更好地理解Linux系统的运作机制。</p></summary>
|
||||
|
||||
</entry>
|
||||
<entry xml:lang="en">
|
||||
<title>Linux之旅(2):FHS与目录结构</title>
|
||||
<published>2023-07-21T00:00:00+00:00</published>
|
||||
<updated>2023-07-21T00:00:00+00:00</updated>
|
||||
|
||||
<author>
|
||||
<name>
|
||||
|
||||
Unknown
|
||||
|
||||
</name>
|
||||
</author>
|
||||
|
||||
<link rel="alternate" type="text/html" href="https://blog.dich.bid/learn-linux-for-pc-2/"/>
|
||||
<id>https://blog.dich.bid/learn-linux-for-pc-2/</id>
|
||||
|
||||
<summary type="html"><p>前言 在Linux世界中,Filesystem Hierarchy Standard(FHS)是一座引导我们进入系统核心的桥梁,它定义了Linux系统中目录结构的规范与作用,为我们提供了一张清晰的地图,指引我们轻松管理和理解系统。本文将深入探讨FHS规范与Linux系统目录结构,解释各个目录的用途与功能,帮助我们更好地理解和利用Linux系统。</p></summary>
|
||||
|
||||
</entry>
|
||||
<entry xml:lang="en">
|
||||
<title>Linux之旅(1):构成与发行版</title>
|
||||
<published>2023-07-20T00:00:00+00:00</published>
|
||||
<updated>2023-07-20T00:00:00+00:00</updated>
|
||||
|
||||
<author>
|
||||
<name>
|
||||
|
||||
Unknown
|
||||
|
||||
</name>
|
||||
</author>
|
||||
|
||||
<link rel="alternate" type="text/html" href="https://blog.dich.bid/learn-linux-for-pc-1/"/>
|
||||
<id>https://blog.dich.bid/learn-linux-for-pc-1/</id>
|
||||
|
||||
<summary type="html"><p>前言 Linux 作为一款强大、灵活且免费的操作系统,吸引了越来越多的用户。然而,对于初学者来说,Linux 可能显得有些陌生,甚至有些令人望而生畏。本文旨在为那些刚踏入 Linux 世界的新手提供一份指南,帮助他们更好地了解、使用这个令人着迷的操作系统。我们将探讨Linux的基本概念,解释为何选择Linux,深入剖析其主要构成要素以及不同的发行版之间的差异。</p></summary>
|
||||
|
||||
</entry>
|
||||
</feed>
|
@ -135,23 +135,60 @@
|
||||
</ul>
|
||||
<p>安装方法同ubuntu一样,是基于Calamares的图形化界面安装。一般步骤为<code>选择语言(American English)--选择键盘/时区(默认/shanghai)--选择分区(xfs抹除全盘,可选全盘加密)--选择桌面环境(Gnome或KDE)--确认安装。</code></p>
|
||||
<h2 id="an-zhuang-ruan-jian">安装软件</h2>
|
||||
<p>随后安装常用开源软件:</p>
|
||||
<p>随后安装常用开源软件(KDE环境省略file和wayland)</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span># gui
|
||||
</span><span>
|
||||
</span><span>paru -S alacritty zellij qemu-full virt-manager wireshark-qt floorp-bin foliate materialgram-bin legcord-bin keepassxc onlyoffice-bin kazumi-bin vlc krita qtscrcpy localsend-bin strawberry oculante obs-studio
|
||||
</span><span>paru -S floorp-bin keepassxc qemu-full virt-manager materialgram-bin legcord-bin onlyoffice-bin localsend-bin kazumi-bin foliate vlc krita qtscrcpy strawberry oculante obs-studio
|
||||
</span><span>
|
||||
</span><span># tui
|
||||
</span><span>
|
||||
</span><span>paru -S neovim yazi lazygit btop
|
||||
</span><span>paru -S neovim yazi lazygit btop zellij termshark
|
||||
</span><span>
|
||||
</span><span># cli
|
||||
</span><span>
|
||||
</span><span>paru -S nexttrace-bin android-tools syncthing aria2 zola fastfetch onefetch starship atuin bat fzf eza tree
|
||||
</span><span>paru -S alacritty fish fastfetch tealdeer expac fish-autopair fish-pure-prompt fisher onefetch starship atuin bat fzf fd ripgrep eza tree android-tools payload-dumper-go-bin nexttrace-bin syncthing aria2
|
||||
</span><span>
|
||||
</span><span># other
|
||||
</span><span>
|
||||
</span><span>paru -S ttf-jetbrains-mono-nerd fcitx5-chinese-addons fcitx5-skin-material fcitx5-im fcitx5-rime npm pnpm just go wl-clipboard
|
||||
</span><span># file
|
||||
</span><span>
|
||||
</span><span>paru -S gvfs gvfs-mtp gvfs-afc gvfs-nfs nemo
|
||||
</span><span>
|
||||
</span><span># zip
|
||||
</span><span>
|
||||
</span><span>paru -S peazip
|
||||
</span><span>
|
||||
</span><span># Type
|
||||
</span><span>
|
||||
</span><span>paru -S fcitx5-configtool fcitx5-chinese-addons fcitx5-skin-material fcitx5-im fcitx5-rime
|
||||
</span><span>
|
||||
</span><span># Blog
|
||||
</span><span>
|
||||
</span><span>paru -S zola npm pnpm just go
|
||||
</span><span>
|
||||
</span><span># ttf
|
||||
</span><span>
|
||||
</span><span>paru -S ttf-jetbrains-mono-nerd
|
||||
</span><span>
|
||||
</span><span># Wayland
|
||||
</span><span>
|
||||
</span><span>paru -S hyprland waybar wofi network-manager-applet swww wl-gammarelay-rs brightnessctl easyeffects wireplumber pipewire blueman wl-clipboard-rs swaync swayosd swappy grim wlogout hyprlock hyprpolkitagent
|
||||
</span></code></pre>
|
||||
<table><thead><tr><th>分类</th><th>软件列表</th></tr></thead><tbody>
|
||||
<tr><td><strong>窗口管理器</strong></td><td>hyprland</td></tr>
|
||||
<tr><td><strong>状态栏</strong></td><td>waybar</td></tr>
|
||||
<tr><td><strong>启动器</strong></td><td>wofi</td></tr>
|
||||
<tr><td><strong>网络</strong></td><td>network-manager-applet</td></tr>
|
||||
<tr><td><strong>蓝牙</strong></td><td>blueman</td></tr>
|
||||
<tr><td><strong>音频</strong></td><td>pipewire, wireplumber</td></tr>
|
||||
<tr><td><strong>亮度</strong></td><td>brightnessctl, wl-gammarelay-rs</td></tr>
|
||||
<tr><td><strong>剪贴板</strong></td><td>wl-clipboard-rs,wl-clip-persist</td></tr>
|
||||
<tr><td><strong>通知</strong></td><td>swaync,swayosd</td></tr>
|
||||
<tr><td><strong>截图</strong></td><td>grim, swappy</td></tr>
|
||||
<tr><td><strong>壁纸管理</strong></td><td>swww</td></tr>
|
||||
<tr><td><strong>Polkit 授权代理</strong></td><td>hyprpolkitagent</td></tr>
|
||||
<tr><td><strong>锁屏/开始菜单</strong></td><td>hyprlock, wlogout</td></tr>
|
||||
<tr><td><strong>文件管理</strong></td><td>gvfs, gvfs-mtp, gvfs-afc, gvfs-nfs, nemo</td></tr>
|
||||
</tbody></table>
|
||||
<p>安装完毕后我们开始配置输入法与字体:</p>
|
||||
<p>输入法我们采用雾凇拼音,即前面我们安装的fcitx5系列软件包的一个输入方案,这里我们使用<a href="https://github.com/Mark24Code/rime-auto-deploy">自动部署脚本</a>:</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span># step1: 克隆/下载 latest 最新的稳定版到本地
|
||||
@ -394,6 +431,74 @@
|
||||
<p>应该输出:</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>net.ipv4.tcp_congestion_control = bbr
|
||||
</span></code></pre>
|
||||
<h2 id="xing-neng-mo-shi-qie-huan">性能模式切换</h2>
|
||||
<p>需要安装<code>power-profiles-daemon</code></p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span># 查看可用的电源配置文件(profiles)
|
||||
</span><span>powerprofilesctl list
|
||||
</span><span>
|
||||
</span><span># 查看当前正在使用的 profile
|
||||
</span><span>powerprofilesctl get
|
||||
</span><span>
|
||||
</span><span># 切换到“性能”模式
|
||||
</span><span>sudo powerprofilesctl set performance
|
||||
</span><span>
|
||||
</span><span># 切换到“平衡”模式
|
||||
</span><span>sudo powerprofilesctl set balanced
|
||||
</span><span>
|
||||
</span><span># 切换到“省电”模式
|
||||
</span><span>sudo powerprofilesctl set power-saver
|
||||
</span></code></pre>
|
||||
<h2 id="qi-ta-xing-neng-you-hua">其他性能优化</h2>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>Profile‑sync‑daemon
|
||||
</span><span>将浏览器配置文件和缓存挂载到内存,退出时再写回磁盘:
|
||||
</span><span>
|
||||
</span><span>sudo pacman -S profile-sync-daemon
|
||||
</span><span>systemctl --user enable --now psd.service
|
||||
</span><span>
|
||||
</span><span>Systemd‑oomd
|
||||
</span><span>启用 systemd 自带的内存超载保护守护进程:
|
||||
</span><span>
|
||||
</span><span>sudo pacman -S systemd-oomd
|
||||
</span><span>sudo systemctl enable --now systemd-oomd
|
||||
</span><span>
|
||||
</span><span>Bpftune
|
||||
</span><span>加载 BPF 性能调优脚本(网络、I/O、调度等):
|
||||
</span><span>
|
||||
</span><span>sudo pacman -S bpftune
|
||||
</span><span>sudo systemctl enable --now bpftune
|
||||
</span><span>
|
||||
</span><span>Ananicy‑Cpp
|
||||
</span><span>根据预设规则给游戏、多媒体和后台任务打优先级标签:
|
||||
</span><span>
|
||||
</span><span>sudo pacman -S ananicy-cpp
|
||||
</span><span>sudo systemctl enable --now ananicy-cpp
|
||||
</span></code></pre>
|
||||
<h2 id="chang-yong-ming-ling">常用命令</h2>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>更新系统:sudo pacman -Syu
|
||||
</span><span>
|
||||
</span><span>重新安装所有软件包:sudo pacman -Qq | sudo pacman -S -
|
||||
</span><span>
|
||||
</span><span>Reset keyrings:
|
||||
</span><span>
|
||||
</span><span>sudo rm -rf /etc/pacman.d/gnupg
|
||||
</span><span>sudo pacman-key --init
|
||||
</span><span>sudo pacman-key --populate archlinux
|
||||
</span><span>
|
||||
</span><span>移除数据库锁:sudo rm -f /var/lib/pacman/db.lck
|
||||
</span><span>
|
||||
</span><span>清理软件包缓存:sudo pacman -Sc (或 -Scc 完全清空)
|
||||
</span><span>
|
||||
</span><span>删除孤立软件包:sudo pacman -Rns $(pacman -Qtdq)
|
||||
</span><span>
|
||||
</span><span>Install Gaming packages:sudo pacman -S steam wine lutris dxvk
|
||||
</span><span>
|
||||
</span><span>排序镜像:
|
||||
</span><span>
|
||||
</span><span>sudo pacman -S reflector
|
||||
</span><span>sudo reflector --latest 10 --sort rate --save /etc/pacman.d/mirrorlist
|
||||
</span><span>
|
||||
</span><span>更改 DNS 服务器:编辑 /etc/systemd/resolved.conf 中的 DNS=1.1.1.1 8.8.8.8,然后 sudo systemctl restart systemd-resolved
|
||||
</span></code></pre>
|
||||
<h2 id="zai-arch-linuxshang-an-zhuang-docker">在Arch Linux上安装Docker</h2>
|
||||
<p>一般推荐在qemu虚拟机中安装,这里仅做示例:</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>sudo pacman -S docker
|
||||
|
@ -132,9 +132,6 @@
|
||||
<li>8.VPN配置回家;</li>
|
||||
<li>9.实现透明代理。</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>剩余专业路由功能可以由ROS替代,服务则跑在NAS系统上,避免ALL in Boom!</p>
|
||||
</blockquote>
|
||||
<h2 id="da-zhi-si-lu">大致思路</h2>
|
||||
<ul>
|
||||
<li>使用高性能的X86主机管理拨号和 DHCP 内网的工作,其他无线路由器桥接做AP,Mesh组网;</li>
|
||||
@ -162,15 +159,44 @@
|
||||
</li>
|
||||
</ul>
|
||||
<h2 id="ru-he-de-dao-yi-ge-openwrtxi-tong"><strong>如何得到一个openwrt系统</strong></h2>
|
||||
<ol>
|
||||
<li>使用编译好的现成的镜像:</li>
|
||||
</ol>
|
||||
<ul>
|
||||
<li>可以在恩山论坛上使用他人编译好的现成的镜像,如"高大全","精品小包"等等,但存在一定风险;</li>
|
||||
<li>可以使用<a href="https://downloads.openwrt.org/">官方固件</a>下载得到一个最小化的系统,再一步步添加自己要用的包;注意需要根据你的uboot来选择,注意固件名称是否带了uboot_mod!</li>
|
||||
<li>可以使用<a href="https://firmware-selector.openwrt.org/">Openwrt 在线编译</a>或<a href="https://openwrt.ai/?target=x86%2F64&id=generic">Openwrt.ai</a>在线编译
|
||||
<li>恩山论坛上的"高大全","精品小包"等等,但存在一定风险;</li>
|
||||
<li>使用<a href="https://downloads.openwrt.org">官方固件</a>下载得到一个最小化的系统,再一步步添加自己要用的包;注意需要根据你的uboot来选择,注意固件名称是否带了uboot_mod!</li>
|
||||
</ul>
|
||||
<ol start="2">
|
||||
<li>自行编译:</li>
|
||||
</ol>
|
||||
<ul>
|
||||
<li><a href="https://openwrt.ai/?target=x86%2F64&id=generic">Openwrt.ai</a>在线编译
|
||||
一个固件;</li>
|
||||
<li>可以使用GitHub action 云编译一个固件;</li>
|
||||
<li>可以在本地linux环境中进行编译。</li>
|
||||
</ul>
|
||||
<h2 id="x86ping-tai-an-zhuang-zhun-bei"><strong>X86平台安装准备:</strong></h2>
|
||||
<ol start="3">
|
||||
<li>ImageBuilder</li>
|
||||
</ol>
|
||||
<ul>
|
||||
<li>使用<a href="https://firmware-selector.openwrt.org/">Openwrt 官方ImageBuilder编译</a></li>
|
||||
<li>自行下载对应的ImageBuilder包并构建.</li>
|
||||
</ul>
|
||||
<h2 id="toolchain-sdk-imagebuilder">Toolchain/SDK/ImageBuilder</h2>
|
||||
<table><thead><tr><th>特性</th><th><strong>Toolchain</strong></th><th><strong>SDK</strong></th><th><strong>Image Builder</strong></th></tr></thead><tbody>
|
||||
<tr><td>包含内容</td><td>仅交叉编译工具链(二进制版 GCC、ld、musl、binutils)</td><td>完整交叉编译环境 + feeds 脚本 + package 目录,用于 <code>.ipk</code> 包开发</td><td>预编译的根文件系统 + opkg 包(无需源码编译),用于快速定制固件映像</td></tr>
|
||||
<tr><td>典型用途</td><td>用于编译第三方程序或 CI,如 hello-world 示例</td><td>编写和编译 <code>.ipk</code> 包,本地或自动化环境中离线开发</td><td>快速生成可刷写的固件镜像,集成所需包且无需完整源码树</td></tr>
|
||||
<tr><td>解压即用</td><td>✅</td><td>✅</td><td>✅</td></tr>
|
||||
<tr><td>在源码树中的作用</td><td><code>make toolchain/install</code> 自动识别并使用跳过编译流程</td><td>源码树中不会触发 SDK 安装,需要手动解压并进入其目录使用</td><td>不使用源码树,直接在 Image Builder 根目录下运行 <code>make image</code> 等命令</td></tr>
|
||||
<tr><td>大小</td><td>较小(几十 MB)</td><td>较大(上百 MB)</td><td>中等(约数百 MB,因包含预编译包)</td></tr>
|
||||
<tr><td>构建时间</td><td>几秒到几分钟</td><td>几分钟到十几分钟(取决于 feeds 大小)</td><td>极快,可在几十秒到几分钟内完成定制镜像</td></tr>
|
||||
<tr><td>兼容性</td><td>与对应 Release 完全匹配</td><td>与对应 Release 完全匹配</td><td>与对应 Release 完全匹配</td></tr>
|
||||
<tr><td>使用难度</td><td>简单,只需解压并设置 PATH</td><td>适中,需要理解 feeds 机制及包管理</td><td>最简单,适合终端用户或快速测试环境</td></tr>
|
||||
</tbody></table>
|
||||
<h2 id="x86ping-tai-an-zhuang-liu-cheng"><strong>X86平台安装流程:</strong></h2>
|
||||
<ol start="0">
|
||||
<li>安装准备:</li>
|
||||
</ol>
|
||||
<ul>
|
||||
<li>
|
||||
<p>一个U盘与一台双网口物理机</p>
|
||||
@ -188,23 +214,30 @@
|
||||
<p><a href="https://www.roadkil.net/program.php?ProgramID=12#google_vignette">img 写盘工具</a></p>
|
||||
</li>
|
||||
</ul>
|
||||
<h2 id="x86ping-tai-an-zhuang-liu-cheng"><strong>X86平台安装流程:</strong></h2>
|
||||
<p>1.进入PE环境:</p>
|
||||
<ol>
|
||||
<li>进入PE环境:</li>
|
||||
</ol>
|
||||
<ul>
|
||||
<li>打开微PE,将其安装进U盘中,安装完成后将 img 工具和 openwrt 包一起放进去;</li>
|
||||
<li>将U盘插入目标主机,进入 BIOS-boot 设置U盘优先启动,各主板进入 BIOS 的按键不同,不确定的话建议都试一遍。</li>
|
||||
</ul>
|
||||
<p>2.格式化硬盘并写盘</p>
|
||||
<ol start="2">
|
||||
<li>格式化硬盘并写盘</li>
|
||||
</ol>
|
||||
<ul>
|
||||
<li>进入PE环境中,可以看到存在名为“分区助手”的软件,打开它并将目标主机硬盘格式化;注意不要分区!不要分区!不要设置文件系统!否则后续可能无法编译!点击左上角提交并执行</li>
|
||||
<li>打开img写盘工具,将openwrt包写入硬盘,注意不要写进U盘里。</li>
|
||||
</ul>
|
||||
<p>3.进入配置界面</p>
|
||||
<ol start="3">
|
||||
<li>进入配置界面</li>
|
||||
</ol>
|
||||
<ul>
|
||||
<li>重启系统并快速拔出U盘,避免重新进入PE;这时系统开始运行了。注意Esir固件是不跑码的,无需担心。- 一个U盘与一台双网口物理机</li>
|
||||
<li>当看到 <code>please press Enter to activate this console</code>这个提示的时候系统就安装完毕了。可使用 passwd 命令设置密码。软路由将自动获取IP地址,随后我们在浏览器中打开该地址,即可看到 Lucl 界面。</li>
|
||||
</ul>
|
||||
<p>4.如果你使用官方固件,注意:</p>
|
||||
<ol start="4">
|
||||
<li>如果你使用官方固件,注意:</li>
|
||||
</ol>
|
||||
<ul>
|
||||
<li>硬盘空间有一部分没有被格式化,可以手动格式化为ext4并挂载。</li>
|
||||
<li>注意初始IP往往是192.168.1.1,如果和光猫冲突需要在网络-接口中更改。</li>
|
||||
@ -212,14 +245,7 @@
|
||||
<li>刷错主题无法打开luci:通过 SSH 登录路由器,切换到另一个已知正常的主题(例如 Bootstrap):
|
||||
<code>uci set luci.main.mediaurlbase='/luci-static/bootstrap' uci commit luci /etc/init.d/uhttpd restart</code>
|
||||
然后重新访问 Web 界面,查看是否恢复正常。</li>
|
||||
<li>一般要安装的包:</li>
|
||||
</ul>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>openssh-sftp-server
|
||||
</span><span>libpcap
|
||||
</span><span>luci-app-upnp
|
||||
</span><span>luci-app-ttyd
|
||||
</span><span>kmod-nft-xxx
|
||||
</span></code></pre>
|
||||
<h2 id="x86ping-tai-ben-di-bian-yi-wan-zheng-openwrt"><strong>X86平台本地编译完整openwrt</strong></h2>
|
||||
<ul>
|
||||
<li>
|
||||
@ -259,7 +285,7 @@
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>useradd -m openwrt # 新建一个名为 openwrt 的用户
|
||||
</span></code></pre>
|
||||
<blockquote>
|
||||
<p>不可以使用Root用户进行编译!!!</p>
|
||||
<p>不可以使用Root用户进行编译!!!</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li><strong>修改用户默认的 Shell</strong></li>
|
||||
@ -274,70 +300,58 @@
|
||||
</span><span>cd ~
|
||||
</span></code></pre>
|
||||
<ul>
|
||||
<li><strong>拉取源码,这里用的是 LEDE 分支源码:</strong></li>
|
||||
<li><strong>拉取源码,这里用的是 ImmortalWrt 24.10 分支源码:</strong></li>
|
||||
</ul>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>git clone https://github.com/coolsnowwolf/lede
|
||||
</span><span>cd lede
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>git clone https://github.com/immortalwrt/immortalwrt.git
|
||||
</span><span>cd immortalwrt
|
||||
</span></code></pre>
|
||||
<ul>
|
||||
<li><strong>选择分支</strong></li>
|
||||
</ul>
|
||||
<p>如果你想要编译稳定版(stable),使用</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>git checkout xxx #例如git checkout v24.10.2
|
||||
</span></code></pre>
|
||||
<p>如果你想要编译最新版(snapshot),使用</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>git switch xxx #例如git switch openwrt-24.10
|
||||
</span></code></pre>
|
||||
<h3 id="mu-lu-shuo-ming">目录说明</h3>
|
||||
<table><thead><tr><th>名称</th><th>作用</th></tr></thead><tbody>
|
||||
<tr><td><code>Makefile</code></td><td><strong>整个 OpenWrt 构建系统的总入口点</strong>(顶层 Makefile),运行 <code>make menuconfig</code>、<code>make</code> 都依赖它</td></tr>
|
||||
<tr><td><code>Config.in</code></td><td>Kconfig 系统的入口配置文件,决定 <code>make menuconfig</code> 菜单显示什么选项</td></tr>
|
||||
<tr><td><code>config/</code></td><td>构建系统的默认配置模板、菜单逻辑,和 <code>menuconfig</code> 相关</td></tr>
|
||||
<tr><td><code>include/</code></td><td>包含通用 makefile 片段的目录(比如编译选项、函数定义)</td></tr>
|
||||
<tr><td><code>rules.mk</code></td><td>所有包编译通用规则都写在这里,<code>include $(TOPDIR)/rules.mk</code> 是常见语句</td></tr>
|
||||
<tr><td><code>feeds.conf.default</code></td><td>定义 Feed 源(即可选的软件源),可用于管理外部包,比如 <code>luci</code>、<code>packages</code></td></tr>
|
||||
<tr><td><code>feeds/</code> <em>(克隆后还没出现)</em></td><td><code>./scripts/feeds update -a</code> 后才会出现,用来保存外部 feed 的代码</td></tr>
|
||||
<tr><td><code>package/</code></td><td>OpenWrt 自带的核心包和第三方包(除 feeds 外的)都在这,结构是 <code>package/<分类>/<包名></code></td></tr>
|
||||
<tr><td><code>target/</code></td><td>支持的平台架构,比如 <code>x86</code>、<code>ramips</code>、<code>ath79</code>、<code>mediatek</code> 等都在里面</td></tr>
|
||||
<tr><td><code>toolchain/</code></td><td>编译器链、glibc/musl、binutils、gcc 都在这里构建</td></tr>
|
||||
<tr><td><code>tools/</code></td><td>构建工具目录,编译前工具如 <code>m4</code>、<code>autoconf</code>、<code>xz</code>、<code>patch</code> 等放在这</td></tr>
|
||||
<tr><td><code>scripts/</code></td><td>脚本工具目录,如 <code>feeds</code> 管理、镜像合并、menuconfig 支持等</td></tr>
|
||||
<tr><td><code>LICENSES/</code></td><td>所有包/组件的许可证归档</td></tr>
|
||||
<tr><td><code>COPYING</code></td><td>OpenWrt 的主许可证(GPLv2)</td></tr>
|
||||
<tr><td><code>README.md</code></td><td>简要介绍如何开始使用 OpenWrt 的说明文档</td></tr>
|
||||
<tr><td><code>BSDmakefile</code></td><td>为 BSD 系统一些兼容 makefile,Linux 用户用不到</td></tr>
|
||||
</tbody></table>
|
||||
<ul>
|
||||
<li>
|
||||
<p>buildroot: OpenWrt 的核心目录,包含构建系统相关的文件。</p>
|
||||
<ul>
|
||||
<li><code>feeds.conf.default</code>:定义软件包源的配置文件。</li>
|
||||
<li><code>files/</code>:存放自定义文件,用于覆盖默认的 root 文件系统。</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<p>target: 包含目标设备架构的配置和构建信息。</p>
|
||||
<ul>
|
||||
<li><code>linux/</code>:包含与 Linux 内核相关的代码和配置。</li>
|
||||
<li><code>generic/</code>:通用配置文件。</li>
|
||||
<li><code>platform/</code>:针对具体设备平台的特定配置。</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<p>package: 包含所有 OpenWrt 的软件包。</p>
|
||||
<ul>
|
||||
<li><code>base/</code>:基本功能相关的软件包(如 BusyBox、opkg)。</li>
|
||||
<li><code>kernel/</code>:与内核相关的补丁或模块。</li>
|
||||
<li><code>network/</code>:网络工具和协议(如 DHCP、DNS)。</li>
|
||||
<li><code>utils/</code>:各种实用工具(如编解码器、文件工具)。</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<p>config: 存放默认配置文件,例如 <code>Config.in</code>,用于定义菜单项。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>scripts: 构建过程中使用的辅助脚本(如生成补丁、编译镜像)。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>toolchain: 构建工具链所需的文件,如编译器、链接器。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>tools: 一些构建系统依赖的额外工具(如 <code>autoconf</code>、<code>zlib</code>)。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>include: 存放 Makefile 的通用模板和其他全局定义文件。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>feeds: 包含通过 <code>feeds.conf</code> 配置的外部软件包源。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>documentation: 包含与 OpenWrt 项目相关的文档,如构建指南和开发文档。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>添加软件源,可自行添加软件源至 feeds.conf.default 文件,也可以直接git添加需要的软件到lede目录下:</strong></p>
|
||||
</li>
|
||||
<li><strong>添加软件源,可自行添加软件源至 feeds.conf.default 文件</strong></li>
|
||||
</ul>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>vim feeds.conf.default
|
||||
</span></code></pre>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>常用源
|
||||
</span><span>src-git kenzo https://github.com/kenzok8/openwrt-packages
|
||||
<p><strong>常用源</strong></p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>src-git kenzo https://github.com/kenzok8/openwrt-packages
|
||||
</span><span>src-git small https://github.com/kenzok8/small
|
||||
</span><span>src-git haibo https://github.com/haiibo/openwrt-packages
|
||||
</span><span>src-git liuran001 https://github.com/liuran001/openwrt-packages
|
||||
</span></code></pre>
|
||||
<p><strong>常用仓库</strong></p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>src/gz kwrt_core https://dl.openwrt.ai/releases/24.10/targets/x86/64/6.6.83
|
||||
</span><span>src/gz kwrt_base https://dl.openwrt.ai/releases/24.10/packages/x86_64/base
|
||||
</span><span>src/gz kwrt_packages https://dl.openwrt.ai/releases/24.10/packages/x86_64/packages
|
||||
</span><span>src/gz kwrt_luci https://dl.openwrt.ai/releases/24.10/packages/x86_64/luci
|
||||
</span><span>src/gz kwrt_routing https://dl.openwrt.ai/releases/24.10/packages/x86_64/routing
|
||||
</span><span>src/gz kwrt_kiddin9 https://dl.openwrt.ai/releases/24.10/packages/x86_64/kiddin9
|
||||
</span></code></pre>
|
||||
<ul>
|
||||
<li><strong>单独添加</strong>(在更新并安装插件之前执行)例如:</li>
|
||||
</ul>
|
||||
@ -350,104 +364,122 @@
|
||||
</span><span>./scripts/feeds update -a
|
||||
</span><span>./scripts/feeds install -a
|
||||
</span></code></pre>
|
||||
<table><thead><tr><th><code>./scripts/feeds update -a</code></th><th>同步/更新 <strong>外部 feed</strong>(packages、luci、routing 等)的 Git 仓库到本地 <code>feeds/</code> 目录</th></tr></thead><tbody>
|
||||
<tr><td><code>./scripts/feeds install -a</code></td><td>把你在 feeds 里选要用的包 <strong>链接</strong> 到源码树的 <code>package/feeds/</code>,让它们参与编译</td></tr>
|
||||
</tbody></table>
|
||||
<ul>
|
||||
<li><strong>自定义配置</strong></li>
|
||||
</ul>
|
||||
<p><strong>修改默认IP为 10.0.0.2</strong></p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>sed -i 's/192.168.1.1/192.168.2.1/g' package/base-files/files/bin/config_generate
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>#!/usr/bin/env bash
|
||||
</span><span># diy-part2.sh — 在镜像生成时注入默认设置和定制 SSH 横幅及模型修复
|
||||
</span><span>
|
||||
</span><span># 1. 默认 hostname(可选)
|
||||
</span><span>sed -i 's/=ImmortalWrt/=my-device/' package/base-files/files/bin/config_generate
|
||||
</span><span>
|
||||
</span><span># 2. 默认 IP 地址(可选)
|
||||
</span><span>sed -i 's/192.168.1.1/192.168.5.1/' package/base-files/files/bin/config_generate
|
||||
</span><span>
|
||||
</span><span># 3. 默认 root 密码(请换成安全密码)
|
||||
</span><span>HASH=$(openssl passwd -1 'yourpassword')
|
||||
</span><span>sed -i "s|root::0:0:99999|root:${HASH}:0:0:99999|" package/base-files/files/etc/shadow
|
||||
</span><span>
|
||||
</span><span># 4. 设置默认 LuCI 主题为 argon(内置在 luci feeds)
|
||||
</span><span>cat >>package/base-files/files/etc/uci-defaults/99_set_theme <<'EOF'
|
||||
</span><span>uci set luci.main.mediaurlbase=/luci-static/argon
|
||||
</span><span>uci commit luci
|
||||
</span><span>EOF
|
||||
</span><span>chmod +x package/base-files/files/etc/uci-defaults/99_set_theme
|
||||
</span><span>
|
||||
</span><span># 5. 默认加载 BBR 拥塞控制算法
|
||||
</span><span>mkdir -p package/base-files/files/etc/sysctl.d
|
||||
</span><span>cat >>package/base-files/files/etc/sysctl.d/99-bbr.conf <<'EOF'
|
||||
</span><span>net.core.default_qdisc=fq_codel
|
||||
</span><span>net.ipv4.tcp_congestion_control=bbr
|
||||
</span><span>EOF
|
||||
</span><span>
|
||||
</span><span># 检查BBR: sysctl net.ipv4.tcp_congestion_control
|
||||
</span><span>
|
||||
</span><span># 6. 将默认 shell 修改为 bash
|
||||
</span><span>sed -i "s|/bin/ash|/bin/bash|g" package/base-files/files/etc/passwd
|
||||
</span><span># 请在 .config 中添加 TARGET_PACKAGES += bash
|
||||
</span><span>
|
||||
</span><span># 7. 自定义 SSH 登录横幅(banner)
|
||||
</span><span>mkdir -p package/base-files/files/etc
|
||||
</span><span>if [ -f "scripts/custom-files/banner.txt" ]; then
|
||||
</span><span> cp scripts/custom-files/banner.txt package/base-files/files/etc/banner
|
||||
</span><span>else
|
||||
</span><span> cat >package/base-files/files/etc/banner <<'EOF'
|
||||
</span><span>Welcome to MyDevice (ImmortalWrt)\n
|
||||
</span><span>EOF
|
||||
</span><span>fi
|
||||
</span><span>
|
||||
</span><span># 8. 自定义 LuCI 概览设备型号 🛠
|
||||
</span><span># 通过 uci-defaults 脚本写入 /tmp/sysinfo/model
|
||||
</span><span>cat >>package/base-files/files/etc/uci-defaults/99-model-fix <<'EOF'
|
||||
</span><span>#!/bin/sh
|
||||
</span><span># 设置自定义设备型号
|
||||
</span><span>mkdir -p /tmp/sysinfo
|
||||
</span><span>echo "Your Router Model" > /tmp/sysinfo/model
|
||||
</span><span>exit 0
|
||||
</span><span>EOF
|
||||
</span><span>chmod +x package/base-files/files/etc/uci-defaults/99-model-fix
|
||||
</span></code></pre>
|
||||
<p><strong>修改默认主机名</strong></p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>sed -i '/uci commit system/i\uci set system.@system[0].hostname='OpenWrt'' package/lean/default-settings/files/zzz-default-settings
|
||||
</span></code></pre>
|
||||
<p><strong>加入编译者信息</strong></p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>sed -i "s/OpenWrt /smith build $(TZ=UTC-8 date "+%Y.%m.%d") @ OpenWrt /g" package/lean/default-settings/files/zzz-default-settings
|
||||
</span></code></pre>
|
||||
<p><strong>修改默认主题</strong></p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>sed -i "s/luci-theme-bootstrap/luci-theme-argon/g" feeds/luci/collections/luci/Makefile
|
||||
</span></code></pre>
|
||||
<p>执行 <strong>make menuconfig</strong> 命令进入编译菜单。</p>
|
||||
<ul>
|
||||
<li>执行 <strong>make menuconfig</strong> 命令进入编译菜单。</li>
|
||||
</ul>
|
||||
<table><thead><tr><th>命令</th><th>功能描述</th><th>优点</th><th>适用场景</th></tr></thead><tbody>
|
||||
<tr><td><code>make menuconfig</code></td><td>以 ncurses 界面交互式地浏览、修改当前 <code>.config</code> 与最新 Kconfig 中的所有选项</td><td>界面友好,支持搜索和分类;可直观调整</td><td>想手动挑选/调整配置时</td></tr>
|
||||
<tr><td><code>make oldconfig</code></td><td>在命令行逐项对比 <code>.config</code> 与最新 Kconfig:保留原值、提示新增项、删除废弃项</td><td>快速同步,只对新增选项发出提示;无需界面</td><td>自动化脚本或快速同步配置时</td></tr>
|
||||
<tr><td><code>make defconfig</code></td><td>忽略当前 <code>.config</code>,直接加载架构/板级目录下的默认配置(<code>defconfig</code>)</td><td>一键生成官方/平台推荐的「干净」配置</td><td>想重置到官方默认或重新开始时</td></tr>
|
||||
</tbody></table>
|
||||
<h3 id="bian-yi-pei-zhi-cai-dan-shuo-ming-bu-fen"><strong>编译配置菜单说明(部分)</strong></h3>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>Target System (Broadcom BCM27xx) # 选择处理器架构
|
||||
</span><span>└── Subtarget (BCM2711 boards (64 bit)) # 选择处理器
|
||||
</span><span> └── Target Profile (Raspberry Pi 4B/400/4CM (64bit)) # 预制配置文件
|
||||
</span><span> └── Target Images # 固件映像设置
|
||||
</span><span> └── ramdisk # 内存盘
|
||||
</span><span> ├── Compression # 压缩等级 (none 表示不压缩)
|
||||
</span><span> ├── Root filesystem archives # 根文件系统存档类型
|
||||
</span><span> │ ├── cpio.gz
|
||||
</span><span> │ └── tar.gz
|
||||
</span><span> ├── Root filesystem images # 根文件系统格式
|
||||
</span><span> │ ├── ext4 # 适用于大容量闪存
|
||||
</span><span> │ ├── squashfs # 适用于小容量闪存
|
||||
</span><span> │ └── Gzip images # Gzip 存档
|
||||
</span><span> └── Image Options
|
||||
</span><span> ├── Kernel partition size # 内核分区大小
|
||||
</span><span> ├── Root filesystem partition size # 跟文件系统分区大小
|
||||
</span><span> └── Make /var persistent # 持久化 /var
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>Target System (x86) # 选择目标平台
|
||||
</span><span>└── Subtarget (x86_64) # 选择 64-bit 子架构
|
||||
</span><span> └── Target Profile (Generic) # “Generic” 表示通用 x86_64 设备
|
||||
</span><span> └── Target Images # 固件镜像设置
|
||||
</span><span> ├── ramdisk # 可选内存盘镜像
|
||||
</span><span> │ ├── Compression # 压缩类型(如 none 表示无压缩)
|
||||
</span><span> │ ├── Root filesystem archives # 压缩存档:cpio.gz 或 tar.gz
|
||||
</span><span> │ └── Root filesystem images # 文件系统镜像:ext4、squashfs、Gzip
|
||||
</span><span> └── Image Options # 镜像选项
|
||||
</span><span> ├── Kernel partition size # 内核分配分区大小
|
||||
</span><span> ├── Root filesystem partition size # 根文件系统分区大小
|
||||
</span><span> └── Make /var persistent # 是否保留 /var 持久化
|
||||
</span><span>
|
||||
</span><span>Enable experimental features by default # 默认启用实验性功能
|
||||
</span><span>Global build settings # 全局编译设置
|
||||
</span><span>Advanced configuration options (for developers) # 高级选项(仅供开发者)
|
||||
</span><span>Build the OpenWrt Image Builder # 编译 OpenWrt 镜像编译器
|
||||
</span><span>Build the OpenWrt SDK # 编译 OpenWrt SDK
|
||||
</span><span>Package the OpenWrt-based Toolchain # 打包 OpenWrt 工具链
|
||||
</span><span>Image configuration # 镜像选项
|
||||
</span><span>Global build settings # 全局构建设置
|
||||
</span><span>Advanced configuration options (for developers) # 开发者高级选项
|
||||
</span><span>Build the OpenWrt Image Builder # 编译镜像构建器
|
||||
</span><span>Build the OpenWrt SDK # 构建交叉编译 SDK
|
||||
</span><span>Package the OpenWrt‑based Toolchain # 打包 OpenWrt 工具链
|
||||
</span><span>Image configuration # 镜像总体配置页面
|
||||
</span><span>
|
||||
</span><span>Base system # 基本组件
|
||||
</span><span>Administration # 管理员工具
|
||||
</span><span>Boot Loaders # 引导程序
|
||||
</span><span>Development # 开发者工具
|
||||
</span><span>Extra packages # 额外包
|
||||
</span><span>Firmware # 固件工具
|
||||
</span><span>Fonts # 字体
|
||||
</span><span>Kernel modules # 内核模块
|
||||
</span><span>Languages # 额外的语言 (Python3, PHP, NodeJS 等)
|
||||
</span><span>Libraries # 系统库
|
||||
</span><span>LuCI # LuCI 插件(一般只需修改应用和主题)
|
||||
</span><span>Base system # 系统基础组件
|
||||
</span><span>Administration # 管理工具(如 ssh、管理员脚本)
|
||||
</span><span>Boot Loaders # 引导程序(如 grub、syslinux)
|
||||
</span><span>Development # 编译/调试辅助工具
|
||||
</span><span>Extra packages # 附加应用(如 wget、curl)
|
||||
</span><span>Firmware # 固件工具
|
||||
</span><span>Fonts # 字体支持
|
||||
</span><span>Kernel modules # x86 内核模块驱动
|
||||
</span><span>Languages # 编程语言包(如 Python3、Node.js)
|
||||
</span><span>Libraries # 系统库依赖
|
||||
</span><span>LuCI # Web UI 前端
|
||||
</span><span>└── Collections
|
||||
</span><span>└── Modules
|
||||
</span><span>└── Applications
|
||||
</span><span>└── Themes
|
||||
</span><span>└── Protocols
|
||||
</span><span>└── Libraries
|
||||
</span><span>└── default-settings # 默认选项(自动配置语言包)
|
||||
</span><span>└── default‑settings
|
||||
</span><span>
|
||||
</span><span>Mail # 邮件
|
||||
</span><span>Multimedia # 多媒体
|
||||
</span><span>Network # 网络相关
|
||||
</span><span>Sound # 音频
|
||||
</span><span>Utilities # 各类实用软件(比如 VIM)
|
||||
</span><span>Xorg
|
||||
</span></code></pre>
|
||||
<h3 id="cai-dan-xuan-xiang-shuo-ming"><strong>菜单选项说明</strong></h3>
|
||||
<p><strong>选择 CPU 类型</strong></p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>Target System (x86) --> # 软路由选择 x86,硬路由根据型号厂家自行选择
|
||||
</span><span>Mail # 邮件客户端
|
||||
</span><span>Multimedia # 媒体工具(如 ffmpeg)
|
||||
</span><span>Network # 网络功能(如 openvpn、wireguard)
|
||||
</span><span>Sound # 音频相关软件
|
||||
</span><span>Utilities # 常用实用程序(如 vim、htop)
|
||||
</span><span>Xorg # 桌面环境支持(X11 图形系统)
|
||||
</span><span>
|
||||
</span><span>Subtarget (x86_64) --> # CPU 子选项
|
||||
</span><span>
|
||||
</span><span>Target Profile (Generic x86/64) --> # 厂家具体型号
|
||||
</span></code></pre>
|
||||
<p><strong>设置镜像编译的格式(squashfs,ext4)</strong></p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>Target Images --> # 默认 squashfs
|
||||
</span></code></pre>
|
||||
<p><strong>添加较多插件时,为了避免空间不足,建议修改下面两项默认大小(x86/64)</strong></p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>Target Images --> (16) Kernel partition size (in MB) # 默认是16,建议修改为256
|
||||
</span></code></pre>
|
||||
<p><strong>开启 IPv6 支持</strong></p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>Extra packages --> ipv6helper(选定这个后,下面几项会自动选择)
|
||||
</span></code></pre>
|
||||
<p><strong>开启适用于 VMware 的 VMware Tools</strong></p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>Utilities --> open-vm-tools
|
||||
</span><span>
|
||||
</span><span>Utilities --> open-vm-tools-fuse
|
||||
</span></code></pre>
|
||||
<p><strong>选择插件</strong></p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>LuCI --> Applications # 根据需要选择,* 代表编入固件,M 表示编译成模块或者IPK包,为空表示不编译
|
||||
</span></code></pre>
|
||||
<p><strong>选择主题</strong></p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>LuCI --> Themes # 选择喜欢的主题,可以选多个
|
||||
</span></code></pre>
|
||||
<p>配置完成后使用编译菜单底部的 Save 保存,然后退出菜单 Exit,开始下载软件包</p>
|
||||
<ul>
|
||||
<li><strong>预下载编译所需的软件包</strong></li>
|
||||
</ul>
|
||||
@ -461,103 +493,64 @@
|
||||
<p>检查文件完整性命令可以列出下载不完整的文件,小于1k的文件属于下载不完整,如果存在则用下面的命令删除,然后重新下载编译所需的软件包,再次检查.确认所有文件完整可大大提高编译成功率,避免浪费时间</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>find dl -size -1024c -exec rm -f {} \;
|
||||
</span></code></pre>
|
||||
<p>最后编译固件,编译完成后输出路径是 <strong>bin/targets</strong>,默认密码是 <strong>password</strong>.</p>
|
||||
<ul>
|
||||
<li><strong>编译固件(-j 后面是线程数,首次编译推荐用单线程)</strong></li>
|
||||
<li><strong>最后编译固件(-j 后面是线程数,首次编译推荐用单线程)编译完成后输出路径是bin/targets.</strong></li>
|
||||
</ul>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>make V=s -j1
|
||||
</span><span>
|
||||
</span><span>或者使用 make world -j1 V=s 2>&1 | tee world_debug.log
|
||||
</span><span>
|
||||
</span><span>如果报错可查看 grep -E "(error|fatal|Cannot install package)" world_debug.log -n
|
||||
</span></code></pre>
|
||||
<ul>
|
||||
<li><strong>二次编译</strong></li>
|
||||
</ul>
|
||||
<p>拉取最新 OpenWrt 源码和更新 feeds 源中的软件包源码</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>cd lede
|
||||
</span><span>
|
||||
</span><span>git pull
|
||||
</span><span>
|
||||
</span><span>./scripts/feeds update -a
|
||||
</span><span>
|
||||
</span><span>./scripts/feeds install -a
|
||||
<table><thead><tr><th>make层级</th><th>目录示例</th><th>说明</th></tr></thead><tbody>
|
||||
<tr><td>make[1]</td><td>顶层 Makefile</td><td>解析依赖,调度模块</td></tr>
|
||||
<tr><td>make[2]</td><td><code>tools/</code></td><td>编译辅助工具</td></tr>
|
||||
<tr><td>make[2]</td><td><code>toolchain/</code></td><td>编译交叉编译工具链</td></tr>
|
||||
<tr><td>make[2]</td><td><code>target/linux/</code></td><td>编译内核及设备树</td></tr>
|
||||
<tr><td>make[2]</td><td><code>package/</code></td><td>进入包管理,调度包构建</td></tr>
|
||||
<tr><td>make[3]</td><td><code>package/libs/libc</code></td><td>单个包的 Makefile</td></tr>
|
||||
<tr><td>make[3]</td><td><code>package/utils/busybox</code></td><td>单个包的 Makefile</td></tr>
|
||||
<tr><td>make[4]</td><td><code>build_dir/target-...</code></td><td>包源码目录,运行源码的 make</td></tr>
|
||||
<tr><td>make[4]</td><td><code>build_dir/target-linux-...</code></td><td>内核源码目录</td></tr>
|
||||
</tbody></table>
|
||||
<h2 id="er-ci-bian-yi">二次编译</h2>
|
||||
<table><thead><tr><th>命令</th><th>清除内容</th><th>保留内容</th><th>适用场景</th></tr></thead><tbody>
|
||||
<tr><td><code>make clean</code></td><td>删除 <code>bin/</code> 镜像、<code>build_dir/</code> 编译产物</td><td><code>.config</code>、<code>staging_dir/</code>、<code>toolchain/</code> 等</td><td>小修改后重建镜像,速度快,常用于增量编译。</td></tr>
|
||||
<tr><td><code>make dirclean</code></td><td>和 <code>make clean</code> 一样,还删除 <code>staging_dir/</code>、<code>toolchain/</code>、<code>logs</code></td><td><code>.config</code></td><td>彻底重建交叉编译环境,适合更改编译配置如 <code>.config</code>、feeds 等。</td></tr>
|
||||
<tr><td><code>make distclean</code></td><td>删除 <code>make dirclean</code> 的所有内容 + feeds 下载文件 + <code>.config</code>、patch 等所有状态</td><td>只有源码目录保持不变</td><td>专用于回到一个“零配置、重做一切”的状态,完全从头开始构建。</td></tr>
|
||||
</tbody></table>
|
||||
<p>恢复所有修改(包括未跟踪文件):</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>git clean -fd
|
||||
</span><span>git restore --source=v24.10.2 --staged --worktree .
|
||||
</span></code></pre>
|
||||
<p>清除旧的编译产物和目录(可选)</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>make clean
|
||||
<h2 id="dwrt-fang-an">Dwrt 方案</h2>
|
||||
<table><thead><tr><th>作用</th><th>组件</th></tr></thead><tbody>
|
||||
<tr><td>主题</td><td>argon</td></tr>
|
||||
<tr><td>Shell</td><td>bash</td></tr>
|
||||
<tr><td>SSH 服务器</td><td>dropbear</td></tr>
|
||||
<tr><td>Web 服务器</td><td>uhttpd</td></tr>
|
||||
<tr><td>DNS/DHCP 服务</td><td>dnsmasq‑full</td></tr>
|
||||
<tr><td>加密库</td><td>openssl</td></tr>
|
||||
<tr><td>压缩算法</td><td>zram+zstd</td></tr>
|
||||
<tr><td>拥塞控制</td><td>bbr</td></tr>
|
||||
<tr><td>防火墙</td><td>nftables + iptables</td></tr>
|
||||
<tr><td>调度模块</td><td>BPF + kmod-sched-xxx</td></tr>
|
||||
<tr><td>时间同步</td><td>ntpd-full</td></tr>
|
||||
<tr><td>文本编辑</td><td>vim-full vim-runtime</td></tr>
|
||||
<tr><td>编译优化</td><td>LTO + O3</td></tr>
|
||||
</tbody></table>
|
||||
<p>要启用的软件包:</p>
|
||||
<p><strong>base</strong></p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>autocore base-files bash block-mount ca-bundle coremark curl dnsmasq-full dropbear ds-lite e2fsprogs fdisk firewall4 fstools grub2-bios-setup htop kmod-8139cp kmod-8139too kmod-amazon-ena kmod-amd-xgbe kmod-atlantic kmod-bnx2 kmod-bnx2x kmod-button-hotplug kmod-drm-amdgpu kmod-drm-i915 kmod-dwmac-intel kmod-e1000 kmod-e1000e kmod-forcedeth kmod-fs-f2fs kmod-fs-vfat kmod-i40e kmod-iavf kmod-igb kmod-igbvf kmod-igc kmod-ixgbe kmod-ixgbevf kmod-lib-zstd kmod-mlx4-core kmod-mlx5-core kmod-mmc kmod-pcnet32 kmod-phy-broadcom kmod-r8101 kmod-r8125 kmod-r8126 kmod-r8168 kmod-sdhci kmod-tcp-bbr kmod-tg3 kmod-tulip kmod-usb-hid kmod-vmxnet3 libc libgcc libustream-mbedtls lm-sensors-detect logd lsblk luci-app-fan luci-app-filemanager luci-app-firewall luci-app-log-viewer luci-app-package-manager luci-app-syscontrol luci-app-upnp luci-base luci-compat luci-lib-fs luci-lib-ipkg mkf2fs mtd nano netifd odhcp6c odhcpd-ipv6only openssh-sftp-server opkg partx-utils pciutils ppp ppp-mod-pppoe resolveip swconfig uci uclient-fetch urandom-seed urngd usbutils wget-ssl zram-swap
|
||||
</span></code></pre>
|
||||
<ul>
|
||||
<li>源码有大规模更新或者内核更新后执行,以保证编译质量;此操作会删除 /bin 和 /build_dir 目录中的文件</li>
|
||||
</ul>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>make dirclean
|
||||
<p><strong>cli</strong></p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>btop iperf3 tcpdump
|
||||
</span></code></pre>
|
||||
<blockquote>
|
||||
<p>更换架构编译前必须执行</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>此操作会删除 /bin 和 /build_dir 目录的中的文件(make clean),以及 /staging_dir、/toolchain、/tmp 和 /logs 中的文件</p>
|
||||
</blockquote>
|
||||
<p>同首次编译,多线程编译失败后自动进入单线程编译,失败则输出详细日志</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>make defconfig
|
||||
</span><span>
|
||||
</span><span>make download -j8
|
||||
</span><span>
|
||||
</span><span>find dl -size -1024c -exec ls -l {} \;
|
||||
</span><span>
|
||||
</span><span>make -j$(nproc) || make -j1 || make -j1 V=s
|
||||
<p><strong>luci</strong></p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>luci-app-argon luci-app-upnp luci-app-ttyd luci-app-eqosplus luci-app-timecontrol luci-app-parentcontrol luci-app-homeproxy luci-app-daed
|
||||
</span></code></pre>
|
||||
<h3 id="ru-guo-xu-yao-zhong-xin-pei-zhi">如果需要重新配置</h3>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>rm -rf ./tmp && rm -rf .config # 清除临时文件和编译配置文件
|
||||
</span><span>
|
||||
</span><span>make menuconfig
|
||||
</span><span>
|
||||
</span><span>make download -j8
|
||||
</span><span>
|
||||
</span><span>find dl -size -1024c -exec ls -l {} \;
|
||||
</span><span>
|
||||
</span><span>make -j$(nproc) || make -j1 || make -j1 V=s
|
||||
</span></code></pre>
|
||||
<h2 id="armping-tai-an-zhuang-openwrt">Arm平台安装OpenWrt:</h2>
|
||||
<p>相比X86平台,arm架构的设备兼容性不高,不能随便找一个包就能安装。以下是一般步骤:</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>首先得知道你的设备的CPU,比如ipq40XX系列,然后在对应的<a href="https://archive.openwrt.org/releases/23.05.4/targets/">仓库</a>查看并下载包体。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>当然也可以在<a href="https://firmware-selector.openwrt.org/">这里</a>直接下载相关型号对应的固件,其中 Sysupgrade 映像是用来更新现有运行 OpenWrt 的设备,使用 Factory 映像在首次刷机时刷入。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>随后开启Telnet或者SSH或者TTL串口连接到路由器,将对应的Uboot刷入,如果没有适配的包就无法刷openwrt。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>通过Uboot的网络界面刷入Factory包,随后就可以在后台(如192.168.1.1)进入openwrt的管理界面。</p>
|
||||
</li>
|
||||
</ul>
|
||||
<h2 id="zai-ubuntushang-dan-du-bian-yi-openwrtde-ipkbao">在ubuntu上单独编译openwrt的ipk包</h2>
|
||||
<p>这里以ubuntu环境为例,我们假设你有一台虚拟机或者WSL。</p>
|
||||
<blockquote>
|
||||
<p><code>注意编译不能使用Root用户!</code></p>
|
||||
</blockquote>
|
||||
<p><strong>随后安装编译依赖的各个包:</strong></p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>sudo apt update
|
||||
</span><span>sudo apt install -y \
|
||||
</span><span> ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \
|
||||
</span><span> bzip2 ccache clang cmake cpio curl device-tree-compiler diffutils diffstat findutils flex gawk \
|
||||
</span><span> gcc-multilib g++-multilib git gettext gperf grep haveged help2man intltool \
|
||||
</span><span> libelf-dev libfuse-dev libgmp3-dev libgl1-mesa-dev libgraphene-1.0-dev libglib2.0-dev \
|
||||
</span><span> libltdl-dev libmpc-dev libmpfr-dev libncurses-dev libpython3-dev libreadline-dev libssl-dev \
|
||||
</span><span> libtool lrzsz make mesa-common-dev msmtp ninja-build p7zip p7zip-full patch pkgconf \
|
||||
</span><span> perl python-is-python3 python3 python3-dev python3-distutils-extra python3-pip python3-pyelftools \
|
||||
</span><span> python3-setuptools qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs \
|
||||
</span><span> upx-ucl unzip vim wget gnu-which xmlto xxd zlib1g-dev genisoimage llvm llvm-runtime docutils-common \
|
||||
</span><span> ecj fastjar java-wrappers libeclipse-jdt-core-java libgnutls-dane0t64 \
|
||||
</span><span> libgnutls-openssl27t64 libgnutls28-dev libidn2-dev libp11-kit-dev libtasn1-6-dev libtasn1-doc \
|
||||
</span><span> libunbound8 libyaml-dev lld lld-18 nettle-dev python3-docutils python3-ply python3-roman re2c
|
||||
</span></code></pre>
|
||||
<p>随后下载我们<strong>刷入openwrt的对应的SDK包</strong>,如</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>git clone https://github.com/immortalwrt/immortalwrt.git
|
||||
</span></code></pre>
|
||||
<p><strong>下载和安装仓库信息</strong></p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>./scripts/feeds update -a
|
||||
</span><span>./scripts/feeds install -a
|
||||
</span></code></pre>
|
||||
<p><strong>下载并选中我们需要编译的包,这里以inyn为例:</strong></p>
|
||||
<h2 id="dan-du-bian-yi-openwrtde-ipkbao">单独编译openwrt的ipk包</h2>
|
||||
<p><strong>其他步骤同上,下载并选中我们需要编译的包,这里以inyn为例:</strong></p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>git clone https://github.com/diredocks/openwrt-inyn.git ./package/inyn
|
||||
</span><span>make menuconfig
|
||||
</span></code></pre>
|
||||
@ -566,33 +559,6 @@
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>make package/inyn/compile V=s
|
||||
</span><span>## 如果不行则需要先编译工具链,即为 make j=4 ,j为CPU核数
|
||||
</span></code></pre>
|
||||
<h2 id="github-actions-bian-yi-openwrt">Github Actions 编译OpenWrt</h2>
|
||||
<p>Github为我们提供了免费的E5主机用来编译。</p>
|
||||
<ul>
|
||||
<li>
|
||||
<p>首先Fork<a href="https://github.com/hugcabbage/shared-lede">这个仓库</a>,可以看到有许多现成的配置,在<strong>顶栏actions里面可以直接启动一个Workflow</strong>来编译。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>大体架构是选择<strong>源码 -- 机型 -- 版本 -- 插件/主题 -- 配置(IP/密码/Hostname/编译者)</strong>,由一个config文件管理,这个文件在前面也提到过,可以在本地生成并上传;</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>想要什么插件可以直接git clone过来原仓库,如果你想要添加其他架构和设备,这里<strong>使用templet里面的init.toml来创建</strong>,按照类似的格式填好;</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>在actions里面运行produce,注意这需要<strong>GitHub Personal Access Token (PAT)</strong>;如果没有,必须先添加:</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>打开 GitHub,进入<a href="https://github.com/settings/tokens">GitHub Developer Settings</a>点击 “Generate new token (classic)”,<strong>勾选所需权限</strong>(最关键的是 repo 和 workflow):✅ repo(所有子权限)✅ workflow✅ read:packages <strong>Token 过期时间</strong>:选择 “No expiration”(不过期),否则过期后需要重新生成。<strong>点击</strong> “Generate token”
|
||||
<strong>复制 Token</strong>(只显示一次,一定要保存好!)</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>然后添加 <strong>PRODUCE_DEVICE</strong> 到 <strong>GitHub Secrets</strong>,
|
||||
首先进入你的 GitHub 仓库,<code>依次进入:Settings(设置)- Secrets and variables-Actions-New repository secret 名称为PRODUCE_DEVICE</code>,值为粘贴刚刚复制的 GitHub Token,点击 “Add secret” 完成添加。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p>随后<code>在actions里面运行produce</code>,完成后即可出现新架构的编译按钮.</p>
|
||||
</li>
|
||||
</ul>
|
||||
<h2 id="chang-yong-ming-ling">常用命令:</h2>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span># 更新软件列表
|
||||
</span><span>opkg update
|
||||
@ -602,10 +568,19 @@
|
||||
</span><span>
|
||||
</span><span># 如果要更新所有软件,包括 OpenWRT 内核、固件等
|
||||
</span><span>opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade
|
||||
</span><span>
|
||||
</span><span># 固件版本号
|
||||
</span><span>vim /etc/os-release
|
||||
</span><span>
|
||||
</span><span># 脚本&脚注
|
||||
</span><span>vim /etc/openwrt_release
|
||||
</span><span>
|
||||
</span><span># ASCII字符画
|
||||
</span><span>vim /etc/banner
|
||||
</span><span>
|
||||
</span><span># 登录脚本显示
|
||||
</span><span>vim /etc/profile
|
||||
</span></code></pre>
|
||||
<blockquote>
|
||||
<p>新版本的openwrt(24.10)已经改用APK包管理器。</p>
|
||||
</blockquote>
|
||||
<h2 id="chang-yong-ke-xue-cha-jian">常用科学插件</h2>
|
||||
<table><thead><tr><th>特性</th><th>HomeProxy</th><th>OpenClash</th><th>Passwall</th><th>ShellClash</th></tr></thead><tbody>
|
||||
<tr><td><strong>核心</strong></td><td>Sing-box、Xray</td><td>Clash</td><td>Xray、Sing-box</td><td>Clash、Xray、Sing-box</td></tr>
|
||||
|
@ -415,13 +415,6 @@
|
||||
<hr />
|
||||
</div>
|
||||
<div class="pagination__buttons">
|
||||
<span class="button previous">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-7/">
|
||||
<span class="button__icon">←</span>
|
||||
<span class="button__text">Linux之旅(7):系统与终端字体设置</span>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
|
||||
<span class="button next">
|
||||
<a href="https://blog.dich.bid/awesome-pve-mcsm/">
|
||||
|
@ -1,264 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<title>Dich'blog</title>
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
<meta name="robots" content="noodp"/>
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/style.css">
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/color/blue.css">
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/color/background_dark.css">
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/font-hack-subset.css">
|
||||
|
||||
<meta name="description" content="">
|
||||
|
||||
<meta property="og:description" content="">
|
||||
<meta property="og:title" content="Dich'blog">
|
||||
<meta property="og:type" content="article">
|
||||
<meta property="og:url" content="https://blog.dich.bid/learn-linux-for-pc-1/">
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:description" content="">
|
||||
<meta name="twitter:title" content="Dich'blog">
|
||||
<meta property="twitter:domain" content="blog.dich.bid">
|
||||
<meta property="twitter:url" content="https://blog.dich.bid/learn-linux-for-pc-1/">
|
||||
|
||||
<link rel="alternate" type="application/atom+xml" title="Dich'blog Atom Feed" href="https://blog.dich.bid/atom.xml" />
|
||||
|
||||
|
||||
<link rel="icon" type="image/png" href=/dich.webp />
|
||||
|
||||
<!-- ✅ Added center alignment styles -->
|
||||
<style>
|
||||
.footer {
|
||||
text-align: center;
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
.footer__inner {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.copyright {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="">
|
||||
<div class="container">
|
||||
|
||||
<header class="header">
|
||||
<div class="header__inner">
|
||||
<div class="header__logo">
|
||||
|
||||
<a href="https://blog.dich.bid" style="text-decoration: none;">
|
||||
<div class="logo">
|
||||
|
||||
Dich'blog
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<nav class="menu">
|
||||
<ul class="menu__inner">
|
||||
<li class="active"><a href="https://blog.dich.bid">blog</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/archive">archive</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/tags">tags</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/weekly">weekly</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/search">search</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/about">about me</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/links">links</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/atom.xml">rss</a></li>
|
||||
|
||||
<li><a href="https://github.com/Dichgrem" target="_blank" rel="noopener noreferrer">github</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
|
||||
<div class="content">
|
||||
|
||||
<div class="post">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/learn-linux-for-pc-1/">Linux之旅(1):构成与发行版</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
2023-07-20
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<span class="post-tags-inline">
|
||||
:: tags:
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
|
||||
<div class="post-content">
|
||||
<p>前言 Linux 作为一款强大、灵活且免费的操作系统,吸引了越来越多的用户。然而,对于初学者来说,Linux 可能显得有些陌生,甚至有些令人望而生畏。本文旨在为那些刚踏入 Linux 世界的新手提供一份指南,帮助他们更好地了解、使用这个令人着迷的操作系统。我们将探讨Linux的基本概念,解释为何选择Linux,深入剖析其主要构成要素以及不同的发行版之间的差异。</p>
|
||||
<span id="continue-reading"></span><h2 id="yi-shen-me-shi-linux">一.什么是Linux?</h2>
|
||||
<p>Linux 是一种开源的类 UNIX 操作系统内核。它由芬兰的 Linus Torvalds 于1991年开始开发,是一个自由、免费的操作系统。Linux 内核是操作系统的核心,负责管理硬件资源,并提供各种系统服务。与 Windows 和 macOS 等操作系统不同,Linux 的源代码对所有人开放,任何人都可以查看、修改和重新分发。这使得 Linux 具有极高的自由度和可定制性,用户可以根据自己的需求和偏好来定制操作系统。Linux 广泛应用于各种设备,包括个人计算机、服务器、手机、嵌入式系统等,是一个功能强大且灵活多样的操作系统。</p>
|
||||
<h2 id="er-wei-shen-me-yao-yong-linux">二.为什么要用Linux?</h2>
|
||||
<ol>
|
||||
<li>
|
||||
<p><strong>开源免费</strong>:Linux 是完全开源的,用户可以免费使用和修改源代码。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>稳定性和安全性</strong>:Linux 系统以其稳定性和安全性而闻名,适合长时间运行的服务。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>灵活性和可定制性</strong>:用户可以根据需要定制 Linux 系统。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>广泛的软件支持</strong>:有大量的开源软件可供选择,满足不同需求。</p>
|
||||
</li>
|
||||
</ol>
|
||||
<blockquote>
|
||||
<p>Liunx可以用来玩游戏吗?
|
||||
实际上著名的 Steam Deck 的系统就是基于Arch linux 的。对于个人使用而言,现在有不少原生支持linux 的游戏;也可以使用Wine来运行Windows下的游戏。</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>Linux上软件会不会太少?
|
||||
参见 <a href="https://blog.dich.ink/open-source-software">常用跨平台开源软件</a>一文,在社区的努力下如今软件生态已经非常丰富,你也可以使用如Flatpak等商店安装软件,或者直接使用Wine。如果有不得不在Windows下使用的软件,可以装双系统。</p>
|
||||
</blockquote>
|
||||
<h2 id="san-linuxde-zhu-yao-gou-cheng">三.Linux的主要构成</h2>
|
||||
<p>Linux操作系统主要由以下几个部分组成:</p>
|
||||
<ol>
|
||||
<li>
|
||||
<p><strong>内核</strong>:操作系统的核心,负责管理系统资源。如Zen内核,LTS内核等。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>Shell</strong>:命令行界面,用户通过它与系统交互,如Bash,Zsh等。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>图形用户界面(GUI)</strong>:提供图形化操作界面,如GNOME、KDE、XFCE等。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>文件系统</strong>:如ext4、Btrfs等,用于组织和管理磁盘上的文件。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>系统库</strong>:为应用程序提供运行时支持。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>应用程序</strong>:用户可以直接使用的软件,如文本编辑器、网页浏览器等。其中也有著名的GNU工具,如Vim,GCC等。</p>
|
||||
</li>
|
||||
</ol>
|
||||
<h2 id="si-xuan-ze-linuxfa-xing-ban">四.选择Linux发行版</h2>
|
||||
<p>从上文可以发现,选择Linux发行版实际上是在选择 <strong>内核/包管理器/图形界面</strong> 等组件的排列组合。其中最主要的因素是包管理器。</p>
|
||||
<p>Linux有许多不同的发行版,但大致可以分为几个系:</p>
|
||||
<p><strong>Debian系:</strong>
|
||||
Debian:Debian以稳定性,安全性和轻量级著称,适合用于服务器和桌面环境。我们常说的Ubuntu就是基于Debian的发行版,注重用户友好性和易用性。它提供了多种桌面环境选择,以及许多现成的软件包。</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>APT(Advanced Package Tool)是Debian系发行版的主要包管理器。它使用命令行工具如apt-get、aptitude等来管理软件包。
|
||||
</span></code></pre>
|
||||
<p><strong>Red Hat系:</strong></p>
|
||||
<ul>
|
||||
<li>Red Hat Enterprise Linux(RHEL):RHEL是一款商业发行版,专注于企业级应用和支持。它提供了长期支持和专业技术支持服务,适用于企业级服务器和工作站。</li>
|
||||
<li>CentOS:CentOS是基于RHEL源代码编译而成的免费发行版,与RHEL兼容并提供类似的功能和性能。它也提供了长期支持版本和稳定性较高的特点。</li>
|
||||
<li>Fedora:Fedora是由Red Hat支持的社区驱动的发行版,注重提供最新的软件特性和技术。它适用于开发者和技术爱好者,提供了稳定的发布周期和丰富的软件包。</li>
|
||||
</ul>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>YUM(Yellowdog Updater, Modified)是Red Hat系发行版的主要包管理器。最近的版本也开始采用DNF(Dandified YUM)。
|
||||
</span></code></pre>
|
||||
<p><strong>Arch系:</strong>
|
||||
Arch Linux:Arch Linux是一个简洁、轻量级且灵活的发行版,注重简洁性和滚动更新。它采用“滚动发布”的方式,用户可以通过自定义安装来构建自己的系统,适合有一定Linux经验的用户。</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>Pacman(Package Manager)是Arch Linux的主要包管理器。它使用简洁的命令来管理软件包,如pacman -S安装软件包、pacman -Syu更新系统等。
|
||||
</span></code></pre>
|
||||
<p><strong>Gentoo系:</strong>
|
||||
Gentoo:Gentoo是一个源码驱动的发行版,用户可以通过源代码自定义编译软件包以满足自己的需求。它注重性能和灵活性,适合高级用户和技术爱好者。</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>Portage是Gentoo的包管理器,它是一个源代码驱动的包管理器,允许用户从源代码构建和安装软件包。
|
||||
</span></code></pre>
|
||||
<p>除了以上列举的包管理器外,还有其他一些较为特殊的包管理器,如Slackware系的pkgtool、SUSE系的zypper等。</p>
|
||||
<p>对于个人使用而言,我个人建议新手使用Ubuntu,有比较易用的界面和完善的资料参考;如果你是一个系统极客,可以使用Arch linux 或者 NixOS。</p>
|
||||
<h2 id="wu-ge-ren-ri-chang-shi-yong-xu-yao-zhu-yi-shen-me">五.个人日常使用需要注意什么?</h2>
|
||||
<ol>
|
||||
<li>
|
||||
<p><strong>学习命令行</strong>:命令行是Linux的强大工具,学习基本命令可以提高效率。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>选择合适的发行版</strong>:根据个人需求和技术水平选择适合的发行版。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>系统备份</strong>:定期备份重要数据,以防意外丢失。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>软件管理</strong>:了解如何安装、更新和卸载软件。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>安全设置</strong>:设置强密码,定期更新系统以修复安全漏洞。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>社区参与</strong>:Linux社区非常活跃,遇到问题可以寻求社区帮助。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>硬件兼容性</strong>:检查你的硬件是否与选择的Linux发行版兼容。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>驱动程序</strong>:确保你的硬件设备有可用的驱动程序,以避免兼容性问题。</p>
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="pagination">
|
||||
<div class="pagination__title">
|
||||
<span class="pagination__title-h">Thanks for reading! Read other posts?</span>
|
||||
<hr />
|
||||
</div>
|
||||
<div class="pagination__buttons">
|
||||
|
||||
<span class="button next">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-2/">
|
||||
<span class="button__text">Linux之旅(2):FHS与目录结构</span>
|
||||
<span class="button__icon">→</span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<footer class="footer">
|
||||
<div class="footer__inner">
|
||||
<div class="copyright">
|
||||
<span>©
|
||||
2025
|
||||
Dichgrem</span>
|
||||
<span class="copyright-theme">
|
||||
<span class="copyright-theme-sep"> :: CC BY-SA 4.0 :: A friend comes from distant lands</span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,282 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<title>Dich'blog</title>
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
<meta name="robots" content="noodp"/>
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/style.css">
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/color/blue.css">
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/color/background_dark.css">
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/font-hack-subset.css">
|
||||
|
||||
<meta name="description" content="">
|
||||
|
||||
<meta property="og:description" content="">
|
||||
<meta property="og:title" content="Dich'blog">
|
||||
<meta property="og:type" content="article">
|
||||
<meta property="og:url" content="https://blog.dich.bid/learn-linux-for-pc-2/">
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:description" content="">
|
||||
<meta name="twitter:title" content="Dich'blog">
|
||||
<meta property="twitter:domain" content="blog.dich.bid">
|
||||
<meta property="twitter:url" content="https://blog.dich.bid/learn-linux-for-pc-2/">
|
||||
|
||||
<link rel="alternate" type="application/atom+xml" title="Dich'blog Atom Feed" href="https://blog.dich.bid/atom.xml" />
|
||||
|
||||
|
||||
<link rel="icon" type="image/png" href=/dich.webp />
|
||||
|
||||
<!-- ✅ Added center alignment styles -->
|
||||
<style>
|
||||
.footer {
|
||||
text-align: center;
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
.footer__inner {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.copyright {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="">
|
||||
<div class="container">
|
||||
|
||||
<header class="header">
|
||||
<div class="header__inner">
|
||||
<div class="header__logo">
|
||||
|
||||
<a href="https://blog.dich.bid" style="text-decoration: none;">
|
||||
<div class="logo">
|
||||
|
||||
Dich'blog
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<nav class="menu">
|
||||
<ul class="menu__inner">
|
||||
<li class="active"><a href="https://blog.dich.bid">blog</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/archive">archive</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/tags">tags</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/weekly">weekly</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/search">search</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/about">about me</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/links">links</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/atom.xml">rss</a></li>
|
||||
|
||||
<li><a href="https://github.com/Dichgrem" target="_blank" rel="noopener noreferrer">github</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
|
||||
<div class="content">
|
||||
|
||||
<div class="post">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/learn-linux-for-pc-2/">Linux之旅(2):FHS与目录结构</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
2023-07-21
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<span class="post-tags-inline">
|
||||
:: tags:
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
|
||||
<div class="post-content">
|
||||
<p>前言 在Linux世界中,Filesystem Hierarchy Standard(FHS)是一座引导我们进入系统核心的桥梁,它定义了Linux系统中目录结构的规范与作用,为我们提供了一张清晰的地图,指引我们轻松管理和理解系统。本文将深入探讨FHS规范与Linux系统目录结构,解释各个目录的用途与功能,帮助我们更好地理解和利用Linux系统。</p>
|
||||
<span id="continue-reading"></span><h2 id="yi-ren-shi-fhs">一.认识FHS</h2>
|
||||
<p>FHS是Filesystem Hierarchy Standard(文件系统层次结构标准)的缩写。它是一个定义了Linux系统中目录结构和各个目录作用的规范。FHS规定了Linux系统中各个目录的用途和预期内容,以便确保不同Linux发行版之间的兼容性,并使得用户能够更轻松地理解和管理系统。</p>
|
||||
<p>FHS规范最初由Linux基金会(Linux Foundation)和自由软件基金会(Free Software Foundation)共同发布,并经过多次修订和更新。该规范不仅对Linux系统本身有用,也适用于其他类UNIX操作系统。</p>
|
||||
<p>FHS规范定义了一些基本的目录,如/bin、/boot、/dev等,并规定了每个目录的作用和预期内容。这样做有助于系统管理员和开发人员更好地组织和管理文件系统,并使得用户能够更轻松地找到所需的文件和数据。</p>
|
||||
<h2 id="er-chang-jian-mu-lu-jie-gou">二.常见目录结构</h2>
|
||||
<p>在刚刚由Windows切换至Linux时,往往会对目录感到不解,不知道安装的软件放在哪个目录之下?</p>
|
||||
<p>以下是对Linux系统目录结构的详细说明:</p>
|
||||
<ul>
|
||||
<li><strong>/(根目录)</strong>:
|
||||
根目录是整个文件系统的起点,包含了系统中所有其他目录和文件。在Linux系统中,根目录被表示为/。</li>
|
||||
<li><strong>/bin(二进制文件)</strong>:
|
||||
/bin目录存放着一些最基本的系统命令,如ls、cp、mv等,这些命令通常被所有用户使用。</li>
|
||||
<li><strong>/boot(引导文件)</strong>:
|
||||
/boot目录存放着启动Linux系统所需的引导文件,如内核映像(vmlinuz)、引导加载程序(boot loader)配置文件(如GRUB配置文件)等。</li>
|
||||
<li><strong>/dev(设备文件)</strong>:
|
||||
/dev目录包含了系统中所有设备的特殊文件,如硬盘、键盘、鼠标等。在Linux中,一切皆文件,设备被抽象为文件,通过/dev目录中的特殊文件来表示。</li>
|
||||
<li><strong>/etc(配置文件)</strong>:
|
||||
/etc目录包含了系统的配置文件,如网络配置、用户账户信息、服务配置等。这些配置文件通常以纯文本的形式存在,可以由系统管理员进行编辑和修改。</li>
|
||||
<li><strong>/home(用户主目录)</strong>:
|
||||
/home目录是系统中所有普通用户的主目录所在地,每个用户通常都有一个对应的子目录,用于存放用户的个人文件和数据。</li>
|
||||
<li><strong>/lib(库文件)</strong>:
|
||||
/lib目录存放着系统所需的共享库文件,这些库文件包含了一些程序运行所需的函数和数据,为程序提供了基本的支持。</li>
|
||||
<li><strong>/mnt(挂载点)</strong>:
|
||||
/mnt目录用于挂载临时文件系统,如光盘、移动硬盘等。系统管理员可以将其他设备或文件系统挂载到/mnt目录下,以便访问其中的文件和数据。</li>
|
||||
<li><strong>/opt(可选软件包)</strong>:
|
||||
/opt目录用于存放一些可选的软件包和应用程序,这些软件包通常不属于Linux发行版的默认安装范围,但可以被用户自行安装和管理。</li>
|
||||
<li><strong>/proc(进程信息)</strong>:
|
||||
/proc目录是一个虚拟的文件系统,包含了系统运行时的各种进程信息和系统状态信息。用户可以通过读取/proc目录中的特殊文件来获取系统信息。</li>
|
||||
<li><strong>/sbin(系统命令)</strong>:
|
||||
/sbin目录存放着一些系统管理和维护命令,这些命令通常只能由超级用户(root)执行,用于系统的管理和维护。</li>
|
||||
<li><strong>/srv(服务数据)</strong>:
|
||||
/srv目录用于存放一些服务相关的数据文件,如Web服务器的网站数据、FTP服务器的文件等。每个服务通常都会有一个对应的子目录。</li>
|
||||
<li><strong>/tmp(临时文件)</strong>:
|
||||
/tmp目录用于存放临时文件和临时数据,这些文件通常在系统重启时会被删除。任何用户都可以在/tmp目录下创建临时文件。</li>
|
||||
<li><strong>/usr(用户程序)</strong>:
|
||||
/usr目录包含了系统中大部分用户可用的程序和文件,如用户应用程序、共享库文件、文档等。它通常是系统的二级目录,类似于Windows系统中的Program Files目录。</li>
|
||||
<li><strong>/var(可变数据)</strong>:
|
||||
/var目录用于存放系统运行时产生的可变数据,如日志文件、邮件、缓存文件等。这些数据通常会随着系统的运行而不断变化。</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>注意:NixOS不符合FHS标准!</p>
|
||||
</blockquote>
|
||||
<h2 id="san-fen-qu-da-xiao">三.分区大小</h2>
|
||||
<p>对各个分区进行容量分配时,需要根据系统的实际需求和用途来进行规划。一般而言在安装引导时可以选择让程序自动分区。</p>
|
||||
<ul>
|
||||
<li><strong>根目录(/)</strong>:根目录是整个文件系统的起点,通常会分配较大的空间,以确保系统和应用程序有足够的空间运行。建议分配至少20GB的空间给根目录。</li>
|
||||
<li><strong>/home目录</strong>:/home目录用于存放用户的个人文件和数据,因此需要根据用户数量和存储需求来进行容量分配。一般情况下,建议为每个用户分配至少10GB的空间。</li>
|
||||
<li><strong>/var目录</strong>:/var目录用于存放系统运行时产生的可变数据,如日志文件、邮件、缓存文件等。根据系统的运行情况和日志文件的大小来进行容量分配,一般建议分配10-20GB的空间。</li>
|
||||
<li><strong>/tmp目录</strong>:/tmp目录用于存放临时文件和临时数据,通常不需要分配太大的空间。建议分配至少1-2GB的空间给/tmp目录。</li>
|
||||
<li><strong>/boot目录</strong>:/boot目录存放着启动Linux系统所需的引导文件,通常只需要分配几百MB的空间即可。</li>
|
||||
<li><strong>Swap分区</strong>:Swap分区是一种虚拟内存,用于暂时存放不常用的内存数据。当系统内存不足时,Linux会将一部分内存数据移动到Swap分区中,以避免内存耗尽导致系统崩溃。Swap分区的大小通常与系统内存大小有关,一般建议为系统内存的1.5-2倍。例如,如果系统内存为4GB,则建议设置Swap分区大小为6-8GB。</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>这里特别讲讲Swap分区</p>
|
||||
</blockquote>
|
||||
<p>Swap分区可以通过以下几种方式实现:</p>
|
||||
<ul>
|
||||
<li>交换分区(Swap Partition):创建一个独立的交换分区,通常是一个专门的分区,用于存放Swap数据。</li>
|
||||
<li>交换文件(Swap File):创建一个专门的文件用于存放Swap数据,而不是创建独立的分区。这种方式更加灵活,可以根据需要动态调整Swap的大小。</li>
|
||||
<li>Swap大小:Swap的大小应该根据系统的内存大小和使用情况来确定,一般建议为系统内存的1.5-2倍。</li>
|
||||
<li>Swap分区/文件的位置:Swap分区/文件应该位于较快的存储介质上,以确保交换操作的效率。
|
||||
Swap的优先级:如果同时存在多个Swap分区/文件,可以通过设置优先级来指定系统使用的Swap空间。</li>
|
||||
</ul>
|
||||
<h2 id="si-jiang-home-mu-lu-xia-de-wen-jian-jia-gai-wei-ying-wen">四.将 <code>home</code> 目录下的文件夹改为英文</h2>
|
||||
<p>可以使用 <code>xdg-user-dirs-update</code> 工具来更新用户目录为英文版本。你可以按照以下步骤进行:</p>
|
||||
<ol>
|
||||
<li>
|
||||
<p><strong>编辑用户目录配置文件</strong>:
|
||||
打开或创建 <code>~/.config/user-dirs.dirs</code> 文件,用文本编辑器编辑它:</p>
|
||||
<pre data-lang="bash" style="background-color:#151515;color:#e8e8d3;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#ffb964;">nano ~</span><span>/.config/user-dirs.dirs
|
||||
</span></code></pre>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>将目录名称更改为英文</strong>:
|
||||
在该文件中,你可以看到类似以下的条目:</p>
|
||||
<pre data-lang="bash" style="background-color:#151515;color:#e8e8d3;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#ffb964;">XDG_DESKTOP_DIR</span><span>=</span><span style="color:#556633;">"</span><span style="color:#99ad6a;">$</span><span style="color:#ffb964;">HOME</span><span style="color:#99ad6a;">/桌面</span><span style="color:#556633;">"
|
||||
</span><span style="color:#ffb964;">XDG_DOWNLOAD_DIR</span><span>=</span><span style="color:#556633;">"</span><span style="color:#99ad6a;">$</span><span style="color:#ffb964;">HOME</span><span style="color:#99ad6a;">/下载</span><span style="color:#556633;">"
|
||||
</span><span style="color:#ffb964;">XDG_DOCUMENTS_DIR</span><span>=</span><span style="color:#556633;">"</span><span style="color:#99ad6a;">$</span><span style="color:#ffb964;">HOME</span><span style="color:#99ad6a;">/文档</span><span style="color:#556633;">"
|
||||
</span><span style="color:#ffb964;">XDG_MUSIC_DIR</span><span>=</span><span style="color:#556633;">"</span><span style="color:#99ad6a;">$</span><span style="color:#ffb964;">HOME</span><span style="color:#99ad6a;">/音乐</span><span style="color:#556633;">"
|
||||
</span><span style="color:#ffb964;">XDG_PICTURES_DIR</span><span>=</span><span style="color:#556633;">"</span><span style="color:#99ad6a;">$</span><span style="color:#ffb964;">HOME</span><span style="color:#99ad6a;">/图片</span><span style="color:#556633;">"
|
||||
</span><span style="color:#ffb964;">XDG_VIDEOS_DIR</span><span>=</span><span style="color:#556633;">"</span><span style="color:#99ad6a;">$</span><span style="color:#ffb964;">HOME</span><span style="color:#99ad6a;">/视频</span><span style="color:#556633;">"
|
||||
</span></code></pre>
|
||||
<p>将这些路径改为英文,例如:</p>
|
||||
<pre data-lang="bash" style="background-color:#151515;color:#e8e8d3;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#ffb964;">XDG_DESKTOP_DIR</span><span>=</span><span style="color:#556633;">"</span><span style="color:#99ad6a;">$</span><span style="color:#ffb964;">HOME</span><span style="color:#99ad6a;">/Desktop</span><span style="color:#556633;">"
|
||||
</span><span style="color:#ffb964;">XDG_DOWNLOAD_DIR</span><span>=</span><span style="color:#556633;">"</span><span style="color:#99ad6a;">$</span><span style="color:#ffb964;">HOME</span><span style="color:#99ad6a;">/Downloads</span><span style="color:#556633;">"
|
||||
</span><span style="color:#ffb964;">XDG_DOCUMENTS_DIR</span><span>=</span><span style="color:#556633;">"</span><span style="color:#99ad6a;">$</span><span style="color:#ffb964;">HOME</span><span style="color:#99ad6a;">/Documents</span><span style="color:#556633;">"
|
||||
</span><span style="color:#ffb964;">XDG_MUSIC_DIR</span><span>=</span><span style="color:#556633;">"</span><span style="color:#99ad6a;">$</span><span style="color:#ffb964;">HOME</span><span style="color:#99ad6a;">/Music</span><span style="color:#556633;">"
|
||||
</span><span style="color:#ffb964;">XDG_PICTURES_DIR</span><span>=</span><span style="color:#556633;">"</span><span style="color:#99ad6a;">$</span><span style="color:#ffb964;">HOME</span><span style="color:#99ad6a;">/Pictures</span><span style="color:#556633;">"
|
||||
</span><span style="color:#ffb964;">XDG_VIDEOS_DIR</span><span>=</span><span style="color:#556633;">"</span><span style="color:#99ad6a;">$</span><span style="color:#ffb964;">HOME</span><span style="color:#99ad6a;">/Videos</span><span style="color:#556633;">"
|
||||
</span></code></pre>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>重命名现有的文件夹</strong>:
|
||||
手动将 <code>home</code> 目录下的文件夹重命名为英文版本:</p>
|
||||
<pre data-lang="bash" style="background-color:#151515;color:#e8e8d3;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#ffb964;">mv ~</span><span>/桌面 </span><span style="color:#ffb964;">~</span><span>/Desktop
|
||||
</span><span style="color:#ffb964;">mv ~</span><span>/下载 </span><span style="color:#ffb964;">~</span><span>/Downloads
|
||||
</span><span style="color:#ffb964;">mv ~</span><span>/文档 </span><span style="color:#ffb964;">~</span><span>/Documents
|
||||
</span><span style="color:#ffb964;">mv ~</span><span>/音乐 </span><span style="color:#ffb964;">~</span><span>/Music
|
||||
</span><span style="color:#ffb964;">mv ~</span><span>/图片 </span><span style="color:#ffb964;">~</span><span>/Pictures
|
||||
</span><span style="color:#ffb964;">mv ~</span><span>/视频 </span><span style="color:#ffb964;">~</span><span>/Videos
|
||||
</span></code></pre>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>应用更改</strong>:
|
||||
完成以上操作后,运行以下命令应用新配置:</p>
|
||||
<pre data-lang="bash" style="background-color:#151515;color:#e8e8d3;" class="language-bash "><code class="language-bash" data-lang="bash"><span style="color:#ffb964;">xdg-user-dirs-update
|
||||
</span></code></pre>
|
||||
</li>
|
||||
</ol>
|
||||
<p>这样,<code>home</code> 目录下的文件夹就会改为英文,并且系统也会正确识别这些新的目录路径。</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="pagination">
|
||||
<div class="pagination__title">
|
||||
<span class="pagination__title-h">Thanks for reading! Read other posts?</span>
|
||||
<hr />
|
||||
</div>
|
||||
<div class="pagination__buttons">
|
||||
<span class="button previous">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-1/">
|
||||
<span class="button__icon">←</span>
|
||||
<span class="button__text">Linux之旅(1):构成与发行版</span>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
|
||||
<span class="button next">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-3/">
|
||||
<span class="button__text">Linux之旅(3):内核/shell/包管理/文件系统/桌面环境</span>
|
||||
<span class="button__icon">→</span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<footer class="footer">
|
||||
<div class="footer__inner">
|
||||
<div class="copyright">
|
||||
<span>©
|
||||
2025
|
||||
Dichgrem</span>
|
||||
<span class="copyright-theme">
|
||||
<span class="copyright-theme-sep"> :: CC BY-SA 4.0 :: A friend comes from distant lands</span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,358 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<title>Dich'blog</title>
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
<meta name="robots" content="noodp"/>
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/style.css">
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/color/blue.css">
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/color/background_dark.css">
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/font-hack-subset.css">
|
||||
|
||||
<meta name="description" content="">
|
||||
|
||||
<meta property="og:description" content="">
|
||||
<meta property="og:title" content="Dich'blog">
|
||||
<meta property="og:type" content="article">
|
||||
<meta property="og:url" content="https://blog.dich.bid/learn-linux-for-pc-3/">
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:description" content="">
|
||||
<meta name="twitter:title" content="Dich'blog">
|
||||
<meta property="twitter:domain" content="blog.dich.bid">
|
||||
<meta property="twitter:url" content="https://blog.dich.bid/learn-linux-for-pc-3/">
|
||||
|
||||
<link rel="alternate" type="application/atom+xml" title="Dich'blog Atom Feed" href="https://blog.dich.bid/atom.xml" />
|
||||
|
||||
|
||||
<link rel="icon" type="image/png" href=/dich.webp />
|
||||
|
||||
<!-- ✅ Added center alignment styles -->
|
||||
<style>
|
||||
.footer {
|
||||
text-align: center;
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
.footer__inner {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.copyright {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="">
|
||||
<div class="container">
|
||||
|
||||
<header class="header">
|
||||
<div class="header__inner">
|
||||
<div class="header__logo">
|
||||
|
||||
<a href="https://blog.dich.bid" style="text-decoration: none;">
|
||||
<div class="logo">
|
||||
|
||||
Dich'blog
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<nav class="menu">
|
||||
<ul class="menu__inner">
|
||||
<li class="active"><a href="https://blog.dich.bid">blog</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/archive">archive</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/tags">tags</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/weekly">weekly</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/search">search</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/about">about me</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/links">links</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/atom.xml">rss</a></li>
|
||||
|
||||
<li><a href="https://github.com/Dichgrem" target="_blank" rel="noopener noreferrer">github</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
|
||||
<div class="content">
|
||||
|
||||
<div class="post">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/learn-linux-for-pc-3/">Linux之旅(3):内核/shell/包管理/文件系统/桌面环境</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
2023-07-22
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<span class="post-tags-inline">
|
||||
:: tags:
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
|
||||
<div class="post-content">
|
||||
<p>前言 在Linux世界中,内核/shell/包管理/文件系统构成了Linux系统的核心,它们相互配合,共同构建了一个强大而稳定的操作环境。本文将深入探讨这些关键组成部分,解释它们的作用和原理,帮助读者更好地理解Linux系统的运作机制。</p>
|
||||
<span id="continue-reading"></span><h2 id="yi-linuxnei-he"><strong>一.Linux内核</strong></h2>
|
||||
<p>有许多不同的版本,每个版本都包含了一系列的功能改进、bug修复和性能优化。在Linux发行版中,通常会使用某个特定版本的Linux内核,或者在需要时进行升级。以下是一些常见的Linux内核及其主要特点:</p>
|
||||
<p><strong>Zen内核</strong>:</p>
|
||||
<ul>
|
||||
<li>Zen内核是Linux内核的一个变体,旨在提供更好的性能和响应性。它通常包含了一些特定的调度程序和调优参数,以提高系统的负载均衡和响应速度。Zen内核也可能包含一些来自其他内核变体的功能和补丁,以进一步优化性能。</li>
|
||||
</ul>
|
||||
<p><strong>LTS内核</strong>:</p>
|
||||
<ul>
|
||||
<li>LTS(Long-Term Support)内核是一种长期支持的内核版本,它会获得更长时间的更新和维护。LTS内核通常会选择一些相对稳定和经过充分测试的功能,并对其进行长期支持,以确保系统的稳定性和安全性。</li>
|
||||
</ul>
|
||||
<p><strong>Real-Time内核</strong>:</p>
|
||||
<ul>
|
||||
<li>Real-Time内核是一种专门针对实时应用场景进行优化的内核变体。它通常包含了一些实时调度算法和机制,以确保系统能够及时响应各种事件,并满足实时性要求。Real-Time内核适用于一些对实时性要求较高的应用,如工业控制、机器人控制等领域。</li>
|
||||
</ul>
|
||||
<p><strong>Hardened内核</strong>:</p>
|
||||
<ul>
|
||||
<li>Hardened内核是一种针对安全性进行优化的内核变体。它通常包含了一些安全增强功能和补丁,以提高系统的安全性和抵御攻击的能力。Hardened内核适用于一些对安全性要求较高的应用,如服务器、云计算等场景。</li>
|
||||
</ul>
|
||||
<p><strong>XanMod内核</strong>:</p>
|
||||
<ul>
|
||||
<li>XanMod内核是一个基于Linux内核的自定义内核,旨在提供更好的响应性和性能。它包含了一些针对桌面和工作站系统优化的功能和补丁,如MuQSS调度器、BFQ I/O调度器等,以提高系统的响应速度和性能稳定性。XanMod内核还支持一些实时性应用,如音视频处理等,适用于对系统响应速度要求较高的用户。</li>
|
||||
</ul>
|
||||
<p><strong>CachyOS内核</strong>:</p>
|
||||
<ul>
|
||||
<li>CachyOS内核是一个专门针对缓存优化的Linux内核变体。它包含了一些针对缓存系统优化的功能和调整,以提高系统的缓存性能和数据访问速度。CachyOS内核通常适用于需要高性能缓存的应用场景,如数据库服务器、Web服务器等。</li>
|
||||
</ul>
|
||||
<p>这些内核变体针对不同的需求和使用场景进行了优化,可以根据具体的应用需求来选择合适的内核版本。例如,如果您需要更好的性能和响应性,可以选择Zen内核;如果您需要长期支持和稳定性,可以选择LTS内核;如果您需要实时性能,可以选择Real-Time内核;如果您需要更高的安全性,可以选择Hardened内核。</p>
|
||||
<h2 id="er-linux-shell"><strong>二.Linux Shell</strong></h2>
|
||||
<p>在Linux系统中,有许多不同的Shell(命令行解释器),每种Shell都有自己的特点和用途。以下是一些常见的Linux Shell及其主要特点:</p>
|
||||
<p><strong>Bash(Bourne Again Shell)</strong>:</p>
|
||||
<ul>
|
||||
<li>Bash是Linux系统中最常用的Shell之一,也是默认的命令行解释器。它是Bourne Shell的增强版,提供了丰富的功能和扩展性,包括命令历史、命令补全、作业控制等。Bash具有良好的兼容性和易用性,适用于日常的系统管理和脚本编程。</li>
|
||||
</ul>
|
||||
<p><strong>Zsh(Z Shell)</strong>:</p>
|
||||
<ul>
|
||||
<li>Zsh是一种功能强大的Shell,提供了丰富的功能和扩展性,如更强大的命令补全、自动纠正拼写错误、主题和插件系统等。Zsh具有良好的可定制性和用户体验,适用于高级用户和程序员。</li>
|
||||
</ul>
|
||||
<p><strong>Fish(Friendly Interactive Shell)</strong>:</p>
|
||||
<ul>
|
||||
<li>Fish是一种用户友好的交互式Shell,提供了直观的命令提示和自动补全功能,以及丰富的语法高亮和命令提示信息。Fish具有良好的用户体验和易用性,适用于初学者和普通用户。</li>
|
||||
</ul>
|
||||
<p><strong>Dash(Debian Almquist Shell)</strong>:</p>
|
||||
<ul>
|
||||
<li>Dash是一种轻量级的Shell,专门设计用于系统启动过程和脚本执行。Dash具有较高的执行速度和较低的内存占用,适用于系统启动脚本和简单的脚本编程。</li>
|
||||
</ul>
|
||||
<p>Bash是最常用的Shell之一,具有良好的兼容性和功能性;Zsh提供了更多的高级特性和定制选项,适用于高级用户和程序员;Fish具有友好的交互式体验和直观的用户界面,适用于初学者和普通用户;Dash则是一个轻量级的Shell,专门用于系统启动过程和简单的脚本编程。用户可以根据自己的需求和偏好选择合适的Shell。</p>
|
||||
<h2 id="san-linuxbao-guan-li-qi"><strong>三.Linux包管理器</strong></h2>
|
||||
<p>在Linux系统中,有几种常见的包管理器,它们各自管理着不同的发行版,具有不同的特点和用途。以下是一些常见的Linux包管理器及其主要特点:</p>
|
||||
<p><strong>APT(Advanced Package Tool)</strong>:</p>
|
||||
<ul>
|
||||
<li>APT是Debian系(如Debian、Ubuntu)中最常用的包管理器之一。它使用基于命令行的工具,如<code>apt-get</code>、<code>apt-cache</code>等来安装、升级和删除软件包。APT还支持依赖关系的自动解决,使得软件包的安装和管理变得更加方便。</li>
|
||||
</ul>
|
||||
<p><strong>YUM(Yellowdog Updater, Modified)</strong>:</p>
|
||||
<ul>
|
||||
<li>YUM是Red Hat系(如CentOS、Fedora)中常用的包管理器之一。它使用基于命令行的工具,如<code>yum</code>来管理软件包。YUM具有良好的依赖关系解决能力和事务处理功能,使得系统升级和软件包管理变得更加简单和可靠。</li>
|
||||
</ul>
|
||||
<p><strong>DNF(Dandified YUM)</strong>:</p>
|
||||
<ul>
|
||||
<li>DNF是YUM的下一代版本,逐渐取代了YUM在Fedora和RHEL系列中的地位。DNF具有更快的包查询和事务处理能力,以及更友好的用户界面。它是未来主流的包管理器之一。</li>
|
||||
</ul>
|
||||
<p><strong>Pacman(Package Manager)</strong>:</p>
|
||||
<ul>
|
||||
<li>Pacman是Arch Linux中常用的包管理器,也被一些其他发行版如Manjaro采用。Pacman使用简洁的命令,如<code>pacman -S</code>安装软件包、<code>pacman -Syu</code>更新系统等来管理软件包。Pacman具有简单、直观的界面和快速的操作速度,适用于对系统有一定了解的用户。</li>
|
||||
</ul>
|
||||
<p><strong>zypper</strong>:</p>
|
||||
<ul>
|
||||
<li>zypper是openSUSE中常用的包管理器,它使用基于命令行的工具,如<code>zypper install</code>、<code>zypper update</code>等来管理软件包。zypper具有良好的依赖关系解决能力和事务处理功能,使得系统升级和软件包管理变得更加简单和可靠。</li>
|
||||
</ul>
|
||||
<p><strong>dpkg</strong>:</p>
|
||||
<ul>
|
||||
<li>dpkg是Debian系(如Debian、Ubuntu)中的低级别软件包管理工具,用于直接管理软件包的安装、升级和删除。它提供了一系列的命令,如<code>dpkg -i</code>安装软件包、<code>dpkg -r</code>删除软件包等。</li>
|
||||
</ul>
|
||||
<p><strong>RPM(RPM Package Manager)</strong>:</p>
|
||||
<ul>
|
||||
<li>RPM是Red Hat系(如CentOS、Fedora)中的低级别软件包管理工具,用于直接管理软件包的安装、升级和删除。它提供了一系列的命令,如<code>rpm -i</code>安装软件包、<code>rpm -e</code>删除软件包等。</li>
|
||||
</ul>
|
||||
<p><strong>Portage</strong>:</p>
|
||||
<ul>
|
||||
<li>Portage是Gentoo Linux中的包管理器,它使用源代码进行软件包的安装和管理。Portage具有高度定制化和灵活性,允许用户根据需要自定义软件包的编译参数和依赖关系。</li>
|
||||
</ul>
|
||||
<p><strong>Snap</strong>:</p>
|
||||
<ul>
|
||||
<li>Snap是一种跨发行版的软件包格式和包管理器,允许用户在不同的Linux发行版上安装和管理软件包。Snap具有自包含性和隔离性,使得软件包的安装和升级变得更加简单和安全。</li>
|
||||
</ul>
|
||||
<p><strong>Flatpak</strong>:</p>
|
||||
<ul>
|
||||
<li>Flatpak是另一种跨发行版的软件包格式和包管理器,类似于Snap,允许用户在不同的Linux发行版上安装和管理软件包。Flatpak提供了一种统一的应用分发和运行环境,使得软件包的安装和升级更加简单和可靠。</li>
|
||||
</ul>
|
||||
<h2 id="si-linuxwen-jian-xi-tong"><strong>四.Linux文件系统</strong></h2>
|
||||
<p>Linux系统支持多种文件系统,每种文件系统都有自己的特点和优势,适用于不同的应用场景和需求。以下是一些常见的Linux文件系统及其主要特点:</p>
|
||||
<p><strong>ext4</strong>:</p>
|
||||
<ul>
|
||||
<li>ext4是Linux系统中最常用的文件系统之一,它是ext文件系统的后续版本,提供了更好的性能和扩展性。ext4支持更大的文件和分区大小,更快的文件系统检查和恢复速度,以及更高的性能和稳定性。</li>
|
||||
</ul>
|
||||
<p><strong>Btrfs</strong>:</p>
|
||||
<ul>
|
||||
<li>Btrfs是一种先进的文件系统,具有许多先进的功能和特性,如快照、数据校验、数据压缩等。Btrfs支持在线扩展和收缩分区大小,以及动态添加和删除磁盘,适用于需要高级特性和灵活性的应用场景。此外,Btrfs对快照功能支持较好。</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>快照功能是一种文件系统的特性,它允许用户在特定时间点对文件系统的状态进行快照或备份,并且可以在需要时一键恢复到该时间点的状态。
|
||||
快照允许用户轻松地创建文件系统的历史版本,并在需要时回滚到特定的版本;快照允许用户在文件系统中进行实验和测试,并在测试失败或不需要时轻松地回滚到初始状态,以避免对系统造成影响。在升级或安装过程中出现问题时快速恢复到原始状态</p>
|
||||
</blockquote>
|
||||
<p><strong>XFS</strong>:</p>
|
||||
<ul>
|
||||
<li>XFS是一种高性能的日志文件系统,适用于大型文件和高吞吐量的应用场景。XFS支持大容量的文件和分区,具有较低的碎片化和较高的并发性能,适用于大规模存储和数据分析等应用。</li>
|
||||
</ul>
|
||||
<p><strong>ZFS</strong>:</p>
|
||||
<ul>
|
||||
<li>ZFS是一种先进的文件系统,具有强大的数据管理和保护功能,如快照、数据校验、数据压缩等。ZFS支持软件RAID和存储池(pool),以及动态添加和删除磁盘,适用于数据中心和大规模存储等应用场景。</li>
|
||||
</ul>
|
||||
<p><strong>F2FS</strong>:</p>
|
||||
<ul>
|
||||
<li>F2FS是一种针对闪存存储设备进行优化的文件系统,具有高性能和高可靠性。F2FS支持闪存特性如块擦除计数(block erase count)和块生命周期管理(block lifetime management),适用于固态硬盘(SSD)和闪存卡等闪存设备。</li>
|
||||
</ul>
|
||||
<h2 id="wu-linuxzhuo-mian-huan-jing"><strong>五.Linux桌面环境</strong></h2>
|
||||
<p>Linux系统有多种不同的桌面环境,每种环境都有其独特的特点、风格和用户体验。以下是一些常见的Linux桌面环境及其主要特点:</p>
|
||||
<p><strong>GNOME</strong>:</p>
|
||||
<ul>
|
||||
<li>GNOME是一个功能强大、现代化的桌面环境,具有直观的用户界面和丰富的功能。它采用了扁平化的设计风格和简洁的用户界面,提供了丰富的应用程序和插件,适用于普通用户和开发人员。</li>
|
||||
</ul>
|
||||
<p><strong>KDE Plasma</strong>:</p>
|
||||
<ul>
|
||||
<li>KDE Plasma是一个灵活、可定制的桌面环境,提供了丰富的特性和选项,如桌面特效、窗口管理器、小部件等。它采用了现代化的设计风格和强大的桌面管理功能,适用于高级用户和技术爱好者。</li>
|
||||
</ul>
|
||||
<p><strong>XFCE</strong>:</p>
|
||||
<ul>
|
||||
<li>XFCE是一个轻量级、快速的桌面环境,具有简洁的用户界面和低资源消耗。它采用了传统的桌面布局和简约的设计风格,提供了基本的桌面管理功能和应用程序,适用于老旧计算机和资源有限的环境。</li>
|
||||
</ul>
|
||||
<p><strong>LXQt</strong>:</p>
|
||||
<ul>
|
||||
<li>LXQt是一个轻量级、快速的桌面环境,是LXDE和Razor-qt的合并项目。它采用了现代化的设计风格和简洁的用户界面,提供了丰富的特性和可定制选项,适用于资源有限的环境和嵌入式系统。</li>
|
||||
</ul>
|
||||
<p><strong>Cinnamon</strong>:</p>
|
||||
<ul>
|
||||
<li>Cinnamon是一个基于GNOME的桌面环境,具有类似于传统Windows桌面的用户界面和功能。它采用了传统的桌面布局和直观的用户体验,提供了丰富的特性和可定制选项,适用于对传统桌面风格有需求的用户。</li>
|
||||
</ul>
|
||||
<p>GNOME和KDE Plasma提供了丰富的特性和高度定制化选项,适用于高级用户和开发人员;XFCE和LXQt则提供了轻量级和快速的用户体验,适用于资源有限的环境;Cinnamon则提供了类似于传统Windows桌面的用户界面和功能,适用于对传统桌面风格有需求的用户。可以根据自己的需求和偏好选择合适的桌面环境。</p>
|
||||
<blockquote>
|
||||
<p>当然,也可以使用轻量级的窗口管理器。
|
||||
窗口管理器是Linux系统中控制窗口布局、管理窗口行为的关键组件。它们决定了窗口的外观和行为方式,以及如何管理和排列窗口。以下是一些常见的窗口管理器及其主要特点:</p>
|
||||
</blockquote>
|
||||
<p><strong>X Window Manager (XWM)</strong>:</p>
|
||||
<ul>
|
||||
<li>X Window Manager是最基本的窗口管理器,用于管理X Window系统中的窗口。它提供了最基本的窗口布局和管理功能,如窗口移动、调整大小、最小化等。XWM本身并不提供任何外观效果,但可以与其他工具配合使用来实现更丰富的窗口管理和外观特性。</li>
|
||||
</ul>
|
||||
<p><strong>Openbox</strong>:</p>
|
||||
<ul>
|
||||
<li>Openbox是一个轻量级的窗口管理器,具有简洁的用户界面和低资源消耗。它提供了丰富的自定义选项和扩展功能,如虚拟桌面、窗口装饰、键盘快捷键等。Openbox适用于资源有限的环境和对简洁风格有需求的用户。</li>
|
||||
</ul>
|
||||
<p><strong>i3</strong>:</p>
|
||||
<ul>
|
||||
<li>i3是一个动态平铺窗口管理器,采用了平铺式布局,将窗口按照一定规则自动排列在屏幕上。它提供了快速的窗口切换和管理功能,支持键盘操作和自动布局调整,适用于需要高效多任务处理的用户。</li>
|
||||
</ul>
|
||||
<p><strong>Awesome</strong>:</p>
|
||||
<ul>
|
||||
<li>Awesome是一个高度可定制的动态平铺窗口管理器,具有丰富的特性和扩展功能。它采用Lua脚本语言进行配置和定制,支持强大的自定义选项和扩展功能,适用于高级用户和技术爱好者。</li>
|
||||
</ul>
|
||||
<p><strong>KWin</strong>:</p>
|
||||
<ul>
|
||||
<li>KWin是KDE桌面环境中的默认窗口管理器,具有丰富的特性和功能。它提供了多种窗口布局和管理选项,支持虚拟桌面、窗口效果、窗口组织等功能,适用于需要丰富特性和高度定制化的用户。</li>
|
||||
</ul>
|
||||
<p>这些窗口管理器之间的主要异同在于窗口布局、外观效果、自定义选项和功能特性等方面。Openbox和i3提供了简洁的用户界面和低资源消耗,适用于资源有限的环境;Awesome和KWin则提供了丰富的特性和扩展功能,适用于高级用户和技术爱好者。用户可以根据自己的需求和偏好选择合适的窗口管理器。</p>
|
||||
<blockquote>
|
||||
<p>Wayland和X11
|
||||
Wayland和X11都是用于Linux系统的图形显示协议,它们负责管理图形用户界面(GUI)的显示和交互。下面是它们的简要介绍以及异同点:</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li>
|
||||
<p><strong>X11(X Window System)</strong>:
|
||||
X11是一个由MIT开发的图形显示协议,长期以来一直是Linux系统中最常用的图形显示系统。它采用客户端-服务器模型,图形应用程序(客户端)通过X服务器与显示设备(服务器)进行通信。X11提供了丰富的图形特性和功能,如窗口管理、窗口装饰、多任务处理等。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>Wayland</strong>:
|
||||
Wayland是一个由Red Hat主导开发的新一代图形显示协议,旨在取代X11成为Linux系统的标准图形显示系统。Wayland采用了现代化的设计理念和架构,取消了X11中复杂的客户端-服务器模型,将图形显示功能直接集成到操作系统中。Wayland具有更低的延迟和更高的性能,支持更好的硬件加速和多触摸设备,以及更简洁的代码结构。</p>
|
||||
</li>
|
||||
</ul>
|
||||
<p><strong>异同点</strong>:</p>
|
||||
<ul>
|
||||
<li><strong>架构差异</strong>:X11采用了客户端-服务器模型,图形应用程序通过X服务器与显示设备进行通信;而Wayland取消了这种模型,将图形显示功能直接集成到操作系统中,减少了中间层的复杂性。</li>
|
||||
<li><strong>性能差异</strong>:Wayland具有更低的延迟和更高的性能,支持更好的硬件加速和多触摸设备,使得图形显示更加流畅和响应。</li>
|
||||
<li><strong>功能差异</strong>:X11提供了丰富的图形特性和功能,如窗口管理、窗口装饰、多任务处理等;Wayland在功能上相对较少,但提供了更简洁的代码结构和更好的性能。</li>
|
||||
<li><strong>兼容性差异</strong>:X11在Linux系统中被广泛使用,拥有大量的应用程序和工具的支持;而Wayland在兼容性方面仍在发展中,尚未完全取代X11成为Linux系统的标准图形显示系统。</li>
|
||||
</ul>
|
||||
<p>总的来说,Wayland是未来Linux系统中的趋势,具有更好的性能和更简洁的架构,但在兼容性和功能丰富度上仍有待改进。X11则是当前仍然广泛使用的图形显示系统,拥有丰富的生态和大量的应用程序支持。</p>
|
||||
<h2 id="liu-hou-ji"><strong>六.后记</strong></h2>
|
||||
<p>个人使用推荐Zen+Zsh+Pacman+Btrfs+Hyprland,并使用 paru xxx 来搜索软件包,使用paru -S xxx 安装软件。</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="pagination">
|
||||
<div class="pagination__title">
|
||||
<span class="pagination__title-h">Thanks for reading! Read other posts?</span>
|
||||
<hr />
|
||||
</div>
|
||||
<div class="pagination__buttons">
|
||||
<span class="button previous">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-2/">
|
||||
<span class="button__icon">←</span>
|
||||
<span class="button__text">Linux之旅(2):FHS与目录结构</span>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
|
||||
<span class="button next">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-4/">
|
||||
<span class="button__text">Linux之旅(4):Terminal,Console and Shell</span>
|
||||
<span class="button__icon">→</span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<footer class="footer">
|
||||
<div class="footer__inner">
|
||||
<div class="copyright">
|
||||
<span>©
|
||||
2025
|
||||
Dichgrem</span>
|
||||
<span class="copyright-theme">
|
||||
<span class="copyright-theme-sep"> :: CC BY-SA 4.0 :: A friend comes from distant lands</span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,191 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<title>Dich'blog</title>
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
<meta name="robots" content="noodp"/>
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/style.css">
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/color/blue.css">
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/color/background_dark.css">
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/font-hack-subset.css">
|
||||
|
||||
<meta name="description" content="">
|
||||
|
||||
<meta property="og:description" content="">
|
||||
<meta property="og:title" content="Dich'blog">
|
||||
<meta property="og:type" content="article">
|
||||
<meta property="og:url" content="https://blog.dich.bid/learn-linux-for-pc-4/">
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:description" content="">
|
||||
<meta name="twitter:title" content="Dich'blog">
|
||||
<meta property="twitter:domain" content="blog.dich.bid">
|
||||
<meta property="twitter:url" content="https://blog.dich.bid/learn-linux-for-pc-4/">
|
||||
|
||||
<link rel="alternate" type="application/atom+xml" title="Dich'blog Atom Feed" href="https://blog.dich.bid/atom.xml" />
|
||||
|
||||
|
||||
<link rel="icon" type="image/png" href=/dich.webp />
|
||||
|
||||
<!-- ✅ Added center alignment styles -->
|
||||
<style>
|
||||
.footer {
|
||||
text-align: center;
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
.footer__inner {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.copyright {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="">
|
||||
<div class="container">
|
||||
|
||||
<header class="header">
|
||||
<div class="header__inner">
|
||||
<div class="header__logo">
|
||||
|
||||
<a href="https://blog.dich.bid" style="text-decoration: none;">
|
||||
<div class="logo">
|
||||
|
||||
Dich'blog
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<nav class="menu">
|
||||
<ul class="menu__inner">
|
||||
<li class="active"><a href="https://blog.dich.bid">blog</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/archive">archive</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/tags">tags</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/weekly">weekly</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/search">search</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/about">about me</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/links">links</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/atom.xml">rss</a></li>
|
||||
|
||||
<li><a href="https://github.com/Dichgrem" target="_blank" rel="noopener noreferrer">github</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
|
||||
<div class="content">
|
||||
|
||||
<div class="post">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/learn-linux-for-pc-4/">Linux之旅(4):Terminal,Console and Shell</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
2023-07-23
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<span class="post-tags-inline">
|
||||
:: tags:
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
|
||||
<div class="post-content">
|
||||
<p>前言 在linux的学习过程中,我们常常遇到诸如 Terminal,Console,bash,zsh,shell,tty 等概念,这些概念常常被混淆,似乎都和命令行相关。本文从历史角度出发介绍它们的前世今生。</p>
|
||||
<span id="continue-reading"></span><h2 id="zhong-duan-he-kong-zhi-tai">终端和控制台</h2>
|
||||
<p>终端,英文叫做 terminal ,通常简称为 term;控制台,英文叫做 console。</p>
|
||||
<p>要明白这两者的关系,还得从最初的计算机说起。当时的计算机价格昂贵,一台计算机一般是由多个人同时使用的。在这种情况下一台计算机需要连接上许多套键盘和显示器来供多个人使用。在以前专门有这种可以连上一台电脑的设备,只有显示器和键盘,还有简单的处理电路,本身不具有处理计算机信息的能力,他是负责连接到一台正常的计算机上(通常是通过串口) ,然后登陆计算机,并对该计算机进行操作。当然,那时候的计算机操作系统都是多任务多用户的操作系统。这样一台只有显示器和键盘能够通过串口连接到计算机的设备就叫做终端。</p>
|
||||
<p>而控制台又是什么回事呢?其概念来自于管风琴的控制台。顾名思义,控制台就是一个直接控制设备的台面(一个面板,上面有很多控制按钮)。 在计算机里,把那套直接连接在电脑上的键盘和显示器就叫做控制台。</p>
|
||||
<p>终端是通过串口连接上的,不是计算机本身就有的设备,而控制台是计算机本身就有的设备,一个计算机只有一个控制台。计算机启动的时候,所有的信息都会显示到控制台上,而不会显示到终端上。也就是说,控制台是计算机的基本设备,而终端是附加设备。 当然,由于控制台也有终端一样的功能,控制台有时候也被模糊的统称为终端。</p>
|
||||
<p>以上是控制台和终端的历史遗留区别。现在由于计算机硬件越来越便宜,终端和控制台的概念也慢慢演化了。终端和控制台由硬件的概念,演化成了软件的概念。
|
||||
</p>
|
||||
<h2 id="nei-he-yu-wai-ke">内核与外壳</h2>
|
||||
<p>内核( Kernel )和外壳( Shell )是 linux 的两个主要部分。Kernel 是操作系统的核心,系统的文件管理、进程管理、内存管理、设备管理这些功能,都是由 Kernel 提供的。</p>
|
||||
<p>用户和操作系统内核交流需要一个工具,那么这个工具就是 Shell。</p>
|
||||
<p>什么是 Shell?在 Linux 中,最常见的 Shell 形式有命令行界面命令行界面和图形界面两种。并不是打开的那个终端窗口就是 Shell,如Alacritty、Gnome-Terminal、xterm 、kitty等程序,它们不是 Shell,而它们里面运行的 Bash、Zsh、fish 等命令行解释器程序,才是 Shell。</p>
|
||||
<p>那 Alacritty、Gnome-Terminal、xtermxterm 是什么?</p>
|
||||
<p>它们是终端模拟器。</p>
|
||||
<p>前面提到过,在远古时代,终端和控制台都是有实体的。控制台直接和计算机在一起,你可以通过控制台控制计算机。终端通过数据线和计算机连接,终端也提供一个键盘和一个屏幕,你可以通过键盘向计算机下达指令,然后通过屏幕观察输出。</p>
|
||||
<p>但是现在的计算机组成和以前不一样了,一般一台电脑都是自带键盘和屏幕,很少再外接终端设备。</p>
|
||||
<p>所以 Linux 提供了另外一个更高级的功能,那就是虚拟终端。那就是在一台电脑上,通过软件的模拟,好像有好几个终端连接在这台计算机上一样。</p>
|
||||
<p>现在说的终端,比如 linux 中的虚拟终端,都是软件的概念。虚拟终端称之为 tty,tty 是电传打字机电传打字机 Teletypewriter 的缩写,在带显示屏的视频终端出现之前,tty是最流行的终端设备。每一个 tty 都有一个编号,在/dev目录下有相应的设备文件。其中/dev/tty1到/dev/tty7可以通过 Ctrl+Alt+F1 到 Ctrl+Alt+F7 进行切换,也可以通过 chvt 命令进行切换,就好比是以前多人公用的计算机中的六个终端设备,这就是为什么这个叫“虚拟终端”的原因。</p>
|
||||
<h2 id="shi-dai-bian-qian">时代变迁</h2>
|
||||
<p>随着时间的推移,我们看到了从硬件到软件的转变,以及从多用户共享到个人使用的转变。这种变迁不仅影响了终端和控制台的概念,也塑造了我们对计算机的理解和期待。</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="pagination">
|
||||
<div class="pagination__title">
|
||||
<span class="pagination__title-h">Thanks for reading! Read other posts?</span>
|
||||
<hr />
|
||||
</div>
|
||||
<div class="pagination__buttons">
|
||||
<span class="button previous">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-3/">
|
||||
<span class="button__icon">←</span>
|
||||
<span class="button__text">Linux之旅(3):内核/shell/包管理/文件系统/桌面环境</span>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
|
||||
<span class="button next">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-5/">
|
||||
<span class="button__text">Linux之旅(5):BIOS-UEFI-MBR-GPT-GRUB</span>
|
||||
<span class="button__icon">→</span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<footer class="footer">
|
||||
<div class="footer__inner">
|
||||
<div class="copyright">
|
||||
<span>©
|
||||
2025
|
||||
Dichgrem</span>
|
||||
<span class="copyright-theme">
|
||||
<span class="copyright-theme-sep"> :: CC BY-SA 4.0 :: A friend comes from distant lands</span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,287 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<title>Dich'blog</title>
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
<meta name="robots" content="noodp"/>
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/style.css">
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/color/blue.css">
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/color/background_dark.css">
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/font-hack-subset.css">
|
||||
|
||||
<meta name="description" content="">
|
||||
|
||||
<meta property="og:description" content="">
|
||||
<meta property="og:title" content="Dich'blog">
|
||||
<meta property="og:type" content="article">
|
||||
<meta property="og:url" content="https://blog.dich.bid/learn-linux-for-pc-5/">
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:description" content="">
|
||||
<meta name="twitter:title" content="Dich'blog">
|
||||
<meta property="twitter:domain" content="blog.dich.bid">
|
||||
<meta property="twitter:url" content="https://blog.dich.bid/learn-linux-for-pc-5/">
|
||||
|
||||
<link rel="alternate" type="application/atom+xml" title="Dich'blog Atom Feed" href="https://blog.dich.bid/atom.xml" />
|
||||
|
||||
|
||||
<link rel="icon" type="image/png" href=/dich.webp />
|
||||
|
||||
<!-- ✅ Added center alignment styles -->
|
||||
<style>
|
||||
.footer {
|
||||
text-align: center;
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
.footer__inner {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.copyright {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="">
|
||||
<div class="container">
|
||||
|
||||
<header class="header">
|
||||
<div class="header__inner">
|
||||
<div class="header__logo">
|
||||
|
||||
<a href="https://blog.dich.bid" style="text-decoration: none;">
|
||||
<div class="logo">
|
||||
|
||||
Dich'blog
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<nav class="menu">
|
||||
<ul class="menu__inner">
|
||||
<li class="active"><a href="https://blog.dich.bid">blog</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/archive">archive</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/tags">tags</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/weekly">weekly</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/search">search</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/about">about me</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/links">links</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/atom.xml">rss</a></li>
|
||||
|
||||
<li><a href="https://github.com/Dichgrem" target="_blank" rel="noopener noreferrer">github</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
|
||||
<div class="content">
|
||||
|
||||
<div class="post">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/learn-linux-for-pc-5/">Linux之旅(5):BIOS-UEFI-MBR-GPT-GRUB</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
2023-07-24
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<span class="post-tags-inline">
|
||||
:: tags:
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
|
||||
<div class="post-content">
|
||||
<p>前言 在计算机领域,系统引导和磁盘分区是至关重要的。本文将介绍BIOS与UEFI,MBR与GPT,以及它们之间的异同点。此外,我们还会讨论与这些概念密切相关的引导加载程序——GRUB。</p>
|
||||
<span id="continue-reading"></span><h2 id="bios">BIOS</h2>
|
||||
<blockquote>
|
||||
<p><code>BIOS(Basic Input Output System)</code>,直译成中文名称就是"<code>基本输入输出系统</code>"。它是一组固化到主板中一个ROM芯片上的程序,它可以从CMOS中读写系统设置的具体信息。此程序保存着计算机最重要的基本输入输出程序、开机后的自检程序和系统自启动程序。简单来说,BIOS只认识设备,不认识分区、不认识文件。</p>
|
||||
</blockquote>
|
||||
<h2 id="uefi">UEFI</h2>
|
||||
<blockquote>
|
||||
<p>UEFI(统一可扩展固件接口)是一个公开的规范,定义了操作系统和平台固件之间的软件接口。UEFI 是传统 PC BIOS 的继承者,是取代传统BIOS的,相比传统BIOS来说,它更易实现,容错和纠错特性也更强。 它将引导数据存储在 .efi 文件中,而不是固件中。你经常会在新款的主板中找到 UEFI 启动模式。UEFI 启动模式包含一个特殊的 EFI 分区,用于存储 .efi 文件并用于引导过程和引导加载程序。</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>UEFI使用GPT的分区引导方案,支持更大的硬盘。由于省去了BIOS自检的过程,所以启动速度更快。传统BIOS主要支持MBR引导,UEFI则是取代传统BIOS,它加入了对新硬件的支持,其中就有支持2TB以上硬盘。</p>
|
||||
</blockquote>
|
||||
<h2 id="mbr">MBR</h2>
|
||||
<blockquote>
|
||||
<p>全新硬盘在使用之前必须进行分区格式化,硬盘分区初始化的格式主要有两种,分别为<code>MBR</code>格式和<code>GPT</code>格式。MBR是传统的分区表类型,当一台电脑启动时,它会先启动主板上的BIOS系统,BIOS再从硬盘上读取MBR主引导记录,硬盘上的MBR运行后,就会启动操作系统,但最大的缺点则是不支持容量大于2T的硬盘。</p>
|
||||
</blockquote>
|
||||
<h2 id="gpt">GPT</h2>
|
||||
<blockquote>
|
||||
<p>而GPT是另一种更先进的磁盘系统分区方式,它的出现弥补了MBR这个缺点,最大支持<code>18EB</code>的硬盘,是基于<code>UEFI</code>使用的磁盘分区架构。目前所有Windows系统均支持<code>MBR</code>,而<code>GPT</code>只有<code>64</code>位系统才能支持。<code>BIOS只支持MBR引导系统,而GPT仅可用UEFI引导系统</code>。正因为这样,现在主板大多采用BIOS集成UEFI,或UEFI集成BIOS,以此达到同时兼容MBR和GPT引导系统的目的。</p>
|
||||
</blockquote>
|
||||
<h2 id="grub">GRUB</h2>
|
||||
<blockquote>
|
||||
<p>GRUB(GRand unified bootloader),多操作系统启动程序。它允许用户可以在计算机内同时拥有多个操作系统,并在计算机启动时选择希望运行的操作系统。</p>
|
||||
<p>GRUB可用于选择操作系统分区上的不同内核,也可用于向这些内核传递启动参数。<code>它是一个多重操作系统启动管理器,用来引导不同系统</code>,如Windows、Linux。Linux常见的引导程序包括LILO、GRUB、GRUB2。</p>
|
||||
</blockquote>
|
||||
<h2 id="legacy">Legacy</h2>
|
||||
<blockquote>
|
||||
<p>如果你遇到过刚制作的U盘启动盘无法启动,或者新买的固态硬盘做好系统后无法启动,那么大概率的问题就出现在BIOS的引导模式的选择上,是UEFI还是Legacy。legacy启动模式是指BIOS 固件用来初始化硬件设备的引导过程,Legacy启动模式包含一系列已安装的设备,这些设备在引导过程中计算机执行 POST (开机自检)测试时会被初始化。传统引导将检查所有连接设备的主引导记录 (MBR),通常位于磁盘的第一个扇区。<br />
|
||||
当它在设备中找不到引导加载程序时,Legacy会切换到列表中的下一个设备并不断重复此过程,直到找到引导加载程序,否则返回错误。</p>
|
||||
</blockquote>
|
||||
<h2 id="biao-ge">表格</h2>
|
||||
<h3 id="bios-uefi">BIOS/UEFI</h3>
|
||||
<table><thead><tr><th>BIOS</th><th>UEFI</th></tr></thead><tbody>
|
||||
<tr><td>用于初始化计算机硬件并引导操作系统</td><td>在计算机启动时运行</td></tr>
|
||||
<tr><td>具有较少功能和灵活性</td><td>具有更多功能和灵活性</td></tr>
|
||||
<tr><td></td><td>支持更大的硬盘容量、更快的启动速度、更好的安全性和更多的扩展性v</td></tr>
|
||||
<tr><td></td><td>通常具有图形用户界面(GUI)</td></tr>
|
||||
</tbody></table>
|
||||
<h3 id="mbr-gpt">MBR/GPT</h3>
|
||||
<table><thead><tr><th>MBR</th><th>GPT</th></tr></thead><tbody>
|
||||
<tr><td>用于分区磁盘并存储分区布局信息</td><td>用于分区磁盘并存储分区布局信息</td></tr>
|
||||
<tr><td>支持最多4个主分区或3个主分区加1个扩展分区</td><td>支持最多4个主分区或3个主分区加1个扩展分区支持最多4个主分区或3个主分区加1个扩展分区</td></tr>
|
||||
<tr><td></td><td>具有更好的数据完整性和可靠性,使用校验和检测数据损坏</td></tr>
|
||||
<tr><td></td><td>UEFI需要GPT格式的磁盘才能引导</td></tr>
|
||||
</tbody></table>
|
||||
<h3 id="uefi-legacy">UEFI/Legacy</h3>
|
||||
<table><thead><tr><th>UEFI 引导模式</th><th>Legacy引导模式</th></tr></thead><tbody>
|
||||
<tr><td>UEFI 提供了更好的用户界面</td><td>Legacy引导模式是传统的且非常基本的</td></tr>
|
||||
<tr><td>使用 GPT 分区方案</td><td>使用 MBR 分区方案</td></tr>
|
||||
<tr><td>UEFI 提供更快的启动时间</td><td>相比UEFI,它的速度较慢</td></tr>
|
||||
<tr><td>由于 UEFI 使用 GPT 分区方案,因此它可以支持多达 9 zB 的存储设备</td><td>Legacy使用的 MBR 分区方案仅支持最多 2 TB 存储设备</td></tr>
|
||||
<tr><td>UEFI 以 32 位和 64 位运行,支持鼠标和触摸板</td><td>Legacy在仅支持键盘,仅 16 位模式下运行</td></tr>
|
||||
<tr><td>它允许安全启动,防止加载未经授权的应用程序它还可能阻碍双启动,因为它将操作系统(OS)视为应用程序</td><td>它不提供允许加载未经授权的应用程序的安全启动方法,未限制双启动</td></tr>
|
||||
<tr><td>它具有更简单的更新过程</td><td>与UEFI相比,它更复杂</td></tr>
|
||||
</tbody></table>
|
||||
<h2 id="zu-he">组合</h2>
|
||||
<ul>
|
||||
<li>
|
||||
<p><strong>BIOS+MBR</strong>:</p>
|
||||
<p>这是最传统的,系统都会支持;唯一的缺点就是<code>不支持容量大于2T的硬盘</code>。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>BIOS+GPT</strong>:</p>
|
||||
<p>BIOS是可以使用GPT分区表的硬盘来作为数据盘的,但不能引导系统;若电脑同时带有容量小于2T的硬盘和容量大于2T的硬盘,<code>小于2T的可以用MBR分区表安装系统,而大于2T的可以使用GPT分区表来存放资料</code>。但系统须使用64位系统。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>UEFI+MBR</strong>:</p>
|
||||
<p>可以把UEFI设置成<code>Legacy模式</code>(传统模式)让其支持传统MBR启动,效果同<code>BIOS+MBR</code>;也可以建立FAT分区,放置UEFI启动文件来,可应用在U盘和移动硬盘上实现双模式启动。</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><strong>UEFI+GPT</strong>:</p>
|
||||
<p>如果要把大于2T的硬盘作为系统盘来安装系统的话,就必须<code>UEFI+GPT</code>。而且系统须使用64位系统,否则无法引导。但系统又不是传统在PE下安装后就能直接使用的,引导还得经过处理才行。</p>
|
||||
</li>
|
||||
</ul>
|
||||
<h2 id="xi-tong-de-qi-dong-guo-cheng">系统的启动过程</h2>
|
||||
<p>从按下计算机的开机按钮到用户开始使用计算机,涉及了多个步骤和组件,让我们一起详细了解整个过程:</p>
|
||||
<p><strong>1. 电源启动</strong>:</p>
|
||||
<ul>
|
||||
<li>用户按下计算机的开机按钮,电源开始供电,计算机硬件开始初始化。电源将电流传递到主板上的BIOS/UEFI芯片。</li>
|
||||
</ul>
|
||||
<p><strong>2. BIOS/UEFI启动</strong>:</p>
|
||||
<ul>
|
||||
<li>BIOS/UEFI芯片接收到电源信号后,开始执行初始化过程。它首先进行自检(POST),检测主板、CPU、内存等硬件设备的工作状态,并在显示屏上输出相关信息。</li>
|
||||
<li>BIOS/UEFI根据配置的启动顺序(通常为硬盘、光盘、USB等)搜索启动设备,并加载位于启动设备上的引导加载程序。</li>
|
||||
</ul>
|
||||
<p><strong>3. 引导加载程序加载</strong>:</p>
|
||||
<ul>
|
||||
<li>引导加载程序(如GRUB)被加载到内存中,它负责后续的操作系统加载过程。GRUB通常会显示启动菜单,列出可用的操作系统选项。</li>
|
||||
<li>用户可以在GRUB菜单中选择要启动的操作系统,或者等待默认选项启动。</li>
|
||||
</ul>
|
||||
<p><strong>4. 操作系统加载</strong>:</p>
|
||||
<ul>
|
||||
<li>一旦选择了启动选项,引导加载程序会加载操作系统的内核和初始化RAM磁盘(initramfs/initrd)。</li>
|
||||
<li>内核加载完成后,操作系统开始启动初始化过程,包括加载系统服务、挂载文件系统、启动用户界面等。</li>
|
||||
</ul>
|
||||
<p><strong>5. 用户登录</strong>:</p>
|
||||
<ul>
|
||||
<li>操作系统初始化完成后,显示登录界面(如果配置了图形用户界面),用户输入用户名和密码登录系统。</li>
|
||||
<li>如果登录成功,操作系统加载用户的桌面环境或命令行界面,用户开始使用计算机。</li>
|
||||
</ul>
|
||||
<h2 id="ge-chong-yin-dao-jia-zai-cheng-xu">各种引导加载程序</h2>
|
||||
<table><thead><tr><th>特性</th><th>GRUB(GRand Unified Bootloader)</th><th>LILO(Linux Loader)</th><th>systemd-boot(前身为 gummiboot)</th><th>rEFInd(UEFI 引导管理器)</th></tr></thead><tbody>
|
||||
<tr><td><strong>支持的系统类型</strong></td><td>BIOS 和 UEFI</td><td>仅支持 BIOS 模式</td><td>仅支持 UEFI</td><td>仅支持 UEFI</td></tr>
|
||||
<tr><td><strong>多系统引导支持</strong></td><td>✅ 强大支持</td><td>❌ 不支持多系统引导</td><td>✅ 支持(需手动配置)</td><td>✅ 自动检测操作系统</td></tr>
|
||||
<tr><td><strong>图形界面支持</strong></td><td>✅ 支持(可自定义主题)</td><td>❌ 不支持</td><td>❌ 不支持</td><td>✅ 支持(可自定义主题)</td></tr>
|
||||
<tr><td><strong>配置方式</strong></td><td>配置文件(复杂)</td><td>配置文件(简单)</td><td>配置文件(简单)</td><td>配置文件(简单)</td></tr>
|
||||
<tr><td><strong>命令行支持</strong></td><td>✅ 支持(交互式命令行)</td><td>❌ 不支持</td><td>❌ 不支持</td><td>❌ 不支持</td></tr>
|
||||
<tr><td><strong>文件系统支持</strong></td><td>✅ 支持多种文件系统</td><td>✅ 支持 ext2/ext3/ext4 等</td><td>✅ 支持 ext4、FAT 等</td><td>✅ 支持 ext4、FAT 等</td></tr>
|
||||
<tr><td><strong>安全启动支持</strong></td><td>✅ 支持(需配置)</td><td>❌ 不支持</td><td>✅ 支持(需配置)</td><td>✅ 支持(需配置)</td></tr>
|
||||
<tr><td><strong>安装复杂度</strong></td><td>中等(需配置)</td><td>较低</td><td>较低</td><td>中等(需配置)</td></tr>
|
||||
<tr><td><strong>适用场景</strong></td><td>多系统引导、复杂配置</td><td>简单系统引导</td><td>简单系统引导</td><td>多系统引导、美观界面</td></tr>
|
||||
</tbody></table>
|
||||
<h2 id="hou-ji">后记</h2>
|
||||
<ul>
|
||||
<li><a href="https://segmentfault.com/a/1190000020850901">聊聊BIOS、UEFI、MBR、GPT、GRUB……</a></li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="pagination">
|
||||
<div class="pagination__title">
|
||||
<span class="pagination__title-h">Thanks for reading! Read other posts?</span>
|
||||
<hr />
|
||||
</div>
|
||||
<div class="pagination__buttons">
|
||||
<span class="button previous">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-4/">
|
||||
<span class="button__icon">←</span>
|
||||
<span class="button__text">Linux之旅(4):Terminal,Console and Shell</span>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
|
||||
<span class="button next">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-6/">
|
||||
<span class="button__text">Linux之旅(6):常用命令与性能分析</span>
|
||||
<span class="button__icon">→</span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<footer class="footer">
|
||||
<div class="footer__inner">
|
||||
<div class="copyright">
|
||||
<span>©
|
||||
2025
|
||||
Dichgrem</span>
|
||||
<span class="copyright-theme">
|
||||
<span class="copyright-theme-sep"> :: CC BY-SA 4.0 :: A friend comes from distant lands</span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,353 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<title>Dich'blog</title>
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
<meta name="robots" content="noodp"/>
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/style.css">
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/color/blue.css">
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/color/background_dark.css">
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/font-hack-subset.css">
|
||||
|
||||
<meta name="description" content="">
|
||||
|
||||
<meta property="og:description" content="">
|
||||
<meta property="og:title" content="Dich'blog">
|
||||
<meta property="og:type" content="article">
|
||||
<meta property="og:url" content="https://blog.dich.bid/learn-linux-for-pc-6/">
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:description" content="">
|
||||
<meta name="twitter:title" content="Dich'blog">
|
||||
<meta property="twitter:domain" content="blog.dich.bid">
|
||||
<meta property="twitter:url" content="https://blog.dich.bid/learn-linux-for-pc-6/">
|
||||
|
||||
<link rel="alternate" type="application/atom+xml" title="Dich'blog Atom Feed" href="https://blog.dich.bid/atom.xml" />
|
||||
|
||||
|
||||
<link rel="icon" type="image/png" href=/dich.webp />
|
||||
|
||||
<!-- ✅ Added center alignment styles -->
|
||||
<style>
|
||||
.footer {
|
||||
text-align: center;
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
.footer__inner {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.copyright {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="">
|
||||
<div class="container">
|
||||
|
||||
<header class="header">
|
||||
<div class="header__inner">
|
||||
<div class="header__logo">
|
||||
|
||||
<a href="https://blog.dich.bid" style="text-decoration: none;">
|
||||
<div class="logo">
|
||||
|
||||
Dich'blog
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<nav class="menu">
|
||||
<ul class="menu__inner">
|
||||
<li class="active"><a href="https://blog.dich.bid">blog</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/archive">archive</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/tags">tags</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/weekly">weekly</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/search">search</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/about">about me</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/links">links</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/atom.xml">rss</a></li>
|
||||
|
||||
<li><a href="https://github.com/Dichgrem" target="_blank" rel="noopener noreferrer">github</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
|
||||
<div class="content">
|
||||
|
||||
<div class="post">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/learn-linux-for-pc-6/">Linux之旅(6):常用命令与性能分析</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
2023-07-25
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<span class="post-tags-inline">
|
||||
:: tags:
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
|
||||
<div class="post-content">
|
||||
<p>前言 在学习Linux操作系统时,熟悉常用命令和性能分析工具是至关重要的。让我们一起探索Linux的世界,提升技能,解锁无限可能!</p>
|
||||
<span id="continue-reading"></span>
|
||||
<blockquote>
|
||||
<p>翻译自https://medium.com/netflix-techblog/linux-performance-analysis-in-60-000-milliseconds-accc10403c55。</p>
|
||||
</blockquote>
|
||||
<h2 id="wen-ti-bei-jing"><strong>问题背景</strong></h2>
|
||||
<p>当登录到一台有性能问题的Linux服务器,第一分钟要检查什么?</p>
|
||||
<p>在Netflix,我们拥有庞大的EC2 Linux虚拟机云,我们有众多性能分析工具来监视和诊断这些Linux服务器的性能。这些工具包括Atlas(负责整个虚拟机云的监控)和Vector(负责按需对虚拟机实例进行性能分析)。这些工具可以帮助我们解决大多数问题,但有时我们需要登录到虚拟机实例,并运行一些标准的Linux性能工具。</p>
|
||||
<h2 id="qian-60miao-zhai-yao"><strong>前60秒:摘要</strong></h2>
|
||||
<p>在本文中,Netflix性能工程团队将使用您应该使用的标准Linux工具在命令行中向您展示一个性能诊断过程的前60秒。在60秒内,您可以通过运行以下十个命令来了解有关系统资源使用和运行进程的信息。最应该关注的是一些很容易理解的错误、饱和度指标和资源利用率等指标。饱和度是衡量资源负载超出其处理能力的指标,它可以通过观察请求队列的长度或等待时间反映出来。</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>uptime
|
||||
</span><span>dmesg | tail
|
||||
</span><span>vmstat 1
|
||||
</span><span>mpstat -P ALL 1
|
||||
</span><span>pidstat 1
|
||||
</span><span>iostat -xz 1
|
||||
</span><span>free -m
|
||||
</span><span>sar -n DEV 1
|
||||
</span><span>sar -n TCP,ETCP 1
|
||||
</span><span>top
|
||||
</span></code></pre>
|
||||
<p>其中的一些命令需要安装sysstat软件包。这些命令暴露出的指标将帮助您完成一些USE方法:一种查找性能瓶颈的方法。它们涉及检查所有资源(CPU、内存、磁盘等)的利用率,饱和度和错误指标。在诊断过程中还应该注意检查和排除某些资源的问题。因为通过排除某些资源的问题,可以缩小诊断的范围,并指民后续的诊断。</p>
|
||||
<h2 id="uptime"><strong>uptime</strong></h2>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>$ uptime
|
||||
</span><span>23:51:26 up 21:31, 1 user, load average: 30.02, 26.43, 19.02
|
||||
</span></code></pre>
|
||||
<p>这是快速查看平均负载的方法,该平均负载指标了要运行的任务(进程)的数量。在Linux系统上,这些数字包括要在CPU上运行的进程以及在不中断IO(通常是磁盘IO)中阻塞的进程。这里给出了资源负载高层次的概览,但是没有其它工具就很难正确理解,值得快速看一眼。</p>
|
||||
<p>这三个数字是指数衰减移动平均值,分别代表了1分钟、5分钟、15分钟的平均值。这三个数字使我们对负载如何随时间变化有了一定的了解。例如,如果您去诊断一个有问题的服务器,发现1分钟的值比15分钟的值低很多,那么您可能已经登录得太晚了,错过了问题。</p>
|
||||
<p>在上面的例子中,平均负载有所增加,因为1分钟的值30相对15分钟的值19来说大了一些。数字变大意味着很多种可能:有可能是CPU的需求变多了,使用3和4中提到的vmstat或mpstat命令将可以进一步确认问题。</p>
|
||||
<h2 id="dmesg-tail"><strong>dmesg|tail</strong></h2>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>$ dmesg | tail
|
||||
</span><span>[1880957.563150] perl invoked oom-killer: gfp_mask=0x280da, order=0, oom_score_adj=0
|
||||
</span><span>[...]
|
||||
</span><span>[1880957.563400] Out of memory: Kill process 18694 (perl) score 246 or sacrifice child
|
||||
</span><span>[1880957.563408] Killed process 18694 (perl) total-vm:1972392kB, anon-rss:1953348kB, file-rss:0kB
|
||||
</span><span>[2320864.954447] TCP: Possible SYN flooding on port 7001. Dropping request. Check SNMP counters.
|
||||
</span></code></pre>
|
||||
<p>该命令展示最近 10条系统消息。在这些系统消息中查找有可能引起性能问题的报错。上面的例子包括oom-killer和TCP丢弃了一个请求。</p>
|
||||
<p>不能忘记这个步骤,dmesg通常对诊断问题很有价值。</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>## **vmstat 1**
|
||||
</span><span>$ vmstat 1
|
||||
</span><span>procs ---------memory---------- ---swap-- -----io---- -system-- ------cpu-----
|
||||
</span><span> r b swpd free buff cache si so bi bo in cs us sy id wa st
|
||||
</span><span>34 0 0 200889792 73708 591828 0 0 0 5 6 10 96 1 3 0 0
|
||||
</span><span>32 0 0 200889920 73708 591860 0 0 0 592 13284 4282 98 1 1 0 0
|
||||
</span><span>32 0 0 200890112 73708 591860 0 0 0 0 9501 2154 99 1 0 0 0
|
||||
</span><span>32 0 0 200889568 73712 591856 0 0 0 48 11900 2459 99 0 0 0 0
|
||||
</span><span>32 0 0 200890208 73712 591860 0 0 0 0 15898 4840 98 1 1 0 0
|
||||
</span></code></pre>
|
||||
<p>vmstat是虚拟内存统计(Virtual Memory Stat)的缩写,vmstat(8)是一个通常可用的工具(最初是在之前的BSD时代创建的),它每行打印一行服务器关键统计的概览。</p>
|
||||
<p>vmstat使用参数1运行,意味着每1秒打印打印一次概览。命令输出的第一行展示的是从启动开始的平均值,而不是最近一秒的平均值。因此跳过第一行,除非您想学习并记住哪一列是哪一列。</p>
|
||||
<p>要检查的列:</p>
|
||||
<p>r:在CPU上运行并等待回合的进程数。由于它不包含IO,因此它比指示CPU饱和的平均负载提供了更多的信息。一个大于CPU核数的r值就是饱和的。
|
||||
free:空闲的内存(单位的KB)。如果计数很大,说明服务器有足够的内存,free -m命令将对空闲内存的状态有更好的说明。
|
||||
si、so:交换置入和交换置出。如果这两个值是非空,说明物理内存用完了,现在在使用交换内存了。
|
||||
us、sy、id、wa、st:这些是CPU时间的分类,其是所有CPU的平均值。它们是用户时间、系统时间(内核)、空闲时间、等待IO和被偷窃时间(被其它宾客系统进行使用,或宾客系统隔离的驱动程序域Xen)
|
||||
通过将用户时间和系统时间这两个分类相加,即可判断CPU是否繁忙。一定的等待IO时间说明磁盘有可能是性能瓶颈。你可以认为等待IO时间是另一种形式的空闲时间,它提供了它是如何空闲的线索。</p>
|
||||
<p>IO处理需要占用CPU系统时间。一个较高的CPU系统时间(超过20%)可能会很有趣,有必要进一步研究:也许内核在很低效地处理IO。</p>
|
||||
<p>在上面的示例中,CPU时间基本全在用户时间,这说明应用程序本身在大量占用CPU时间。CPU的平均利用率也远远超过90%。这不一定是问题,可以使用r列来检查饱和度。</p>
|
||||
<h2 id="mpstat-p-all-1"><strong>mpstat -P ALL 1</strong></h2>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>$ mpstat -P ALL 1
|
||||
</span><span>Linux 3.13.0-49-generic (titanclusters-xxxxx) 07/14/2015 _x86_64_ (32 CPU)
|
||||
</span><span>07:38:49 PM CPU %usr %nice %sys %iowait %irq %soft %steal %guest %gnice %idle
|
||||
</span><span>07:38:50 PM all 98.47 0.00 0.75 0.00 0.00 0.00 0.00 0.00 0.00 0.78
|
||||
</span><span>07:38:50 PM 0 96.04 0.00 2.97 0.00 0.00 0.00 0.00 0.00 0.00 0.99
|
||||
</span><span>07:38:50 PM 1 97.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 2.00
|
||||
</span><span>07:38:50 PM 2 98.00 0.00 1.00 0.00 0.00 0.00 0.00 0.00 0.00 1.00
|
||||
</span><span>07:38:50 PM 3 96.97 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3.03
|
||||
</span><span>[...]
|
||||
</span></code></pre>
|
||||
<p>此命令显示每个CPU的CPU时间明细,可用于检查不平衡的情况。单个热CPU说明是单线程应用程序在大量占用CPU时间。</p>
|
||||
<h2 id="pidstat-1"><strong>pidstat 1</strong></h2>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>$ pidstat 1
|
||||
</span><span>Linux 3.13.0-49-generic (titanclusters-xxxxx) 07/14/2015 _x86_64_ (32 CPU)
|
||||
</span><span>07:41:02 PM UID PID %usr %system %guest %CPU CPU Command
|
||||
</span><span>07:41:03 PM 0 9 0.00 0.94 0.00 0.94 1 rcuos/0
|
||||
</span><span>07:41:03 PM 0 4214 5.66 5.66 0.00 11.32 15 mesos-slave
|
||||
</span><span>07:41:03 PM 0 4354 0.94 0.94 0.00 1.89 8 java
|
||||
</span><span>07:41:03 PM 0 6521 1596.23 1.89 0.00 1598.11 27 java
|
||||
</span><span>07:41:03 PM 0 6564 1571.70 7.55 0.00 1579.25 28 java
|
||||
</span><span>07:41:03 PM 60004 60154 0.94 4.72 0.00 5.66 9 pidstat
|
||||
</span><span>07:41:03 PM UID PID %usr %system %guest %CPU CPU Command
|
||||
</span><span>07:41:04 PM 0 4214 6.00 2.00 0.00 8.00 15 mesos-slave
|
||||
</span><span>07:41:04 PM 0 6521 1590.00 1.00 0.00 1591.00 27 java
|
||||
</span><span>07:41:04 PM 0 6564 1573.00 10.00 0.00 1583.00 28 java
|
||||
</span><span>07:41:04 PM 108 6718 1.00 0.00 0.00 1.00 0 snmp-pass
|
||||
</span><span>07:41:04 PM 60004 60154 1.00 4.00 0.00 5.00 9 pidstat
|
||||
</span></code></pre>
|
||||
<p>pidstat有点像top的每个进程摘要,但是会滚动打印,而不是清屏再打印。这对于观察一段时间内的模式以及将所看到的内容(复制&粘贴)记录到调查记录中很有用。</p>
|
||||
<p>上面的示例显示两个Java进程要为消耗大量CPU负责。%CPU这一列是所有CPU核的总和,1591%说明Java进程差不多消耗了16个核的CPU。</p>
|
||||
<h2 id="iostat-xz-1"><strong>iostat -xz 1</strong></h2>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>$ iostat -xz 1
|
||||
</span><span>Linux 3.13.0-49-generic (titanclusters-xxxxx) 07/14/2015 _x86_64_ (32 CPU)
|
||||
</span><span>avg-cpu: %user %nice %system %iowait %steal %idle
|
||||
</span><span> 73.96 0.00 3.73 0.03 0.06 22.21
|
||||
</span><span>Device: rrqm/s wrqm/s r/s w/s rkB/s wkB/s avgrq-sz avgqu-sz await r_await w_await svctm %util
|
||||
</span><span>xvda 0.00 0.23 0.21 0.18 4.52 2.08 34.37 0.00 9.98 13.80 5.42 2.44 0.09
|
||||
</span><span>xvdb 0.01 0.00 1.02 8.94 127.97 598.53 145.79 0.00 0.43 1.78 0.28 0.25 0.25
|
||||
</span><span>xvdc 0.01 0.00 1.02 8.86 127.79 595.94 146.50 0.00 0.45 1.82 0.30 0.27 0.26
|
||||
</span><span>dm-0 0.00 0.00 0.69 2.32 10.47 31.69 28.01 0.01 3.23 0.71 3.98 0.13 0.04
|
||||
</span><span>dm-1 0.00 0.00 0.00 0.94 0.01 3.78 8.00 0.33 345.84 0.04 346.81 0.01 0.00
|
||||
</span><span>dm-2 0.00 0.00 0.09 0.07 1.35 0.36 22.50 0.00 2.55 0.23 5.62 1.78 0.03
|
||||
</span><span>[...]
|
||||
</span></code></pre>
|
||||
<p>这是了解块设备(磁盘),应用的工作负载和产生的性能影响的绝佳工具。重点关注下面的指标:</p>
|
||||
<ul>
|
||||
<li>r/s、w/s、 rkB/s、 wkB/s:这些是设备每秒交付的读取、写入、读取千字节和写入千字节。使用这些来表征块设备的工作负载。性能问题可能是由于向块设备施加了过多的工作负载。</li>
|
||||
<li>await:IO的平均时间,以毫秒为单位。这是应用程序所感受到的时间,它包括IO排队时间和IO服务时间。大于预期的平均时间可能表示块设备饱和或设备出现问题了。</li>
|
||||
<li>avgqu-sz:发给设备的平均请求数。值大于1可以表明已达到饱和状态(尽管设备通常可以并行处理请求,尤其是在多个后端磁盘所组成的前端虚拟设备的情况下)。</li>
|
||||
<li>%util:设备利用率。这是一个表征繁忙度的百分比,它表示设备每秒工作的时间。尽管它的值取决于设备,但值大于60%通常会导致性能不佳(也会通过await的值观察到)。接近100%的值通常表示饱和。</li>
|
||||
</ul>
|
||||
<p>如果存储设备是有许多后端磁盘组成的前端逻辑磁盘设备,则100%的利用率可能仅意味着100%的时间正在处理某些IO,但是后端磁盘可能远远没有饱和,并且可能还可以处理更多的工作。</p>
|
||||
<p>请记住,性能不佳的磁盘IO不一定是应用问题,通常可以使用许多技术以执行异步IO,以便使应用程序不会被阻塞住而产生直接产生IO延迟(例如,预读和缓冲写入技术)</p>
|
||||
<h2 id="free-m"><strong>free -m</strong></h2>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>$ free -m
|
||||
</span><span> total used free shared buffers cached
|
||||
</span><span>Mem: 245998 24545 221453 83 59 541
|
||||
</span><span>-/+ buffers/cache: 23944 222053
|
||||
</span><span>Swap: 0 0 0
|
||||
</span></code></pre>
|
||||
<p>右边两列:</p>
|
||||
<p>buffers:缓冲区高速缓存,用于块设备I / O
|
||||
cached:页面缓存,由文件系统使用
|
||||
我们只需要检查下它们的大小是否接近零。如果接近零的话,这可能导致较高的磁盘IO(可以使用iostat进行确认)和较差的性能。上面的示例看起来不错,每列都有较大的数据。</p>
|
||||
<p>-/+ buffers/cache为已用和空闲内存提供较少让人产生混乱的值。Linux将可用内存用于高速缓存,但是如果应用程序需要,它们可以快速被回收。因此应以某种方式将缓存的内存包括在free列中,这也就是这一行的所做的。甚至还有一个网站专门讨论了这种混乱。</p>
|
||||
<p>如果在Linux上使用ZFS,就像我们对某些服务所做的那么,因为ZFS具有自己的文件系统缓存,它们并不会反映在free -m的列中,因此这种场景下这种混乱还将存在。所以会看到似乎系统的可用内存不足,而实际上可根据需要从ZFS缓存中申请到内存。</p>
|
||||
<h2 id="sar-n-dev-1"><strong>sar -n DEV 1</strong></h2>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>$ sar -n DEV 1
|
||||
</span><span>Linux 3.13.0-49-generic (titanclusters-xxxxx) 07/14/2015 _x86_64_ (32 CPU)
|
||||
</span><span>12:16:48 AM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil
|
||||
</span><span>12:16:49 AM eth0 18763.00 5032.00 20686.42 478.30 0.00 0.00 0.00 0.00
|
||||
</span><span>12:16:49 AM lo 14.00 14.00 1.36 1.36 0.00 0.00 0.00 0.00
|
||||
</span><span>12:16:49 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
|
||||
</span><span>12:16:49 AM IFACE rxpck/s txpck/s rxkB/s txkB/s rxcmp/s txcmp/s rxmcst/s %ifutil
|
||||
</span><span>12:16:50 AM eth0 19763.00 5101.00 21999.10 482.56 0.00 0.00 0.00 0.00
|
||||
</span><span>12:16:50 AM lo 20.00 20.00 3.25 3.25 0.00 0.00 0.00 0.00
|
||||
</span><span>12:16:50 AM docker0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
|
||||
</span></code></pre>
|
||||
<p>此工具可以检查网络接口的吞吐量:rxkB/s和txkB/s,作为工作负载的度量,还可以检查是否已达到网络接口的限制。在上面的示例中,eth0接收速率达到22MB/s,即176Mbit/s(远低于1Gbit/s的网络接口限制,假设是千兆网卡)。</p>
|
||||
<p>此版本还具有%ifutil用来指示设备利用率(全双工双向),这也是我们使用的Brendan的nicstat工具测量出来的。就像nicstat一样,这个指标很难计算正确,而且在本例中好像不起作用(数据是0.00)。</p>
|
||||
<h2 id="sar-n-tcp-etcp-1"><strong>sar -n TCP,ETCP 1</strong></h2>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>$ sar -n TCP,ETCP 1
|
||||
</span><span>Linux 3.13.0-49-generic (titanclusters-xxxxx) 07/14/2015 _x86_64_ (32 CPU)
|
||||
</span><span>12:17:19 AM active/s passive/s iseg/s oseg/s
|
||||
</span><span>12:17:20 AM 1.00 0.00 10233.00 18846.00
|
||||
</span><span>12:17:19 AM atmptf/s estres/s retrans/s isegerr/s orsts/s
|
||||
</span><span>12:17:20 AM 0.00 0.00 0.00 0.00 0.00
|
||||
</span><span>12:17:20 AM active/s passive/s iseg/s oseg/s
|
||||
</span><span>12:17:21 AM 1.00 0.00 8359.00 6039.00
|
||||
</span><span>12:17:20 AM atmptf/s estres/s retrans/s isegerr/s orsts/s
|
||||
</span><span>12:17:21 AM 0.00 0.00 0.00 0.00 0.00
|
||||
</span></code></pre>
|
||||
<p>这是一些关键的TCP指标的摘要,包括:</p>
|
||||
<ul>
|
||||
<li>active / s:每秒本地启动的TCP连接数(例如,通过connect())。</li>
|
||||
<li>passive/s:每秒远程启动的TCP连接数(例如,通过accept())。</li>
|
||||
<li>retrans / s:每秒TCP重传的次数。
|
||||
主动和被动计数通常作为服务器TCP负载的粗略度量:新接受的连接数(被动)和新出站的连接数(主动)。将主动视为出站,将被动视为入站可能对理解这两个指标有些帮助,但这并不是严格意义上的(例如,考虑从localhost到localhost的连接)。</li>
|
||||
</ul>
|
||||
<p>重新传输是网络或服务器问题的迹象;它可能是不可靠的网络(例如,公共Internet),也可能是由于服务器过载并丢弃了数据包。上面的示例仅显示每秒一个新的TCP连接。</p>
|
||||
<h2 id="top"><strong>top</strong></h2>
|
||||
<p>$ top</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>top - 00:15:40 up 21:56, 1 user, load average: 31.09, 29.87, 29.92
|
||||
</span><span>Tasks: 871 total, 1 running, 868 sleeping, 0 stopped, 2 zombie
|
||||
</span><span>%Cpu(s): 96.8 us, 0.4 sy, 0.0 ni, 2.7 id, 0.1 wa, 0.0 hi, 0.0 si, 0.0 st
|
||||
</span><span>KiB Mem: 25190241+total, 24921688 used, 22698073+free, 60448 buffers
|
||||
</span><span>KiB Swap: 0 total, 0 used, 0 free. 554208 cached Mem
|
||||
</span><span> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
|
||||
</span><span> 20248 root 20 0 0.227t 0.012t 18748 S 3090 5.2 29812:58 java
|
||||
</span><span> 4213 root 20 0 2722544 64640 44232 S 23.5 0.0 233:35.37 mesos-slave
|
||||
</span><span> 66128 titancl+ 20 0 24344 2332 1172 R 1.0 0.0 0:00.07 top
|
||||
</span><span> 5235 root 20 0 38.227g 547004 49996 S 0.7 0.2 2:02.74 java
|
||||
</span><span> 4299 root 20 0 20.015g 2.682g 16836 S 0.3 1.1 33:14.42 java
|
||||
</span><span> 1 root 20 0 33620 2920 1496 S 0.0 0.0 0:03.82 init
|
||||
</span><span> 2 root 20 0 0 0 0 S 0.0 0.0 0:00.02 kthreadd
|
||||
</span><span> 3 root 20 0 0 0 0 S 0.0 0.0 0:05.35 ksoftirqd/0
|
||||
</span><span> 5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H
|
||||
</span><span> 6 root 20 0 0 0 0 S 0.0 0.0 0:06.94 kworker/u256:0
|
||||
</span><span> 8 root 20 0 0 0 0 S 0.0 0.0 2:38.05 rcu_sched
|
||||
</span></code></pre>
|
||||
<p>top命令包括我们之前检查的许多指标。运行它可以很方便地查看是否有任何东西与以前的命令有很大不同,这表明负载是可变的。</p>
|
||||
<p>top命令不太好的地方是,随着时间的推移很难看到指标变化的模式,这在提供滚动输出的vmstat和pidstat之类的工具中可能更清楚一点。如果您没有足够快地暂停输出(Ctrl-S暂停,Ctrl-Q继续),在屏幕输出被top命令清除后,间歇性问题的证据也可能被丢失了。</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="pagination">
|
||||
<div class="pagination__title">
|
||||
<span class="pagination__title-h">Thanks for reading! Read other posts?</span>
|
||||
<hr />
|
||||
</div>
|
||||
<div class="pagination__buttons">
|
||||
<span class="button previous">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-5/">
|
||||
<span class="button__icon">←</span>
|
||||
<span class="button__text">Linux之旅(5):BIOS-UEFI-MBR-GPT-GRUB</span>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
|
||||
<span class="button next">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-7/">
|
||||
<span class="button__text">Linux之旅(7):系统与终端字体设置</span>
|
||||
<span class="button__icon">→</span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<footer class="footer">
|
||||
<div class="footer__inner">
|
||||
<div class="copyright">
|
||||
<span>©
|
||||
2025
|
||||
Dichgrem</span>
|
||||
<span class="copyright-theme">
|
||||
<span class="copyright-theme-sep"> :: CC BY-SA 4.0 :: A friend comes from distant lands</span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -211,6 +211,25 @@
|
||||
<div class="post-content">
|
||||
<p><a href="https://blog.0pt.icu/">blog.0pt.icu</a></p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="post on-list">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/links/link-7/">coperlm's Blog</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date"></span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="post-content">
|
||||
<p><a href="https://coperlm.github.io">coperlm.github.io</a></p>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -123,6 +123,13 @@
|
||||
<hr />
|
||||
</div>
|
||||
<div class="pagination__buttons">
|
||||
<span class="button previous">
|
||||
<a href="https://blog.dich.bid/links/link-7/">
|
||||
<span class="button__icon">←</span>
|
||||
<span class="button__text">coperlm's Blog</span>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
|
||||
<span class="button next">
|
||||
<a href="https://blog.dich.bid/links/link-5/">
|
||||
|
@ -20,13 +20,13 @@
|
||||
<meta property="og:description" content="">
|
||||
<meta property="og:title" content="Dich'blog">
|
||||
<meta property="og:type" content="article">
|
||||
<meta property="og:url" content="https://blog.dich.bid/learn-linux-for-pc-7/">
|
||||
<meta property="og:url" content="https://blog.dich.bid/links/link-7/">
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:description" content="">
|
||||
<meta name="twitter:title" content="Dich'blog">
|
||||
<meta property="twitter:domain" content="blog.dich.bid">
|
||||
<meta property="twitter:url" content="https://blog.dich.bid/learn-linux-for-pc-7/">
|
||||
<meta property="twitter:url" content="https://blog.dich.bid/links/link-7/">
|
||||
|
||||
<link rel="alternate" type="application/atom+xml" title="Dich'blog Atom Feed" href="https://blog.dich.bid/atom.xml" />
|
||||
|
||||
@ -71,10 +71,9 @@
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<nav class="menu">
|
||||
<nav class="menu">
|
||||
<ul class="menu__inner">
|
||||
<li class="active"><a href="https://blog.dich.bid">blog</a></li>
|
||||
<li><a href="https://blog.dich.bid">blog</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/archive">archive</a></li>
|
||||
|
||||
@ -86,7 +85,7 @@
|
||||
|
||||
<li><a href="https://blog.dich.bid/about">about me</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/links">links</a></li>
|
||||
<li class="active"><a href="https://blog.dich.bid/links">links</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/atom.xml">rss</a></li>
|
||||
|
||||
@ -103,53 +102,17 @@
|
||||
|
||||
<div class="post">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/learn-linux-for-pc-7/">Linux之旅(7):系统与终端字体设置</a></h1>
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/links/link-7/">coperlm's Blog</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
2023-08-01
|
||||
</span>
|
||||
<span class="post-date"></span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<span class="post-tags-inline">
|
||||
:: tags:
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
|
||||
<div class="post-content">
|
||||
<p>前言 一个好看的字体会提高工作效率与审美.Linux 下的字体可以很漂亮,但需要一些设置.</p>
|
||||
<span id="continue-reading"></span>
|
||||
<p>随着 FreeType2 由于专利过期默认开启了高质量的 LCD 优化,以及一批高质量的开源字体的公布,Linux 上的中文字体渲染比过去好了太多.</p>
|
||||
<blockquote>
|
||||
<p>Windows 的字体渲染从技术上来说是相当先进的,问题是在中文字体的选择上实在是一坨...</p>
|
||||
</blockquote>
|
||||
<h2 id="xuan-ze-zi-ti">选择字体</h2>
|
||||
<p>近几年来出现了一大批自由字体(包括工作量极大的 CJK 字体),使 Linux 下的字体选择一下子丰富了起来.如果愿意花一点时间的话,可以去<a href="https://wiki.archlinux.org/title/Fonts#Font_packages">ArchWiki</a> 上看看,里面涵盖了相当多的自由字体.</p>
|
||||
<h3 id="zhong-duan-zi-ti">终端字体</h3>
|
||||
<p><a href="https://github.com/subframe7536/maple-font?tab=readme-ov-file">Maple Mono</a>,这是一款字形整洁、拥有手写风格的斜体、细粒度配置、内置 Nerd-Font、中英文2:1等宽 的字体.我使用的:</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>MapleMono-Bold
|
||||
</span></code></pre>
|
||||
<h3 id="yue-du-qi-zi-ti">阅读器字体</h3>
|
||||
<p><a href="https://github.com/lxgw/LxgwWenKai">霞鹜文楷</a>,一款开源中文字体,基于 FONTWORKS 出品字体 Klee One 衍生.我使用的:</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>LXGW WenKai
|
||||
</span></code></pre>
|
||||
<h3 id="liu-lan-qi-zi-ti">浏览器字体</h3>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>拉丁字体
|
||||
</span><span>├── Inter -无衬线,类似于 Roboto 但更适合屏幕显示的字体
|
||||
</span><span>├── Noto Serif -衬线
|
||||
</span><span>└── Sarasa Term SC -等宽,拉丁文字符严格为半宽的字体,中英文混排时较协调
|
||||
</span><span>├── 如果不适应这种较瘦的字体风格, 则可以尝试使用:
|
||||
</span><span>│ ├── Adobe Source Pro
|
||||
</span><span>│ ├── Cascadia Code
|
||||
</span><span>│ └── Fira Code
|
||||
</span><span>中文字体
|
||||
</span><span>├── Noto Sans CJK SC (思源黑体)
|
||||
</span><span>└── Noto Serif CJK SC(思源宋体)
|
||||
</span></code></pre>
|
||||
<hr />
|
||||
<p><strong>Done.</strong></p>
|
||||
<p><a href="https://coperlm.github.io">coperlm.github.io</a></p>
|
||||
|
||||
</div>
|
||||
|
||||
@ -160,17 +123,10 @@
|
||||
<hr />
|
||||
</div>
|
||||
<div class="pagination__buttons">
|
||||
<span class="button previous">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-6/">
|
||||
<span class="button__icon">←</span>
|
||||
<span class="button__text">Linux之旅(6):常用命令与性能分析</span>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
|
||||
<span class="button next">
|
||||
<a href="https://blog.dich.bid/awesome-vm-android/">
|
||||
<span class="button__text">综合工程:linux搭建安卓虚拟机</span>
|
||||
<a href="https://blog.dich.bid/links/link-6/">
|
||||
<span class="button__text">世纪大道 | 春风少年兄</span>
|
||||
<span class="button__icon">→</span>
|
||||
</a>
|
||||
</span>
|
@ -1,6 +1,12 @@
|
||||
<!doctype html>
|
||||
<meta charset="utf-8">
|
||||
<link rel="canonical" href="https://blog.dich.bid/">
|
||||
<meta http-equiv="refresh" content="0; url=https://blog.dich.bid/">
|
||||
<title>Redirect</title>
|
||||
<script>
|
||||
const target = "https://blog.dich.bid/";
|
||||
const hash = window.location.hash || "";
|
||||
window.location.replace(target + hash);
|
||||
</script>
|
||||
<noscript>
|
||||
<meta http-equiv="refresh" content="0; url=https://blog.dich.bid/">
|
||||
</noscript>
|
||||
<p><a href="https://blog.dich.bid/">Click here</a> to be redirected.</p>
|
||||
|
@ -1,235 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<title>Dich'blog</title>
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
<meta name="robots" content="noodp"/>
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/style.css">
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/color/blue.css">
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/color/background_dark.css">
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/font-hack-subset.css">
|
||||
|
||||
<meta name="description" content="用电子罗盘,转赛博核桃,勘电磁风水,寻网络龙脉">
|
||||
|
||||
<meta property="og:description" content="用电子罗盘,转赛博核桃,勘电磁风水,寻网络龙脉">
|
||||
<meta property="og:title" content="Dich'blog">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:url" content="https://blog.dich.bid/">
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:description" content="用电子罗盘,转赛博核桃,勘电磁风水,寻网络龙脉">
|
||||
<meta name="twitter:title" content="Dich'blog">
|
||||
<meta property="twitter:domain" content="blog.dich.bid">
|
||||
<meta property="twitter:url" content="https://blog.dich.bid/">
|
||||
|
||||
<link rel="alternate" type="application/atom+xml" title="Dich'blog Atom Feed" href="https://blog.dich.bid/atom.xml" />
|
||||
|
||||
|
||||
<link rel="icon" type="image/png" href=/dich.webp />
|
||||
|
||||
<!-- ✅ Added center alignment styles -->
|
||||
<style>
|
||||
.footer {
|
||||
text-align: center;
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
.footer__inner {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.copyright {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="">
|
||||
<div class="container">
|
||||
|
||||
<header class="header">
|
||||
<div class="header__inner">
|
||||
<div class="header__logo">
|
||||
|
||||
<a href="https://blog.dich.bid" style="text-decoration: none;">
|
||||
<div class="logo">
|
||||
|
||||
Dich'blog
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<nav class="menu">
|
||||
<ul class="menu__inner">
|
||||
<li class="active"><a href="https://blog.dich.bid">blog</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/archive">archive</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/tags">tags</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/weekly">weekly</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/search">search</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/about">about me</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/links">links</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/atom.xml">rss</a></li>
|
||||
|
||||
<li><a href="https://github.com/Dichgrem" target="_blank" rel="noopener noreferrer">github</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
|
||||
<div class="content">
|
||||
|
||||
<div class="posts">
|
||||
<div class="post on-list">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/learn-linux-for-pc-3/">Linux之旅(3):内核/shell/包管理/文件系统/桌面环境</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
2023-07-22
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<span class="post-tags-inline">
|
||||
:: tags:
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="post-content">
|
||||
<p>前言 在Linux世界中,内核/shell/包管理/文件系统构成了Linux系统的核心,它们相互配合,共同构建了一个强大而稳定的操作环境。本文将深入探讨这些关键组成部分,解释它们的作用和原理,帮助读者更好地理解Linux系统的运作机制。</p>
|
||||
</div>
|
||||
<div>
|
||||
<!-- ︎ -- force text style - some devices render this as emoji -->
|
||||
<a class="read-more button" href="https://blog.dich.bid/learn-linux-for-pc-3/">
|
||||
<span class="button__text">Read more</span>
|
||||
<span class="button__icon">↩︎</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="post on-list">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/learn-linux-for-pc-2/">Linux之旅(2):FHS与目录结构</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
2023-07-21
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<span class="post-tags-inline">
|
||||
:: tags:
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="post-content">
|
||||
<p>前言 在Linux世界中,Filesystem Hierarchy Standard(FHS)是一座引导我们进入系统核心的桥梁,它定义了Linux系统中目录结构的规范与作用,为我们提供了一张清晰的地图,指引我们轻松管理和理解系统。本文将深入探讨FHS规范与Linux系统目录结构,解释各个目录的用途与功能,帮助我们更好地理解和利用Linux系统。</p>
|
||||
</div>
|
||||
<div>
|
||||
<!-- ︎ -- force text style - some devices render this as emoji -->
|
||||
<a class="read-more button" href="https://blog.dich.bid/learn-linux-for-pc-2/">
|
||||
<span class="button__text">Read more</span>
|
||||
<span class="button__icon">↩︎</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="post on-list">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/learn-linux-for-pc-1/">Linux之旅(1):构成与发行版</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
2023-07-20
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<span class="post-tags-inline">
|
||||
:: tags:
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="post-content">
|
||||
<p>前言 Linux 作为一款强大、灵活且免费的操作系统,吸引了越来越多的用户。然而,对于初学者来说,Linux 可能显得有些陌生,甚至有些令人望而生畏。本文旨在为那些刚踏入 Linux 世界的新手提供一份指南,帮助他们更好地了解、使用这个令人着迷的操作系统。我们将探讨Linux的基本概念,解释为何选择Linux,深入剖析其主要构成要素以及不同的发行版之间的差异。</p>
|
||||
</div>
|
||||
<div>
|
||||
<!-- ︎ -- force text style - some devices render this as emoji -->
|
||||
<a class="read-more button" href="https://blog.dich.bid/learn-linux-for-pc-1/">
|
||||
<span class="button__text">Read more</span>
|
||||
<span class="button__icon">↩︎</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="pagination">
|
||||
<div class="pagination__buttons">
|
||||
<span class="button previous">
|
||||
<a href="https://blog.dich.bid/page/9/">
|
||||
<span class="button__icon">←</span>
|
||||
<span class="button__text">Newer posts</span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<footer class="footer">
|
||||
<div class="footer__inner">
|
||||
<div class="copyright">
|
||||
<span>©
|
||||
2025
|
||||
Dichgrem</span>
|
||||
<span class="copyright-theme">
|
||||
<span class="copyright-theme-sep"> :: CC BY-SA 4.0 :: A friend comes from distant lands</span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -203,7 +203,7 @@
|
||||
|
||||
<div class="post on-list">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/windows-conda-python/">Windows系列(5):Python开发配置</a></h1>
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/windows-5-py/">Windows系列(5):Python开发配置</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
@ -225,7 +225,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<!-- ︎ -- force text style - some devices render this as emoji -->
|
||||
<a class="read-more button" href="https://blog.dich.bid/windows-conda-python/">
|
||||
<a class="read-more button" href="https://blog.dich.bid/windows-5-py/">
|
||||
<span class="button__text">Read more</span>
|
||||
<span class="button__icon">↩︎</span>
|
||||
</a>
|
||||
@ -236,7 +236,7 @@
|
||||
|
||||
<div class="post on-list">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/windows-vscode-gcc/">Windows系列(6):C/C++开发配置</a></h1>
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/windows-6-c/">Windows系列(6):C/C++开发配置</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
@ -258,7 +258,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<!-- ︎ -- force text style - some devices render this as emoji -->
|
||||
<a class="read-more button" href="https://blog.dich.bid/windows-vscode-gcc/">
|
||||
<a class="read-more button" href="https://blog.dich.bid/windows-6-c/">
|
||||
<span class="button__text">Read more</span>
|
||||
<span class="button__icon">↩︎</span>
|
||||
</a>
|
||||
|
@ -104,7 +104,7 @@
|
||||
<div class="posts">
|
||||
<div class="post on-list">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/windows-iso/">Windows系列(4):封装与全自动安装</a></h1>
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/windows-4-auto/">Windows系列(4):封装与全自动安装</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
@ -126,7 +126,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<!-- ︎ -- force text style - some devices render this as emoji -->
|
||||
<a class="read-more button" href="https://blog.dich.bid/windows-iso/">
|
||||
<a class="read-more button" href="https://blog.dich.bid/windows-4-auto/">
|
||||
<span class="button__text">Read more</span>
|
||||
<span class="button__icon">↩︎</span>
|
||||
</a>
|
||||
@ -137,7 +137,7 @@
|
||||
|
||||
<div class="post on-list">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/windows-activation/">Windows系列(3):分类与激活</a></h1>
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/windows-3-jh/">Windows系列(3):分类与激活</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
@ -159,7 +159,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<!-- ︎ -- force text style - some devices render this as emoji -->
|
||||
<a class="read-more button" href="https://blog.dich.bid/windows-activation/">
|
||||
<a class="read-more button" href="https://blog.dich.bid/windows-3-jh/">
|
||||
<span class="button__text">Read more</span>
|
||||
<span class="button__icon">↩︎</span>
|
||||
</a>
|
||||
@ -170,7 +170,7 @@
|
||||
|
||||
<div class="post on-list">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/windows-all/">Windows系列(2):安装与环境配置</a></h1>
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/windows-2-set/">Windows系列(2):常用操作与配置</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
@ -188,11 +188,11 @@
|
||||
|
||||
|
||||
<div class="post-content">
|
||||
<p>前言 由于厂商默认安装windows家庭版导致各种问题频发,这里对 widnows 安装做一个总结,以及附上我个人的windows配置。</p>
|
||||
<p>前言 Windows操作系统作为全球最为普及的桌面操作系统之一,其用户界面的设计非常经典,但存在许多不足之处,本篇记录一些常用脚本。</p>
|
||||
</div>
|
||||
<div>
|
||||
<!-- ︎ -- force text style - some devices render this as emoji -->
|
||||
<a class="read-more button" href="https://blog.dich.bid/windows-all/">
|
||||
<a class="read-more button" href="https://blog.dich.bid/windows-2-set/">
|
||||
<span class="button__text">Read more</span>
|
||||
<span class="button__icon">↩︎</span>
|
||||
</a>
|
||||
@ -203,7 +203,7 @@
|
||||
|
||||
<div class="post on-list">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/windows-some-setting/">Windows系列(1):常用操作</a></h1>
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/windows-1-install/">Windows系列(1):系统安装与设置</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
@ -221,11 +221,11 @@
|
||||
|
||||
|
||||
<div class="post-content">
|
||||
<p>前言 Windows操作系统作为全球最为普及的桌面操作系统之一,其用户界面的设计非常经典,但存在许多不足之处,本篇记录一些常用脚本。</p>
|
||||
<p>前言 由于厂商默认安装windows家庭版导致各种问题频发,这里对 widnows 安装做一个总结,以及附上我个人的windows配置。</p>
|
||||
</div>
|
||||
<div>
|
||||
<!-- ︎ -- force text style - some devices render this as emoji -->
|
||||
<a class="read-more button" href="https://blog.dich.bid/windows-some-setting/">
|
||||
<a class="read-more button" href="https://blog.dich.bid/windows-1-install/">
|
||||
<span class="button__text">Read more</span>
|
||||
<span class="button__icon">↩︎</span>
|
||||
</a>
|
||||
|
@ -133,138 +133,6 @@
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="post on-list">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/learn-linux-for-pc-7/">Linux之旅(7):系统与终端字体设置</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
2023-08-01
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<span class="post-tags-inline">
|
||||
:: tags:
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="post-content">
|
||||
<p>前言 一个好看的字体会提高工作效率与审美.Linux 下的字体可以很漂亮,但需要一些设置.</p>
|
||||
</div>
|
||||
<div>
|
||||
<!-- ︎ -- force text style - some devices render this as emoji -->
|
||||
<a class="read-more button" href="https://blog.dich.bid/learn-linux-for-pc-7/">
|
||||
<span class="button__text">Read more</span>
|
||||
<span class="button__icon">↩︎</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="post on-list">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/learn-linux-for-pc-6/">Linux之旅(6):常用命令与性能分析</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
2023-07-25
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<span class="post-tags-inline">
|
||||
:: tags:
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="post-content">
|
||||
<p>前言 在学习Linux操作系统时,熟悉常用命令和性能分析工具是至关重要的。让我们一起探索Linux的世界,提升技能,解锁无限可能!</p>
|
||||
</div>
|
||||
<div>
|
||||
<!-- ︎ -- force text style - some devices render this as emoji -->
|
||||
<a class="read-more button" href="https://blog.dich.bid/learn-linux-for-pc-6/">
|
||||
<span class="button__text">Read more</span>
|
||||
<span class="button__icon">↩︎</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="post on-list">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/learn-linux-for-pc-5/">Linux之旅(5):BIOS-UEFI-MBR-GPT-GRUB</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
2023-07-24
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<span class="post-tags-inline">
|
||||
:: tags:
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="post-content">
|
||||
<p>前言 在计算机领域,系统引导和磁盘分区是至关重要的。本文将介绍BIOS与UEFI,MBR与GPT,以及它们之间的异同点。此外,我们还会讨论与这些概念密切相关的引导加载程序——GRUB。</p>
|
||||
</div>
|
||||
<div>
|
||||
<!-- ︎ -- force text style - some devices render this as emoji -->
|
||||
<a class="read-more button" href="https://blog.dich.bid/learn-linux-for-pc-5/">
|
||||
<span class="button__text">Read more</span>
|
||||
<span class="button__icon">↩︎</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div class="post on-list">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/learn-linux-for-pc-4/">Linux之旅(4):Terminal,Console and Shell</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
2023-07-23
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<span class="post-tags-inline">
|
||||
:: tags:
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="post-content">
|
||||
<p>前言 在linux的学习过程中,我们常常遇到诸如 Terminal,Console,bash,zsh,shell,tty 等概念,这些概念常常被混淆,似乎都和命令行相关。本文从历史角度出发介绍它们的前世今生。</p>
|
||||
</div>
|
||||
<div>
|
||||
<!-- ︎ -- force text style - some devices render this as emoji -->
|
||||
<a class="read-more button" href="https://blog.dich.bid/learn-linux-for-pc-4/">
|
||||
<span class="button__text">Read more</span>
|
||||
<span class="button__icon">↩︎</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="pagination">
|
||||
<div class="pagination__buttons">
|
||||
@ -274,13 +142,6 @@
|
||||
<span class="button__text">Newer posts</span>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
<span class="button next">
|
||||
<a href="https://blog.dich.bid/page/10/">
|
||||
<span class="button__text">Older posts</span>
|
||||
<span class="button__icon">→</span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Binary file not shown.
BIN
public/pagefind/fragment/en_168c2b3.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_168c2b3.pf_fragment
Normal file
Binary file not shown.
BIN
public/pagefind/fragment/en_1bc6910.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_1bc6910.pf_fragment
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/fragment/en_2ae0119.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_2ae0119.pf_fragment
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/fragment/en_4045ee5.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_4045ee5.pf_fragment
Normal file
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/fragment/en_41da6e3.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_41da6e3.pf_fragment
Normal file
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/fragment/en_4593529.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_4593529.pf_fragment
Normal file
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/fragment/en_4c4e833.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_4c4e833.pf_fragment
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/fragment/en_6a30a86.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_6a30a86.pf_fragment
Normal file
Binary file not shown.
BIN
public/pagefind/fragment/en_7313cae.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_7313cae.pf_fragment
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/fragment/en_85dff61.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_85dff61.pf_fragment
Normal file
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/fragment/en_8d124d9.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_8d124d9.pf_fragment
Normal file
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/fragment/en_a495c69.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_a495c69.pf_fragment
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/fragment/en_abd3ea9.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_abd3ea9.pf_fragment
Normal file
Binary file not shown.
BIN
public/pagefind/fragment/en_b3e4c27.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_b3e4c27.pf_fragment
Normal file
Binary file not shown.
BIN
public/pagefind/fragment/en_b44fdcc.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_b44fdcc.pf_fragment
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/fragment/en_d61f856.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_d61f856.pf_fragment
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/fragment/en_e3e8998.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_e3e8998.pf_fragment
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/fragment/en_f73b4c9.pf_fragment
Normal file
BIN
public/pagefind/fragment/en_f73b4c9.pf_fragment
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/index/en_3cf6439.pf_index
Normal file
BIN
public/pagefind/index/en_3cf6439.pf_index
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/index/en_6aa712e.pf_index
Normal file
BIN
public/pagefind/index/en_6aa712e.pf_index
Normal file
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/index/en_9d27964.pf_index
Normal file
BIN
public/pagefind/index/en_9d27964.pf_index
Normal file
Binary file not shown.
Binary file not shown.
BIN
public/pagefind/index/en_b8d9b56.pf_index
Normal file
BIN
public/pagefind/index/en_b8d9b56.pf_index
Normal file
Binary file not shown.
@ -1 +1 @@
|
||||
{"version":"1.3.0","languages":{"en":{"hash":"en_c359ad4b1a","wasm":"en","page_count":97}}}
|
||||
{"version":"1.3.0","languages":{"en":{"hash":"en_93d8d51d9f","wasm":"en","page_count":89}}}
|
BIN
public/pagefind/pagefind.en_93d8d51d9f.pf_meta
Normal file
BIN
public/pagefind/pagefind.en_93d8d51d9f.pf_meta
Normal file
Binary file not shown.
Binary file not shown.
@ -113,34 +113,6 @@
|
||||
<loc>https://blog.dich.bid/awesome-vm-android/</loc>
|
||||
<lastmod>2023-08-10</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/learn-linux-for-pc-1/</loc>
|
||||
<lastmod>2023-07-20</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/learn-linux-for-pc-2/</loc>
|
||||
<lastmod>2023-07-21</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/learn-linux-for-pc-3/</loc>
|
||||
<lastmod>2023-07-22</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/learn-linux-for-pc-4/</loc>
|
||||
<lastmod>2023-07-23</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/learn-linux-for-pc-5/</loc>
|
||||
<lastmod>2023-07-24</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/learn-linux-for-pc-6/</loc>
|
||||
<lastmod>2023-07-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/learn-linux-for-pc-7/</loc>
|
||||
<lastmod>2023-08-01</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/links/</loc>
|
||||
</url>
|
||||
@ -162,6 +134,9 @@
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/links/link-6/</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/links/link-7/</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/network-cdn/</loc>
|
||||
<lastmod>2024-02-16</lastmod>
|
||||
@ -201,9 +176,6 @@
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/page/1/</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/page/10/</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/page/2/</loc>
|
||||
</url>
|
||||
@ -234,9 +206,6 @@
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/tags/</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/tags/linux/</loc>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/tags/luan-qi-ba-zao/</loc>
|
||||
</url>
|
||||
@ -337,27 +306,27 @@
|
||||
<lastmod>2024-08-08</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/windows-activation/</loc>
|
||||
<lastmod>2024-05-26</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/windows-all/</loc>
|
||||
<lastmod>2024-05-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/windows-conda-python/</loc>
|
||||
<lastmod>2024-05-31</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/windows-iso/</loc>
|
||||
<lastmod>2024-05-29</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/windows-some-setting/</loc>
|
||||
<loc>https://blog.dich.bid/windows-1-install/</loc>
|
||||
<lastmod>2024-05-24</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/windows-vscode-gcc/</loc>
|
||||
<loc>https://blog.dich.bid/windows-2-set/</loc>
|
||||
<lastmod>2024-05-25</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/windows-3-jh/</loc>
|
||||
<lastmod>2024-05-26</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/windows-4-auto/</loc>
|
||||
<lastmod>2024-05-29</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/windows-5-py/</loc>
|
||||
<lastmod>2024-05-31</lastmod>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://blog.dich.bid/windows-6-c/</loc>
|
||||
<lastmod>2024-05-30</lastmod>
|
||||
</url>
|
||||
</urlset>
|
||||
|
@ -108,12 +108,6 @@
|
||||
|
||||
<ul>
|
||||
|
||||
<li class="tag-list">
|
||||
<a href="https://blog.dich.bid/tags/linux/">
|
||||
Linux (7 posts)
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="tag-list">
|
||||
<a href="https://blog.dich.bid/tags/luan-qi-ba-zao/">
|
||||
乱七八糟 (20 posts)
|
||||
|
@ -1,212 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<title>
|
||||
Dich'blog</title>
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
|
||||
<meta name="robots" content="noodp"/>
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/style.css">
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/color/blue.css">
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/color/background_dark.css">
|
||||
|
||||
<link rel="stylesheet" href="https://blog.dich.bid/font-hack-subset.css">
|
||||
|
||||
|
||||
|
||||
|
||||
<meta name="description" content="All posts tagged Linux">
|
||||
|
||||
<meta property="og:description" content="All posts tagged Linux">
|
||||
<meta property="og:title" content="Dich'blog">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:url" content="https://blog.dich.bid/tags/linux/">
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:description" content="All posts tagged Linux">
|
||||
<meta name="twitter:title" content="Dich'blog">
|
||||
<meta property="twitter:domain" content="blog.dich.bid">
|
||||
<meta property="twitter:url" content="https://blog.dich.bid/tags/linux/">
|
||||
|
||||
<link rel="alternate" type="application/atom+xml" title="Dich'blog Atom Feed" href="https://blog.dich.bid/atom.xml" />
|
||||
|
||||
|
||||
<link rel="icon" type="image/png" href=/dich.webp />
|
||||
|
||||
<!-- ✅ Added center alignment styles -->
|
||||
<style>
|
||||
.footer {
|
||||
text-align: center;
|
||||
padding: 1rem 0;
|
||||
}
|
||||
|
||||
.footer__inner {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.copyright {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="">
|
||||
<div class="container">
|
||||
|
||||
<header class="header">
|
||||
<div class="header__inner">
|
||||
<div class="header__logo">
|
||||
|
||||
<a href="https://blog.dich.bid" style="text-decoration: none;">
|
||||
<div class="logo">
|
||||
|
||||
Dich'blog
|
||||
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<nav class="menu">
|
||||
<ul class="menu__inner">
|
||||
<li><a href="https://blog.dich.bid">blog</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/archive">archive</a></li>
|
||||
|
||||
<li class="active"><a href="https://blog.dich.bid/tags">tags</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/weekly">weekly</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/search">search</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/about">about me</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/links">links</a></li>
|
||||
|
||||
<li><a href="https://blog.dich.bid/atom.xml">rss</a></li>
|
||||
|
||||
<li><a href="https://github.com/Dichgrem" target="_blank" rel="noopener noreferrer">github</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
|
||||
</header>
|
||||
|
||||
|
||||
<div class="content">
|
||||
|
||||
<div class="post">
|
||||
<h1 class="post-title">
|
||||
tag: #Linux
|
||||
(7 posts)
|
||||
</h1>
|
||||
|
||||
<a href="https://blog.dich.bid/tags">
|
||||
Show all tags
|
||||
</a>
|
||||
|
||||
|
||||
<ul><li class="post-list">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-7/">
|
||||
<span class="post-date">2023-08-01</span>
|
||||
:: <span class="post-list-title">Linux之旅(7):系统与终端字体设置</span></a>
|
||||
|
||||
<span class="post-tags-inline">
|
||||
::
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-6/">
|
||||
<span class="post-date">2023-07-25</span>
|
||||
:: <span class="post-list-title">Linux之旅(6):常用命令与性能分析</span></a>
|
||||
|
||||
<span class="post-tags-inline">
|
||||
::
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-5/">
|
||||
<span class="post-date">2023-07-24</span>
|
||||
:: <span class="post-list-title">Linux之旅(5):BIOS-UEFI-MBR-GPT-GRUB</span></a>
|
||||
|
||||
<span class="post-tags-inline">
|
||||
::
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-4/">
|
||||
<span class="post-date">2023-07-23</span>
|
||||
:: <span class="post-list-title">Linux之旅(4):Terminal,Console and Shell</span></a>
|
||||
|
||||
<span class="post-tags-inline">
|
||||
::
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-3/">
|
||||
<span class="post-date">2023-07-22</span>
|
||||
:: <span class="post-list-title">Linux之旅(3):内核/shell/包管理/文件系统/桌面环境</span></a>
|
||||
|
||||
<span class="post-tags-inline">
|
||||
::
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-2/">
|
||||
<span class="post-date">2023-07-21</span>
|
||||
:: <span class="post-list-title">Linux之旅(2):FHS与目录结构</span></a>
|
||||
|
||||
<span class="post-tags-inline">
|
||||
::
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/learn-linux-for-pc-1/">
|
||||
<span class="post-date">2023-07-20</span>
|
||||
:: <span class="post-list-title">Linux之旅(1):构成与发行版</span></a>
|
||||
|
||||
<span class="post-tags-inline">
|
||||
::
|
||||
<a class="post-tag" href="https://blog.dich.bid/tags/linux/">#Linux</a></span>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<footer class="footer">
|
||||
<div class="footer__inner">
|
||||
<div class="copyright">
|
||||
<span>©
|
||||
2025
|
||||
Dichgrem</span>
|
||||
<span class="copyright-theme">
|
||||
<span class="copyright-theme-sep"> :: CC BY-SA 4.0 :: A friend comes from distant lands</span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -116,7 +116,7 @@ Dich'blog</title>
|
||||
|
||||
|
||||
<ul><li class="post-list">
|
||||
<a href="https://blog.dich.bid/windows-conda-python/">
|
||||
<a href="https://blog.dich.bid/windows-5-py/">
|
||||
<span class="post-date">2024-05-31</span>
|
||||
:: <span class="post-list-title">Windows系列(5):Python开发配置</span></a>
|
||||
|
||||
@ -126,7 +126,7 @@ Dich'blog</title>
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/windows-vscode-gcc/">
|
||||
<a href="https://blog.dich.bid/windows-6-c/">
|
||||
<span class="post-date">2024-05-30</span>
|
||||
:: <span class="post-list-title">Windows系列(6):C/C++开发配置</span></a>
|
||||
|
||||
@ -136,7 +136,7 @@ Dich'blog</title>
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/windows-iso/">
|
||||
<a href="https://blog.dich.bid/windows-4-auto/">
|
||||
<span class="post-date">2024-05-29</span>
|
||||
:: <span class="post-list-title">Windows系列(4):封装与全自动安装</span></a>
|
||||
|
||||
@ -146,7 +146,7 @@ Dich'blog</title>
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/windows-activation/">
|
||||
<a href="https://blog.dich.bid/windows-3-jh/">
|
||||
<span class="post-date">2024-05-26</span>
|
||||
:: <span class="post-list-title">Windows系列(3):分类与激活</span></a>
|
||||
|
||||
@ -156,9 +156,9 @@ Dich'blog</title>
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/windows-all/">
|
||||
<a href="https://blog.dich.bid/windows-2-set/">
|
||||
<span class="post-date">2024-05-25</span>
|
||||
:: <span class="post-list-title">Windows系列(2):安装与环境配置</span></a>
|
||||
:: <span class="post-list-title">Windows系列(2):常用操作与配置</span></a>
|
||||
|
||||
<span class="post-tags-inline">
|
||||
::
|
||||
@ -166,9 +166,9 @@ Dich'blog</title>
|
||||
|
||||
</li>
|
||||
<li class="post-list">
|
||||
<a href="https://blog.dich.bid/windows-some-setting/">
|
||||
<a href="https://blog.dich.bid/windows-1-install/">
|
||||
<span class="post-date">2024-05-24</span>
|
||||
:: <span class="post-list-title">Windows系列(1):常用操作</span></a>
|
||||
:: <span class="post-list-title">Windows系列(1):系统安装与设置</span></a>
|
||||
|
||||
<span class="post-tags-inline">
|
||||
::
|
||||
|
@ -20,13 +20,13 @@
|
||||
<meta property="og:description" content="">
|
||||
<meta property="og:title" content="Dich'blog">
|
||||
<meta property="og:type" content="article">
|
||||
<meta property="og:url" content="https://blog.dich.bid/windows-all/">
|
||||
<meta property="og:url" content="https://blog.dich.bid/windows-1-install/">
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:description" content="">
|
||||
<meta name="twitter:title" content="Dich'blog">
|
||||
<meta property="twitter:domain" content="blog.dich.bid">
|
||||
<meta property="twitter:url" content="https://blog.dich.bid/windows-all/">
|
||||
<meta property="twitter:url" content="https://blog.dich.bid/windows-1-install/">
|
||||
|
||||
<link rel="alternate" type="application/atom+xml" title="Dich'blog Atom Feed" href="https://blog.dich.bid/atom.xml" />
|
||||
|
||||
@ -103,11 +103,11 @@
|
||||
|
||||
<div class="post">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/windows-all/">Windows系列(2):安装与环境配置</a></h1>
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/windows-1-install/">Windows系列(1):系统安装与设置</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
2024-05-25
|
||||
2024-05-24
|
||||
</span>
|
||||
|
||||
</div>
|
||||
@ -120,36 +120,116 @@
|
||||
|
||||
<div class="post-content">
|
||||
<p>前言 由于厂商默认安装windows家庭版导致各种问题频发,这里对 widnows 安装做一个总结,以及附上我个人的windows配置。</p>
|
||||
<span id="continue-reading"></span>
|
||||
<span id="continue-reading"></span><h2 id="zong-gang">总纲</h2>
|
||||
<p>安装Windows有两种情况:1.在一台全新的电脑上安装;2.想为现有的系统更换版本。本文主要介绍这两种情况。如果只想对现有的系统进行优化,推荐看下一篇的<code>"Windows系列(2):常用操作与配置"</code>.</p>
|
||||
<p><strong>全新安装</strong></p>
|
||||
<ul>
|
||||
<li>获得一个Windows的ISO镜像;</li>
|
||||
<li>制作外部启动盘;</li>
|
||||
<li>做好环境准备,备份数据;</li>
|
||||
<li>引导外部启动盘安装系统;</li>
|
||||
<li>激活系统;</li>
|
||||
<li>进行安装后设置与优化;</li>
|
||||
</ul>
|
||||
<p><strong>为现有系统更换版本</strong></p>
|
||||
<ul>
|
||||
<li>做好环境准备,备份数据;</li>
|
||||
<li>方法一:获得ISO镜像,并选择从<code>本地升级</code>或<code>外部升级</code>;</li>
|
||||
<li>方法二:在设置中填写预安装密钥并切换系统;</li>
|
||||
<li>激活系统;</li>
|
||||
<li>进行安装后设置与优化;</li>
|
||||
</ul>
|
||||
<p><strong>PS:</strong></p>
|
||||
<blockquote>
|
||||
<p>从官方安装:从<a href="https://www.microsoft.com/en-us/software-download/windows11">微软官网</a>下载镜像或<a href="https://massgrave.dev/genuine-installation-media">MAS镜像站</a>下载。</p>
|
||||
<p><code>本地升级</code>:即为不需要外部启动盘,不动你的任何东西的无损安装;但需要一些前提条件;</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>从Dichos安装,参考<a href="https://blog.dich.bid/windows-iso/">乱七八糟:Windows封装与全自动安装</a>;</p>
|
||||
<p><code>外部升级</code>:即为外部启动盘安装系统,可以格式化全盘全新安装;也可以保留数据安装,会将你的的数据放在C盘的<code>windows.old</code>文件夹。</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>二者都基于专业工作站版本,区别在于Dichos通过预应答文件和封装完成了许多设置与优化。Windows最新版本往往Bug比较多,推荐用上一版本;如最新版本为24H2,则推荐使用23H2.</p>
|
||||
<p>数据安全:不管是本地还是外部升级,除非你格式化全盘重新安装,否则安装只会动C盘,其他分区的数据(如D盘等)不会触碰,可放心;</p>
|
||||
</blockquote>
|
||||
<p><strong>大版本分类</strong></p>
|
||||
<table><thead><tr><th>分类</th><th>消费者版(Consumer)</th><th>商务版(Business)</th><th>物联网版(IoT)</th><th>长期服务版(LTSC)</th></tr></thead><tbody>
|
||||
<tr><td><strong>目标用户</strong></td><td>家庭用户、个人消费者</td><td>企业、机构、教育用户</td><td>嵌入式设备、工业控制、POS、医疗设备等</td><td>关键任务系统、长期稳定运行的设备</td></tr>
|
||||
<tr><td><strong>主要版本</strong></td><td>Windows Home、Home Single Language、Education</td><td>Windows Professional、Enterprise、Education</td><td>Windows IoT Core、IoT Enterprise、IoT Enterprise LTSC</td><td>Windows Enterprise LTSC、IoT Enterprise LTSC</td></tr>
|
||||
<tr><td><strong>预装应用</strong></td><td>包含 Microsoft Store、娱乐和社交类应用</td><td>精简部分消费类应用,保留企业管理工具</td><td>极度精简,移除大部分消费类应用</td><td>移除 Microsoft Store、Cortana 等非必要功能</td></tr>
|
||||
<tr><td><strong>更新策略</strong></td><td>定期推送功能和安全更新</td><td>可由企业控制更新策略,支持延迟功能更新</td><td>可选择常规更新或 LTSC 版本,更新策略灵活</td><td>仅推送安全补丁和关键修复,无新功能更新</td></tr>
|
||||
<tr><td><strong>支持周期</strong></td><td>通常为 18 个月</td><td>通常为 18~30 个月,取决于版本和配置</td><td>IoT Enterprise LTSC 支持周期可达 10~15 年</td><td>通常为 5 年主流支持 + 5 年扩展支持,共 10 年</td></tr>
|
||||
<tr><td><strong>授权方式</strong></td><td>零售授权,需在线激活</td><td>批量许可(Volume Licensing)、OEM 授权</td><td>OEM 授权,适用于特定硬件设备</td><td>批量许可,适用于特定行业和关键任务设备</td></tr>
|
||||
<tr><td><strong>适用场景</strong></td><td>日常办公、娱乐、学习</td><td>企业办公、教育机构、专业工作站</td><td>工业自动化、零售终端、医疗设备等嵌入式系统</td><td>医疗设备、金融终端、工业控制系统等需长期稳定运行的环境</td></tr>
|
||||
</tbody></table>
|
||||
<h2 id="huo-qu-isojing-xiang">获取ISO镜像</h2>
|
||||
<p>不管你是哪一种情况,都推荐你先下载ISO镜像,因为ISO镜像方法是最通用,最常用的。</p>
|
||||
<blockquote>
|
||||
<p>安装完成后的优化:</p>
|
||||
<p>官方镜像:从<a href="https://www.microsoft.com/en-us/software-download/windows11">微软官网</a>下载镜像或<a href="https://massgrave.dev/genuine-installation-media">MAS镜像站</a>下载。</p>
|
||||
</blockquote>
|
||||
<h2 id="yi-she-bei-ji"><strong>一.设备级:</strong></h2>
|
||||
<blockquote>
|
||||
<p>Dichos镜像,是笔者个人制作的镜像,参考<a href="https://blog.dich.bid/windows-4-auto/">乱七八糟:Windows封装与全自动安装</a>;</p>
|
||||
</blockquote>
|
||||
<p><strong>PS:</strong></p>
|
||||
<blockquote>
|
||||
<p>镜像大小从1G~8G左右不等,因为有的不知道哪来的镜像里面版本不全,我们要下载的是包括所有主流版本的ISO,即为里面包括家庭版教育版专业版等等。如果你从其他地方下载ISO镜像,里面可能会捆绑流氓软件甚至有病毒。</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>我们要使用的是<code>23H2专业工作站版本</code>,性能最强,功能最全面,适合日常使用和开发;笔记本自带的往往是24H2家庭中文版,bug多功能少,不建议使用。</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>以上说的是功能版本,还有大版本的区别,目前暂时用不上,详细可以看本系列第三篇<code>Windows系列(3):分类与激活</code>.</p>
|
||||
</blockquote>
|
||||
<h2 id="zhi-zuo-qi-dong-pan">制作启动盘</h2>
|
||||
<p>在远古年代你可能看过电脑城老板使用Ghost安装系统,近一点的使用诸如“大白菜”,“老毛桃”以及各种PE安装系统,这是比较旧式的方法。</p>
|
||||
<p>本文推荐使用Ventoy启动盘+windows镜像的方法安装Windows,好处在于:</p>
|
||||
<ul>
|
||||
<li>Ventoy开源;</li>
|
||||
<li>不必每次安装都格式化U盘,比如刷了某某PE整个盘就不能放数据,刷其他系统前需要格式化;</li>
|
||||
<li>兼容性好,可以放各种ISO到里面并直接启动,包括Windows/Linux等等;</li>
|
||||
<li>其他详见<a href="https://blog.dich.bid/about-ventoy/">乱七八糟:Ventoy战斗盘部署</a></li>
|
||||
</ul>
|
||||
<h3 id="zhi-zuo-liu-cheng">制作流程</h3>
|
||||
<ul>
|
||||
<li>首先<code>在官网下载</code><a href="https://www.ventoy.net/cn/download.html">Ventoy</a></li>
|
||||
<li>随后在<code>language</code>中改为中文显示,可以看到左上角有<code>配置选项</code></li>
|
||||
<li>将分区类型设置为<code>GPT</code>,开启安全启动支持;</li>
|
||||
<li>将<code>分区格式</code>设置为NTFS;</li>
|
||||
<li>随后在<code>分区设置</code>中进行分区,选择在<code>磁盘后保留一段空间</code>,这里的空间将不被分区,即为空闲空间,可以稍后建立分区当作普通的文件存储盘;</li>
|
||||
<li>Ventoy分区则会使用<code>U盘总容量-保留空间-ventoy保留分区</code>的空间新建一个盘,这里可以放<code>ISO、WIM、IMG、VHD(x)、EFI</code>等等</li>
|
||||
<li>随后<code>选择磁盘</code>并开始安装,过一会儿即可安装完成。</li>
|
||||
<li>安装完成后可以看到一个新分区,把我们的ISO镜像放在里面即可。</li>
|
||||
<li>随后下载<a href="https://github.com/VirtualHotBar/HotPEToolBox">HotPE</a>,也放在里面。</li>
|
||||
</ul>
|
||||
<h2 id="huan-jing-zhun-bei-shu-ju-bei-fen">环境准备&数据备份</h2>
|
||||
<p>不管你使用哪种方法都建议做好这一步骤:</p>
|
||||
<ul>
|
||||
<li>关闭Bitlocker;(防止磁盘访问受阻)</li>
|
||||
<li>关闭安全启动;(防止本地升级失败)</li>
|
||||
<li>关闭Intel VMD(如果有);(防止磁盘识别不到)</li>
|
||||
<li>确保C盘有足够的空间(9GB+);</li>
|
||||
<li>备份好数据以防万一,以及如果原厂系统有驱动安装包也备份起来。</li>
|
||||
</ul>
|
||||
<p><code>关闭Bitclocker</code>:打开设置,进入隐私与安全→ 设备加密,将其状态切换为关闭。系统会弹窗提示确认,点击关闭,系统将开始解密。解密过程中需要比较久的时间,解密完成后即可成功。</p>
|
||||
<p><code>关闭安全启动和Intel VMD</code>:查找你的笔记本的BIOS 进入键,一般为F2;在开机的时候一直按按按BIOS 进入键,即可进入BIOS/UEFI。在其中查找安全启动(Secure Boot)和Intel VMD(如果有)并将它们关闭(disable),随后按保存退出键(一般为F10或F12)。</p>
|
||||
<p><code>确保C盘有足够的空间</code>:重新进入BIOS,在其中的引导选项中选择USB设备(你的启动盘的设备名),将其调到第一个,然后保存退出;重新启动,这时候就会进入Ventoy的界面,可以看到我们放进去的两个ISO,我们直接选择HotPE进入并使用里面的Diskgenius,把其他盘的空间分给C盘一点点,使其有至少9GB可以使用。</p>
|
||||
<h2 id="an-zhuang-xi-tong">安装系统</h2>
|
||||
<ul>
|
||||
<li>全新安装:进入BIOS选择Ventoy启动并选择Windows的ISO镜像,一路安装过去;</li>
|
||||
<li>更换版本外部升级:同上,记得选择保留当前数据,会保留C盘旧数据到Windows.old文件夹;</li>
|
||||
<li>更换版本本地升级:不用进BIOS,直接在文件管理器中打开ISO镜像并点击setup.exe,同样选择保留数据;</li>
|
||||
<li>更换版本预安装密钥:获得一个专业工作站版本的预安装密钥并在设置里面切换密钥,直接升级系统;</li>
|
||||
</ul>
|
||||
<p><strong>PS:</strong></p>
|
||||
<blockquote>
|
||||
<p>无论你用什么方法都建议先备份好数据!!!</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>无损升级是有前提条件的!!!除了前面说的环境准备,还需要ISO镜像比原来的系统更新,比如23H2的镜像往往就不能无损更新24H2的系统,只能选择外部升级;</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>如果你选择预安装密钥的方法往往比较容易无损升级,但这样就不能使用Dichos的优化,需要手动优化。</p>
|
||||
</blockquote>
|
||||
<h2 id="ji-huo-xi-tong">激活系统</h2>
|
||||
<p>如果你没有购买正版Windows,上文安装的系统可以使用<a href="https://github.com/massgravel/Microsoft-Activation-Scripts">MAS脚本</a>或者<a href="https://github.com/zbezj/HEU_KMS_Activator">HEU_KMS工具</a>来激活.</p>
|
||||
<h2 id="an-zhuang-hou-you-hua">安装后优化</h2>
|
||||
<blockquote>
|
||||
<p>如果你使用Dichos,可以直接跳到<strong>三.驱动级</strong>开始.</p>
|
||||
</blockquote>
|
||||
<h4 id="yi-she-bei-ji"><strong>一.设备级:</strong></h4>
|
||||
<ul>
|
||||
<li>关闭 BIOS 安全启动,快速启动</li>
|
||||
<li>解锁 BitLocker</li>
|
||||
<li>删除 OEM 分区,恢复简洁的设备分区</li>
|
||||
</ul>
|
||||
<h2 id="er-xi-tong-ji"><strong>二.系统级:</strong></h2>
|
||||
<h4 id="er-xi-tong-ji"><strong>二.系统级:</strong></h4>
|
||||
<ul>
|
||||
<li>家庭版升级为专业工作站版</li>
|
||||
<li>将用户名改为非中文</li>
|
||||
@ -157,7 +237,7 @@
|
||||
<li>激活 Windows 与 MS office</li>
|
||||
<li>停止自动更新并恢复单级菜单</li>
|
||||
</ul>
|
||||
<h2 id="san-qu-dong-ji"><strong>三.驱动级:</strong></h2>
|
||||
<h4 id="san-qu-dong-ji"><strong>三.驱动级:</strong></h4>
|
||||
<p>驱动的安装没有集成在Dichos中,而是作为手动安装的一部分避免出错。如自带系统有驱动包,先进系统拿出然后再安装新系统;一般来说,包括:</p>
|
||||
<ul>
|
||||
<li>主板驱动和CPU驱动;</li>
|
||||
@ -179,11 +259,11 @@
|
||||
<tr><td>三大件</td><td>Intel</td><td><a href="https://www.intel.cn/content/www/cn/zh/support/detect.html">链接</a></td></tr>
|
||||
<tr><td>三大件</td><td>NVIDIA</td><td><a href="https://www.nvidia.cn/geforce/drivers/">链接</a></td></tr>
|
||||
</tbody></table>
|
||||
<h2 id="si-ruan-jian-ji"><strong>四.软件级:</strong></h2>
|
||||
<h4 id="si-ruan-jian-ji"><strong>四.软件级:</strong></h4>
|
||||
<ul>
|
||||
<li>删除自带牛马以及不必要的管家类软件.</li>
|
||||
</ul>
|
||||
<h2 id="ruan-jian">软件</h2>
|
||||
<p><code>使用开源软件!</code></p>
|
||||
<ul>
|
||||
<li><strong>AI</strong>: <a href="https://github.com/nomic-ai/gpt4all">GPT4All</a></li>
|
||||
<li><strong>截图</strong>: <a href="https://github.com/ShareX/ShareX">ShareX</a></li>
|
||||
@ -214,19 +294,16 @@
|
||||
<li><strong>终端/SSH</strong>: <a href="https://github.com/electerm/electerm">Electerm</a></li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>这里说一下Rime输入法在Windows端叫小狼毫,输入方案用的是<a href="https://github.com/iDvel/rime-ice?tab=readme-ov-file">雾凇拼音</a> ,在<code>获取更多输入方案</code>中命令行输入<code>iDvel/rime-ice:others/recipes/full</code>安装。</p>
|
||||
<p>Rime输入法在Windows端叫小狼毫,输入方案用的是<a href="https://github.com/iDvel/rime-ice?tab=readme-ov-file">雾凇拼音</a> ,在<code>获取更多输入方案</code>中命令行输入<code>iDvel/rime-ice:others/recipes/full</code>安装。</p>
|
||||
</blockquote>
|
||||
<blockquote>
|
||||
<p>传统意义上的三大件包括浏览器,编辑器以及密码管理器。</p>
|
||||
</blockquote>
|
||||
<h2 id="wu-she-zhi-ji"><strong>五.设置级</strong></h2>
|
||||
<h4 id="wu-she-zhi-ji"><strong>五.设置级</strong></h4>
|
||||
<ul>
|
||||
<li>设置简洁高效的浏览器</li>
|
||||
<li>优化桌面布局与任务栏布局</li>
|
||||
<li>关闭开机自启软件</li>
|
||||
<li>关闭不必要的开机自启软件</li>
|
||||
<li>关闭 Windows Defender 等烦人的通知</li>
|
||||
</ul>
|
||||
<h2 id="liu-ce-shi-ji-ke-xuan"><strong>六.测试级(可选)</strong></h2>
|
||||
<h4 id="liu-ce-shi-ji-ke-xuan"><strong>六.测试级(可选)</strong></h4>
|
||||
<ul>
|
||||
<li>查看PC型号与配置是否相同</li>
|
||||
<li>测试GPU/CPU/硬盘速率与使用时间</li>
|
||||
@ -234,73 +311,6 @@
|
||||
<li>网络测速</li>
|
||||
</ul>
|
||||
<hr />
|
||||
<h2 id="kai-fa-huan-jing">开发环境</h2>
|
||||
<h3 id="da-jian-xu-ni-ji-huan-jing">搭建虚拟机环境</h3>
|
||||
<ul>
|
||||
<li>Hyper-V</li>
|
||||
</ul>
|
||||
<p>在 BIOS 中找到类似<code>Intel VT-x”、“AMD-V”或“Virtualization Technology</code>的选项,确保它是“Enabled”(启用)。随后按下 Win + S,输入“打开或关闭 Windows 功能”,在弹出的窗口中,找到 Hyper-V并启用,重启后即可出现。</p>
|
||||
<ul>
|
||||
<li>VMware</li>
|
||||
</ul>
|
||||
<p>首先下载 <a href="https://www.423down.com/14542.html">Vmware</a>,随后安装并<a href="https://www.ypojie.com/6066.html">激活</a>,然后提前下载好所需系统的镜像,这里推荐<a href="https://help.mirrorz.org/">整合镜像站</a>,并在Vmware中启动。</p>
|
||||
<ul>
|
||||
<li>Virtulbox</li>
|
||||
</ul>
|
||||
<p>直接到<a href="https://www.virtualbox.org/wiki/Downloads">官网</a>下载并安装。</p>
|
||||
<ul>
|
||||
<li>WSL</li>
|
||||
</ul>
|
||||
<p>在<code>控制面板->程序->启用或关闭Windows功能</code>,选中适用于Linux的Windows子系统和虚拟机平台,待安装完成后重启电脑。</p>
|
||||
<p>然后,在<code>管理员模式下打开 PowerShell 或 Windows 命令提示符</code>,方法是右键单击并选择“以管理员身份运行”,输入以下命令,然后重启计算机。</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>wsl --install
|
||||
</span></code></pre>
|
||||
<p>此命令将启用运行 WSL 并安装 Linux 的 Ubuntu 发行版所需的功能。(可以更改此默认发行版)。</p>
|
||||
<blockquote>
|
||||
<p>使用 qemu-img 进行各种虚拟机格式转换</p>
|
||||
</blockquote>
|
||||
<ul>
|
||||
<li>qcow2 转 vmdk(VMware)</li>
|
||||
</ul>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>qemu-img convert -f qcow2 -O vmdk input.qcow2 output.vmdk
|
||||
</span></code></pre>
|
||||
<ul>
|
||||
<li>qcow2 转 vdi(VirtualBox)</li>
|
||||
</ul>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>qemu-img convert -f qcow2 -O vdi input.qcow2 output.vdi
|
||||
</span></code></pre>
|
||||
<ul>
|
||||
<li>qcow2 转 vhdx(新版 Hyper-V)</li>
|
||||
</ul>
|
||||
<p>目前 qemu-img 不能直接输出 vhdx,但你可以先转成 vhd,再用微软工具(如 Convert-VHD)转换为 vhdx:</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>Convert-VHD -Path "output.vhd" -DestinationPath "output.vhdx" -VHDType Dynamic
|
||||
</span></code></pre>
|
||||
<ul>
|
||||
<li>vmdk转vhdx</li>
|
||||
</ul>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>qemu-img convert -f vmdk -O vhdx input.vmdk output.vhdx
|
||||
</span></code></pre>
|
||||
<ul>
|
||||
<li>vhd转vhdx
|
||||
在 PowerShell 中执行以下命令:</li>
|
||||
</ul>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>Convert-VHD -Path "C:\路径\源文件.vhd" -DestinationPath "C:\路径\目标文件.vhdx" -VHDType Dynamic
|
||||
</span><span>
|
||||
</span><span># -Path:指定原始 VHD 文件的路径。
|
||||
</span><span># -DestinationPath:指定转换后 VHDX 文件的保存路径。
|
||||
</span><span># -VHDType:指定磁盘类型,可选值为 Fixed(固定大小)或 Dynamic(动态扩展)。
|
||||
</span></code></pre>
|
||||
<p>请确保虚拟机已关闭,并且 PowerShell 以管理员权限运行。</p>
|
||||
<blockquote>
|
||||
<p>Vscode SSH 连接</p>
|
||||
</blockquote>
|
||||
<p>使用<code>Open Remote - SSH</code>插件,需要创建.ssh文件夹;Windows中在<code>C://users//username//</code>路径下。</p>
|
||||
<p>随后使用插件新建一个连接,如:</p>
|
||||
<pre style="background-color:#151515;color:#e8e8d3;"><code><span>Host myserver
|
||||
</span><span> HostName 192.168.1.100
|
||||
</span><span> User your_username
|
||||
</span></code></pre>
|
||||
<hr />
|
||||
<p><strong>Done.</strong></p>
|
||||
|
||||
</div>
|
||||
@ -313,16 +323,16 @@
|
||||
</div>
|
||||
<div class="pagination__buttons">
|
||||
<span class="button previous">
|
||||
<a href="https://blog.dich.bid/windows-some-setting/">
|
||||
<a href="https://blog.dich.bid/about-shortcut-key/">
|
||||
<span class="button__icon">←</span>
|
||||
<span class="button__text">Windows系列(1):常用操作</span>
|
||||
<span class="button__text">乱七八糟:常用实用快捷键</span>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
|
||||
<span class="button next">
|
||||
<a href="https://blog.dich.bid/windows-activation/">
|
||||
<span class="button__text">Windows系列(3):分类与激活</span>
|
||||
<a href="https://blog.dich.bid/windows-2-set/">
|
||||
<span class="button__text">Windows系列(2):常用操作与配置</span>
|
||||
<span class="button__icon">→</span>
|
||||
</a>
|
||||
</span>
|
@ -20,13 +20,13 @@
|
||||
<meta property="og:description" content="">
|
||||
<meta property="og:title" content="Dich'blog">
|
||||
<meta property="og:type" content="article">
|
||||
<meta property="og:url" content="https://blog.dich.bid/windows-some-setting/">
|
||||
<meta property="og:url" content="https://blog.dich.bid/windows-2-set/">
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:description" content="">
|
||||
<meta name="twitter:title" content="Dich'blog">
|
||||
<meta property="twitter:domain" content="blog.dich.bid">
|
||||
<meta property="twitter:url" content="https://blog.dich.bid/windows-some-setting/">
|
||||
<meta property="twitter:url" content="https://blog.dich.bid/windows-2-set/">
|
||||
|
||||
<link rel="alternate" type="application/atom+xml" title="Dich'blog Atom Feed" href="https://blog.dich.bid/atom.xml" />
|
||||
|
||||
@ -103,11 +103,11 @@
|
||||
|
||||
<div class="post">
|
||||
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/windows-some-setting/">Windows系列(1):常用操作</a></h1>
|
||||
<h1 class="post-title"><a href="https://blog.dich.bid/windows-2-set/">Windows系列(2):常用操作与配置</a></h1>
|
||||
<div class="post-meta-inline">
|
||||
|
||||
<span class="post-date">
|
||||
2024-05-24
|
||||
2024-05-25
|
||||
</span>
|
||||
|
||||
</div>
|
||||
@ -219,6 +219,9 @@
|
||||
<li>将名为<code>DisableAntiSpyware</code>的 DWORD (32位) 值设置为1,如果没有就新建。</li>
|
||||
<li>重启后生效。</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p>也可以使用<a href="https://github.com/es3n1n/defendnot">defendnot</a></p>
|
||||
</blockquote>
|
||||
<h2 id="win11tian-jia-kai-ji-zi-qi-dong-xiang-fang-fa"><strong>Win11添加开机自启动项方法</strong></h2>
|
||||
<p>选择“开始”按钮 ,然后滚动查找你希望在启动时运行的应用。</p>
|
||||
<p>右键单击该应用,选择“更多”,然后选择“打开文件位置”。此操作会打开保存应用快捷方式的位置。如果没有“打开文件位置”选项,这意味着该应用无法在启动时运行。</p>
|
||||
@ -331,16 +334,16 @@
|
||||
</div>
|
||||
<div class="pagination__buttons">
|
||||
<span class="button previous">
|
||||
<a href="https://blog.dich.bid/about-shortcut-key/">
|
||||
<a href="https://blog.dich.bid/windows-1-install/">
|
||||
<span class="button__icon">←</span>
|
||||
<span class="button__text">乱七八糟:常用实用快捷键</span>
|
||||
<span class="button__text">Windows系列(1):系统安装与设置</span>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
|
||||
<span class="button next">
|
||||
<a href="https://blog.dich.bid/windows-all/">
|
||||
<span class="button__text">Windows系列(2):安装与环境配置</span>
|
||||
<a href="https://blog.dich.bid/windows-3-jh/">
|
||||
<span class="button__text">Windows系列(3):分类与激活</span>
|
||||
<span class="button__icon">→</span>
|
||||
</a>
|
||||
</span>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user