X201过热; 指纹登录; 更换启动界面; 修复分区表和GRUB引导; 休眠
xxd - Linux HEX editor
Linux Baidu Pan
X201过热
安装以下软件,Linux比安装之前降温10度左右
lm_sensor (and afterwards I did run sensors-detect)
thermald
TLP
intel-ucode
TLP
1 | sudo add-apt-repository ppa:linrunner/tlp |
thermald
1 | sudo apt-get install thermald |
CPU freqs
1 | sudo apt-get install indicator-cpufreq |
指纹登录
1 | # For Ubuntu 16.04 or greater: |
更换启动界面
to install:
copy file to /usr/share/plymouth/themes
run in terminal:
1 | sudo update-alternatives --install /usr/share/plymouth/themes/default.plymouth default.plymouth /usr/share/plymouth/themes/<your theme>/<your theme>.plymouth 100 |
initramfs: initramfs is a tiny version of the OS that gets loaded by the bootloader, right after the kernel. It lives in RAM, and it provides just enough tools and instructions to tell the kernel how to set up the real filesystem, mount the HDD read/write, and start loading all the system services. It includes the stub of init, PID #1. If your initramfs is broken, your boot fails.
update-initramfs is a script that updates initramfs to work with a new kernel. In the Debian universe, you shouldn’t need to run this command manually except under very unusual circumstances - a post-install script automatically handles it for you when you install a new kernel package.
测试命令
1 | sudo apt install plymouth-x11 |
不小心把分区表弄坏了
先别慌,别往硬盘里写东西
用晨风或类似WinPE工具盘启动电脑。用Partition Magic之类的软件提供的恢复丢失分区找回分区
修复GRUB2.制作Ubuntu/Xubuntu/Lubuntu启动盘引导系统,用Boot Repair修复引导扇区,这个方法对双、多系统也有效,工具会识别出所有的可引导系统并加到Grub2菜单中。
1 | sudo add-apt-repository ppa:yannubuntu/boot-repair |
Ubuntu18.04休眠
注意如果用固态硬盘,不应该使用休眠功能,否则影响固态硬盘寿命
- 1 先确定交换分区至少跟物理内存一样大。
理论上交换分区小于物理内存也可以成功。而且最好比物理内存大一点。(我就是在扩展交换分区大小时把分区表弄坏的,花了半天的时间才恢复原样)
Add ‘Hibernate’ Option in Power Menu in Ubuntu 18.04
How can I hibernate on Ubuntu 16.04
- 2 测试系统支持休眠,注意,以下命令回立刻将系统休眠,执行前请确保已经保存你的工作。
1 | sudo systemctl hibernate |
- 3 在菜单上增加休眠按钮
1 | sudo nano /etc/polkit-1/localauthority/50-local.d/com.ubuntu.enable-hibernate.pkla |
It opens nano with an empty file. Copy the lines below and paste them into the nano window.
1 | [Re-enable hibernate by default in upower] |
Restart your computer and click the link to install the gnome extension: Hibernate Status Button.(第一个参考帖子里有截图)
- 4 修改GRUB增加resume参数
找到交换分区:
1 | grep swap /etc/fstab |
for me this returns (partial output)
1 | swap was on /dev/sda3 during installation |
/dev/sda3是安装系统时用的交换分区,如果安装之后没改过的话。
1 | sudoedit /etc/default/grub |
To the line starting GRUB_CMDLINE_LINUX_DEFAULT add resume=/dev/YourSwapPartition to the section in quotes (replace with the the partition you identified earlier). Using my example:
1 | GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=/dev/sda3" |
更新/etc/default/grub文件之后,运行以下命令更新grub以使之生效
1 | sudo update-grub |
注: 除了像上面使用交换分区,还可以使用交换文件实现休眠功能
在我重新创建了交换分区后,交换分区号和UUID都变了,于是需要用以下方法重新设置
注:我曾经试过不用休眠功能,于是我把/etc/initramfs-tools/conf.d/resume文件删了,删掉后,Linux启动特别慢,内核启动大概10多秒,恢复这个文件并更新ramfs之后,变回3秒之内
I have enabled hibernate but it isn’t working. What can I do?
以下方法在Ubuntu18.04测试有效
There is two way to fix this.
Editing the /etc/initramfs-tools/conf.d/resume file
First get the UUID of the swap partition.
1
sudo blkid | grep swap
This will output a line similar to this:
1
/dev/sda12: UUID="a14f3380-810e-49a7-b42e-72169e66c432" TYPE="swap"
The actually line will not match with this. Copy the value of UUID in between “…” double quote.
Open the resume file
1
sudo gedit /etc/initramfs-tools/conf.d/resume
And in that file, add a line like this
1
RESUME=UUID=a14f3380-810e-49a7-b42e-72169e66c432
Don’t forget to replace the actual UUID value you get from step 1. Save the file and exit gedit
Then in terminal, execute this command
1
sudo update-initramfs -u
You will now be able to resume from hibernation
Editing the /etc/default/grub file.
Open a terminal and execute the below command to open it
1
sudo gedit /etc/default/grub
There will be a line like GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”
. Edit the line to insert RESUME=UUID=<your-uuid-value-here> after the word splash.For example in my case, the line looks like this after editing
1
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash resume=UUID=a14f3380-810e-49a7-b42e-72169e66c432"
Make sure, you used your UUID value you get from sudo blkid | grep swap command.
Then do this command
1
sudo update-grub
This also enable you to successfully get resumed from hibernate.
更改Login登录界面背景
1 | sudo gedit /usr/share/gnome-shell/theme/ubuntu.css |
替换lockDialogGroup段如下
1 | #lockDialogGroup { |
Alt-F2 -> r
电脑挂起后,禁用鼠标唤醒
1 | ls -l /lib/systemd/system-sleep |
用CloneZilla拷贝硬盘/分区
有linux的分区用Ghost复制后不好用,不知道是不是我用的版本太老了。用CloneZilla好用。下载iso,做启动盘,启动,复制