win11迁移linux fedora 40 准备
懒人配置项目
https://github.com/AClon314/profiles/blob/main/os_init/fedora-init.sh
备份_day1
对于已经有一次压缩的,不使用.7z
压缩
我们都知道,一个个小文件传输会很慢,打包压缩最好。
用wiztree挑出来,自己高度加工的信息(比如我纯100%手写的代码)、回忆、精品难以再次下载的文件。
高压缩:视频、iso等,使用.7z压缩,只能得到15%以下的二次压缩率(压缩不了多少大小),还慢
但像src源码、文本,这种raw文件就可以考虑7z
要考虑网络传输,不和谐,就用7z
,因为有些可以在线解压.zip
打包带不走的,列清单
dir /b > mc_mods.txt tree /f > mc_mods.txt pnpm i -g @structure-codes/cli struct -d -o mc_mods.txt
校验完整性
如果借用他人电脑,开网络共享,局域网传过去,可以校验下md5、sha256值是否一样
局域网传输可参照:2台电脑通过网线传输文件
小压缩包就看能否打开就行,都放u盘了
Get-ChildItem . | Get-FileHash -Algorithm MD5 | Out-File -FilePath ./hash/hash.txt
选择适合自己的发行版_day2
不同发行版对不同硬件的电脑支持是不同的,最好自己实装后体验1小时。折腾了一整天,最后选择了Fedora+cinnamon。
教训:尽量使用上游的、大集体维护的linux发行版。
- Fedora+Cinnamon桌面环境:大厂维护、较新内核(每半年更新一次)。注意cinnamon spin是社区维护版。选择它是因为:在我的拯救者游戏本上,没有我下面说的输入法、hybrid mode模式、wayland的问题。
- Nobara:含有针对游戏本legion等的独特优化,自带nvidia驱动,开箱即用。有gnome/kde桌面环境版本
- pop! os:自带nvidia驱动
- mint:易用的驱动安装向导(包括nvidia)。更新更保守,可能跟不上最新硬件驱动。有Cinnamon/xfce/MATE桌面环境版本
安装_day3
u盘烧录
Ventoy,多引导,多启动
你可以在目录下放一个.ventoyignore
空白文件,ventoy就不会扫描其子目录&文件了。
F:. │ WePE_64_V2.3.iso │ Fedora-Workstation-Live-x86_64-40-1.14.iso │ TangoPE自用修改版.iso └───u │ .ventoyignore └───文档
我选pop os
磁盘格式
linux对ntfs支持不好,微软没开源
只读肯定可以,写就会有bug,于是需要把2块硬盘的数据全部转成ext4
或xfs
个人文件都放/home,这样方便日后切换distro开发版。(就跟windows一定要分2个盘:c盘系统,d盘数据&程序)
我有2块硬盘,大的装数据,小的装系统,这样大的就能挂载到wsl上共享
- xfs:首次分区后,无法二次分区
trim
- ext4:稳定
如果你还是很顾虑,建议多搜索,多看看评论区,每个人都可能遇到过不同的情况。
https://www.youtube.com/watch?v=AhjL1SHku7M
https://www.reddit.com/r/DataHoarder/comments/11ar65f/linux_filesystems_ext4_vs_xfs_what_to_choose_what/
https://www.bilibili.com/video/BV1HT4m1S7wY
https://discussion.fedoraproject.org/t/btrfs-vs-ext4-what-is-better/78292/8
- XFS 非常适合在 SAN 上拥有不会出现故障的光盘的企业数据中心。XFS 速度很快,是大型数据集的不错选择。但是,如果下面的硬件坏了,XFS就会死掉。它从光盘故障中恢复很糟糕。从管理上讲,这是一个糟糕的选择,因为它不能缩小。
- EXT4 更适合小文件和日常使用。XFS是更好的大文件和长期的维护和稳定性。
- EXT 是可靠的、久经考验的、经过测试的和稳定的。它可以在死亡的光盘中幸存下来。日志非常好。对于大多数用途来说,它的速度很快。它扩展得很好。在管理上,它比 XFS 优越:可以使用 tune2fs 进行扩展、收缩和进行大量配置更改。
- 我之所以远离 XFS,是因为它还有另一个不好的行为:崩溃后,它会重播日志并愉快地继续。在几次崩溃之后,文件系统变得如此损坏,以至于日志的重放也失败了,fsck 也毫无用处。
考虑guest-windows的wsl2挂载linux磁盘可读写(一代wsl只能网络映射)
https://www.bilibili.com/video/BV1tx421D7TJ/
安装后配置_day4
记下来:更新grub的指令
sudo grub2-mkconfig -o /etc/grub2.cfg
https://gist.github.com/dbfin/6733294
配置镜像源
apt-get(ubuntu系列)
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
pop os 是 ubuntu的衍生发行版,输入cat /etc/issue
能查询到ubuntu的版本号
dnf(fedora系列)
https://mirror.tuna.tsinghua.edu.cn/help/fedora/
flathub
https://mirrors.sjtug.sjtu.edu.cn/docs/flathub
https://zh.fedoracommunity.org/2020/05/13/try-on-flatpak-mainland-china-mirror.html
export http_proxy='http://127.0.0.1:7897' export https_proxy='http://127.0.0.1:7897' /var/lib/flatpak/repo$ kate config fedora:~/.var/app$ ls com.microsoft.Edge
用户数据存储在 ~/.var/app 目录中。
平台本身的配置位于 ~/.local/share/flatpak 目录中(系统级配置在 /var/lib/flatpak 目录中)。
pip
https://mirrors.tuna.tsinghua.edu.cn/help/pypi/
pop os
不使用独显启动,qq、edge、chrome就会非常卡
https://wiki.archlinux.org/title/Steam/Troubleshooting#No_context_menu_for_joining/inviting_friends
原因在于我有2个屏幕,笔记本屏幕:AMD核显,外接显示器:nvidia独显
于是,所有基于chromium webview的应用都会有这毛病:不使用独显启动,在外界显示器上会很卡。
firefox没这毛病,可能有优化。但是firefox没有标签组功能,还是不好用。
拖拽窗口时自动切换gpu渲染。
也许是pop os 的问题, nobara ok.
Nobara
self build superGFX
for kde plasma 6
https://gitlab.com/Jhyub/supergfxctl-plasmoid
author hasn't update fedora build
to v2.0, just follow README.md to build.
fix ibus pinyin(仅nobara)
n@nobara-pc:~/.local/share/applications$ kate com.microsoft.Edge.desktop
--enable-features=UseOzonePlatform,WaylandWindowDecorations --ozone-platform=wayland --ozone-platform-hint=auto --enable-wayland-ime
https://www.zhihu.com/question/648264411
https://wiki.archlinuxcn.org/wiki/Fcitx5
the nobara pre-install ibus is broken, you need to remove
then re-install
.
But all chrome would not compatible with any IME, except they are open with args gtk4
in wayland
https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland#Chromium_.2F_Electron
切换默认输入法为fcitx5_day4
sudo dnf remove ibus sudo dnf install fcitx5 -y # 只是需要一个im服务,所以装ibus或别的都可以 flatpak install org.fcitx.Fcitx5 org.fcitx.Fcitx5.Addon.Rime # you can install addon if you want im-chooser # choose fcitx5 # flatpak --user override --socket=system-bus org.fcitx.Fcitx5
自行设置开机自启
然后托盘右键,配置
,添加键盘布局中州韵
调整字体大小:附加组件 经典用户界面 菜单字体 字号大小
相关链接:
fedora 使用DIY主题与rime-ice词库
arch: https://blog.beautyyu.one/archlinux-gnome-chinese-input-fcitx5-rime-ice-solution
fedora Fix: https://github.com/iDvel/rime-ice/issues/840 , https://flathub.org/apps/org.fcitx.Fcitx5
https://www.reddit.com/r/flatpak/comments/t9hetq/how_do_i_remove_the_container_feature_from/
云词库:https://github.com/hchunhui/librime-cloud
批量重命名nemo
https://github.com/qarmin/szyszka
https://www.linuxlinks.com/best-free-open-source-gui-batch-renamers/
实用工具
https://opentabletdriver.net/Wiki/Install/Linux
snipaste
copyQ
appman -i linuxqq
flatpak: QQ 每次注销后会提示“新设备重新扫码”,有github issue
zsh & starship
dnf install zsh sudo lchsh $USER #/bin/zsh logout curl -sS https://starship.rs/install.sh | sh
fsearch & fzf
https://www.cnblogs.com/yanghao2008/articles/13091714.html
sudoedit = vscode
貌似会报错,要手动配置--no-sandbox --user-profile-dir,以后再研究
sudo update-alternatives --config editor
单独安装nvidia驱动
nvidia官方驱动
https://rpmfusion.org/Howto/NVIDIA#Current_GeForce.2FQuadro.2FTesla
sudo dnf update -y # '-y' to reboot if you are not on the latest kernel sudo dnf install akmod-nvidia # rhel/centos users can use kmod-nvidia instead sudo dnf install xorg-x11-drv-nvidia-cuda #optional for cuda/nvdec/nvenc support modinfo -F version nvidia # wait a few seconds to run this line, should be 550.xx etc. sudo dnf install radeontop
https://rpmfusion.org/Howto/Optimus
nvidia-prime不在fedora可用,跳过安装。
社区bumbleBee逆向驱动
待补充
拯救者linux驱动
https://github.com/johnfanv2/LenovoLegionLinux
我只用到“快充”模式、还有开屏幕背面Y灯
、需要重启动的hybird mode切换
省电
发现挂起只能待机7小时,优化前耗电17~21w,优化后能达到12w
auto-cpufreq:智能限制cpu频率
https://github.com/AdnanHodzic/auto-cpufreq?tab=readme-ov-file#auto-cpufreq-installer
fedora建议还是用auto-cpufreq-installer
安装,snap会有很多限制
amd: CPUturbo is controlled by amd-pstate-epp driver
https://github.com/AdnanHodzic/auto-cpufreq?tab=readme-ov-file#troubleshooting
linux 虚拟机 独显直通_day5
最新内容移至:linux上模拟windows尝试
https://wiki.archlinux.org/title/QEMU/Guest_graphics_acceleration
https://github.com/ledisthebest/LEDs-single-gpu-passthrough/blob/main/README-cn.md
bili视频评论区@撒盐的蛋炒饭:
Ubuntu 直通成功!感谢up主的努力。
intel CPU,NVDIA 显卡
先按照up主的流程过一遍,你会发现很多步骤都是错的,走不通的,原因如下:
- 系统不同、版本不同,所需的依赖项不同。所以你会发现很多依赖的软件你安装不了,那你就得找适合版本的平替,不要报错了硬装。
- 显卡直通部分,由于21年下旬后,很多显卡都开始从驱动到硬件均支持直通,所以根本不需要配置VBIOS、ROM,以及视频中相关的XML配置。只需要删掉KVM原先的显示相关配置,替换成显卡的PCI设备即可。
- hooks目录下的文件配置好后,不要着急测试KVM,先把qemu中的虚拟机名称改成
test
,先确保KVM的各种功能运行正常,然后再配置显卡直通,最后将qemu的KVM名称改为虚拟机名称,进行你的第一次直通测试。- 第一次直通由于显卡驱动没有装好,时间比较长,多等一会。等的适合能听到启动音,但没有画面,那是正常的,接着多等。保证网络正常,系统能帮你装驱动应该就行。(当然太久了的话,比如超过10分钟,可能真的是配置有问题)
另外,up主的虚拟机配置也有很多是行不通的,比如磁盘、网络等都选Virt0,实际体验下来是不能正常读取、联网的。请务必根据自己的实际情况进行配置,很多时候虚拟机的默认属性配置就很好。
Looking glass,小白也能上手:https://looking-glass.io/
分离独显,需核显+独显,更耗电:https://www.youtube.com/watch?v=g--fe8_kEcw
PCI直通,但不能同时运行双系统:https://www.bilibili.com/video/BV1Er4y1i7pq ; https://www.bilibili.com/video/BV1KK4y1S7p2
优先实现省电的方案:切换双系统,笔记本插上电再用核显+独显:同时运行双系统
基于KVM的虚拟显卡透传技术
Windows Inside of Linux
The Ultimate System - GPU Passthrough with Looking Glass
bdsdxe: failed to load boot0001 uefi qemu dvd-rom, access denied
禁用虚拟机内的secore boot
https://forum.proxmox.com/threads/access-denied-for-the-cd-rom.117720/
cinnamon
applet
- drawer
plugin
。。。
关闭selinux?
setenforce 0
https://www.reddit.com/r/Fedora/comments/zny79j/what_makes_disabling_selinux_a_big_deal/
https://www.cnblogs.com/yqzc/p/12361784.html
bugs
- logout后numLock触发beep,需要
dnf install numlockx
,然后在设置、登录界面打开numlockx
memreduct
https://gist.github.com/harssh/8ccb9ae8fb12ea6df697
Porton-GE
https://gist.github.com/GloriousEggroll?page=1
newBing
https://github.com/jiarandiana0307/patch-edge-copilot?tab=readme-ov-file
https://zhuanlan.zhihu.com/p/673914163
edge://profile-internals/
,设为只读
草稿
https://github.com/Nobara-Project/nobara-core-packages
appimage pool
避免使用flatpak:沙盒导致空间占用巨大,20GB
放弃
最后发现 https://www.atzlinux.com/allpackages.htm
国内软件优先支持debian系的linux,redhat的fedora rpm包少得可怜,特别是fcitx5库缺失的一些问题……
详见新文章:迁移kubuntu 24
2个月后:格式化
再见了NTFS。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步