98rat

Linux is pretty quick to boot on modern computers, but why not pare it down some more? If you’re hurting from a lack of SSD or just want to boot faster, E4rat will easily shave down your boot time.

Linux可以在现代计算机上快速启动,但是为什么不减少它呢? 如果您因缺少SSD而受到伤害或者只是想更快地启动,E4rat可以轻松缩短启动时间。

Note: this article was written for Ubuntu 11.04 so it’s very possible that it doesn’t work anymore.

注意:本文是针对Ubuntu 11.04编写的,因此很可能不再起作用。

E4rat和您Linux PC (E4rat and Your Linux PC)

E4rat is a utility that’s designed to cut your Linux boot time drastically. Essentially you show it what you do when you start your computer normally, and it analyzes the files you access and use. Then, it’ll move them to the beginning of your hard disk so that it takes less time to find them during boot.

E4rat是一个实用程序,旨在极大地减少Linux的启动时间。 从本质上讲,它向您显示了正常启动计算机时的操作,并分析了您访问和使用的文件。 然后,它将它们移动到硬盘的开头,以便在启动过程中找到它们所需的时间更少。

E4rat is designed to work with Ext4 partitions only. If you’re using another file system, this isn’t for you. There are reports of it working with LVM but your mileage may vary, so be careful if you have sensitive data.

E4rat仅设计用于Ext4分区。 如果您使用的是其他文件系统,则不适合您。 有报告称它可以与LVM一起使用,但是您的里程可能会有所不同,因此,如果您有敏感数据,请小心。

Furthermore, if you have an SSD, you should stay away from this. Because E4rat moves files for a better seek time, SSD uses won’t see any benefit as their “seek” time is unaffected by this. By moving files and performing extended writes, you may even end up damaging your already-blazing-fast drive.

此外,如果您有SSD,则应远离此位置。 由于E4rat可以以更好的查找时间移动文件,因此SSD使用不会带来任何好处,因为它们的“查找”时间不受此影响。 通过移动文件并执行扩展写入,您甚至可能损坏已经非常快的驱动器。

在Ubuntu上安装E4rat (Installing E4rat on Ubuntu)

E4rat is available as a .deb package for Ubuntu users. If you’re running another Linux distro you’ll have to compile E4rat from source, but things should work fine and you can still largely follow this guide. The only real exception is for people who use Debian – take a look at this note before you continue. For our step-by-step guide, we’ll assume you’re running Ubuntu Natty (11.04).

E4rat可作为.deb软件包供Ubuntu用户使用。 如果您正在运行另一个Linux发行版,则必须从源代码编译E4rat,但是一切正常,您仍然可以很大程度上遵循本指南。 唯一真正的例外是使用Debian的用户–在继续之前请先阅读本说明。 对于我们的分步指南,我们假设您正在运行Ubuntu Natty(11.04)。

Head over to E4rat’s Sourceforge page here.

转至此处的E4rat的Sourceforge页面。

Click on the latest version, then download the file that’s appropriate for your architecture.

单击最新版本,然后下载适合您的体系结构的文件。

I’m running a 64-bit installation of Ubuntu Natty, so I chose the “amd64” version.

我正在运行Ubuntu Natty的64位安装,因此我选择了“ amd64”版本。

Now, if you try to install it right now, you’ll get an error because Ubuntu’s default “ureadahead” package conflicts with E4rat.

现在,如果您尝试立即安装它,则会收到错误消息,因为Ubuntu的默认“ ureadahead”软件包与E4rat冲突。

Ureadahead is similar in concept, but doesn’t work as well as E4rat, so let’s get rid of it. Open up a terminal and enter the following command.

Ureadahead在概念上相似,但效果不如E4rat,所以让我们摆脱它。 打开一个终端并输入以下命令。

sudo dpkg –purge ureadahead ubuntu-minimal

sudo dpkg –最小清除尿素头

Enter your password and let it do its thing. Next, let’s make sure the proper dependencies for E4rat are present.

输入您的密码,然后做它的事情。 接下来,让我们确保存在E4rat的正确依赖项。

sudo apt-get install libblkid1 e2fslibs

sudo apt-get install libblkid1 e2fslibs

You should have them already installed by default, but if not, this command will install/upgrade to the latest version.

默认情况下,您应该已经安装了它们,但是如果没有,则此命令将安装/升级到最新版本。

Now when you double-click the .deb file you downloaded, you won’t see that error and you can just click the Install button.

现在,当您双击下载的.deb文件时,您将不会看到该错误,只需单击“安装”按钮即可。

I happened to get an error at this point, but you can just click on ignore if you get it. Once everything’s done, restart your computer, but stay at the Grub menu.

我此时碰巧遇到了一个错误,但是如果您发现错误,则可以单击“忽略”。 完成所有操作后,请重新启动计算机,但请保留在Grub菜单中。

收集数据 (Gathering Data)

With E4rat installed, we need to make sure it gathers its data properly. To do this, we can edit the parameters for our next boot. Make sure you’re in the Grub menu.

安装了E4rat之后,我们需要确保它正确收集了数据。 为此,我们可以编辑下一次引导的参数。 确保您在Grub菜单中。

Highlight the option you normally use to boot into Linux and hit the “e” key. Look for the line that starts with:

突出显示通常用于启动Linux的选项,然后按“ e”键。 查找以以下内容开头的行:

linux /boot/vmlinuz…

linux / boot / vmlinuz…

It’s the second-to-last line in the above pic (click on the image to see a larger version). This line is what tells the Linux kernel to load. At the end of this line, add the following:

这是上图的倒数第二行(单击图像查看大图)。 这行告诉Linux内核加载。 在此行的末尾,添加以下内容:

init=/sbin/e4rat-collect

init = / sbin / e4rat-collect

Then, just hit Ctrl+X to continue booting. This tells E4rat’s collect program to start running after boot. Let your computer do its thing, and log in. For the next two minutes you should do what you normally do when once you log in. For me, that entails loading up both Chrome and Firefox, opening terminal and running Screen/Byobu, and getting Nautilus and Shutter opened so I can check my files and take screenshots.

然后,只需按Ctrl + X即可继续启动。 这告诉E4rat的收集程序在启动后开始运行。 让您的计算机完成其工作,然后登录。在接下来的两分钟内,您应该执行登录后通常的操作。对我来说,这需要加载Chrome和Firefox,打开终端并运行Screen / Byobu ,以及打开Nautilus和Shutter,以便检查文件并截图。

As you can see, those first two minutes are pretty crucial. I clicked on everything within that two minute window that E4rat uses, but not everything loaded until several minutes later. That’s okay, though, so long as you start the application loading, you’ll be fine.

如您所见,前两分钟非常关键。 我单击了E4rat使用的两分钟窗口内的所有内容,但直到几分钟后才加载所有内容。 没关系,但是,只要您开始加载应用程序,就可以了。

Let’s check to make sure the proper log file was created. Open up terminal.

让我们检查以确保创建了正确的日志文件。 打开终端。

ls /var/lib/e4rat/

ls / var / lib / e4rat /

You should see a file a displayed that’s named “startup.log”. If this file isn’t created, you’ll need to restart the process.

您应该看到显示的文件名为“ startup.log”。 如果未创建此文件,则需要重新启动该过程。

移动启动文件 (Moving the Startup Files)

Once you verify that the log file is there, restart your computer and stop at the Grub screen. Choose your booting option and hit “e” once again.

确认日志文件存在后,重新启动计算机并在Grub屏幕上停止。 选择启动选项,然后再次点击“ e”。

This time, we’re going to add some thing different to the end of that same line:

这次,我们将在同一行的末尾添加一些不同的内容:

single

Hit Ctrl+X to boot, but this time, we’re heading into the command-line straight-away. My machine took a little while, and then gave me a screen with several option. If this happens to you, just choose the option for “Resume normal boot.”

按Ctrl + X引导,但是这次,我们直接进入命令行。 我的机器花了一段时间,然后给了我一个带有多个选项的屏幕。 如果您遇到这种情况,只需选择“恢复正常启动”选项即可。

Then, if you don’t get to a command-prompt, hit Ctrl+Alt+F1. You should now see a login prompt.

然后,如果没有出现命令提示符,请按Ctrl + Alt + F1。 现在,您应该会看到一个登录提示。

Enter your username and password, and then enter the following command:

输入您的用户名和密码,然后输入以下命令:

sudo e4rat-realloc /var/lib/e4rat/startup.log

须藤e4rat-realloc /var/lib/e4rat/startup.log

Enter your password, and E4rat will start moving files on your hard drive.

输入密码,E4rat将开始在硬盘驱动器上移动文件。

This may take quite a while depending on how cluttered your disk is. Just watch the hard drive light blink and wait patiently for things to finish.

这可能需要花费相当长的时间,具体取决于磁盘的混乱程度。 只需看着硬盘驱动器指示灯闪烁并耐心等待事情完成即可。

The official website recommends that you run the command a couple more times until nothing else can be moved. My computer gave me that message right away, so your mileage may vary.

官方网站建议您多次运行该命令,直到无法移动其他内容为止。 我的计算机立即向我发送了该消息,因此您的里程可能会有所不同。

Now, let’s restart our machine with

现在,让我们重启机器

sudo shutdown -r now

sudo shutdown -r现在

and log in normally to complete the last phase.

并正常登录以完成最后一个阶段。

配置Grub在每次引导时运行E4rat (Configuring Grub to Run E4rat On Every Boot)

Open up a terminal and enter:

打开一个终端并输入:

gksu gedit /etc/default/grub

gksu gedit / etc / default / grub

Ubuntu’s Text Editor should pop open. Look for the line that starts with “GRUB_CMDLINE_LINUX_DEFAULT=”

Ubuntu的文本编辑器应该弹出打开。 查找以“ GRUB_CMDLINE_LINUX_DEFAULT =”开头的行

We’re going to add a line inside of the those quotes and before whatever options are there.

我们将在这些引号内以及任何选项之前添加一行。

init=/sbin/e4rat-preload

init = / sbin / e4rat-preload

Your file should look similar to this:

您的文件应类似于以下内容:

Hit the save button and close Gedit. Now, return to the terminal and run one last command:

点击保存按钮,然后关闭Gedit。 现在,返回到终端并运行最后一个命令:

sudo update-grub

须藤更新

Configuring Grub this way (and NOT by editing /boot/grub/grub.cfg) will make sure that this lasts between updates, although you may have to redo this if you upgrade between releases in the future. By then, however, you’ll probably want to redo this entire process so that the right files are in the right places.

以这种方式配置Grub(而不是通过编辑/boot/grub/grub.cfg进行配置)将确保这种情况在更新之间持续存在,但是如果将来在不同的发行版之间进行升级,则可能必须重做一次。 但是,到那时,您可能需要重做整个过程,以便将正确的文件放在正确的位置。

The next time you reboot, you’ll notice a sizeable time difference in booting and in opening the apps that your normally head straight to. My netbook’s boot time is now about 10 seconds!

下次重新启动时,您会注意到在启动和打开通常直接进入的应用程序时存在很大的时差。 我的上网本的启动时间现在约为10秒!



Know of any other tricks to shave precious seconds off of your boot time? Share what you know in the comments!

知道其他任何技巧可以节省宝贵的启动时间吗? 在评论中分享您所知道的!

翻译自: https://www.howtogeek.com/69753/how-to-cut-your-linux-pcs-boot-time-in-half-with-e4rat/

98rat

98rat_如何使用E4rat将Linux PC的启动时间缩短一半相关推荐

  1. 25美元 Linux PC 'Raspberry Pi' 一月上市

    为什么80%的码农都做不了架构师?>>> 盼望已久的信用卡大小.价值25美元的计算机 Raspberry Pi将于年初上市.第一轮Beta版设备已经处于测试之中.如果一切顺利,一月你 ...

  2. anbox 使用情况_如何在Linux PC上启动并运行Anbox?

    目前 下面的教程教你如何在Linux PC上启动并运行Anbox 在你的Linux电脑上运行Android应用和游戏可以提高你的生产力,Android的应用相比电脑上的应用设计会比较简单的多,但是更加 ...

  3. 我的Linux PC开发环境

    软件集成开发环境(代码编辑.浏览.编译.调试) Emacs            http://www.gnu.org/software/emacs/ Source-Navigator 5.2b2   ...

  4. kodi需要Linux桌面环境,Kodibuntu死了吗? 没有Linux的情况下将任何Linux PC变成HTPC | MOS86...

    Kodi是一款出色的开源家庭影院系统,并且由于其广泛的可用性,因此成为了顶级DIY媒体中心软件. 您可以将Kodi作为应用程序安装在Linux上,但是如果要构建专用的HTPC怎么办? 曾经,像Kodi ...

  5. linux更改程序启动时间,分享|如何改善应用程序在 Linux 中的启动时间

    大多数 Linux 发行版在默认配置下已经足够快了.但是,我们仍然可以借助一些额外的应用程序和方法让它们启动更快一点.其中一个可用的这种应用程序就是 Preload.它监视用户使用频率比较高的应用程序 ...

  6. linux 获取启动时间不对,linux获取系统启动时间

    1.前言 时间对操作系统来说非常重要,从内核级到应用层,时间的表达方式及精度各部相同.linux内核里面用一个名为jiffes的常量来计算时间戳.应用层有time.getdaytime等函数.今天需要 ...

  7. 在Linux PC上查看arm交叉编译的可执行文件依赖的动态库

    在Ubuntu宿主机上查看ARM交叉编译好的可执行程序和库文件的相关依赖关系,类似于PC linux上的ldd命令.     在电脑上安装的Linux系统中,有一个ldd命令,可以查看对应的可执行文件 ...

  8. linux系统手柄模拟器下载,Switch Amiibo模拟器(Windows|Linux PC + JoyControl + Bluetooth)...

    之前我发了一篇文章,介绍如何用安卓手机模拟switch的pro手柄刷amiibo,大家如果感兴趣可以点击我的那篇文章:蓝牙5.0安卓手机连接switch刷任意amiibo,不用白卡.但是如果你没有蓝牙 ...

  9. linux .pc,教你摸清 Linux PC 的性能底细?

    导读 基准测试是一项测试或一系列测试,用来确定某个计算机硬件运行起来的状况有多好.在许多情况下,"基准测试"实际上等同于"压力测试".通过测试硬件的极限,然后可 ...

最新文章

  1. CPR认证-建材CE认证-305/2011/EU
  2. PBR:双向反射分布函数(BRDF)介绍与Cook-Torrance模型的实现
  3. 打孔怎么定位_不粘锅是怎么制造出来的?看完工艺流程真的清楚了「精彩动图」...
  4. 关于U-Net结构的更浅显更易懂的解释
  5. 集合之五:Set接口
  6. python vba sql_Excel、VBA与Mysql交互
  7. linux安装windows常用中文字体库
  8. 51单片机的家居空气质量监测系统proteus仿真设计
  9. Selenium自动化测试设计模式-PO模式
  10. 雅思备考-口语词组积累-第二章
  11. 华为路由器时间同步_华为路由器肿么和互联网时间同步
  12. for循环判定质数合数
  13. [Linux]在Ubuntu下虚拟机的安装以及在Ubuntu中进行UDP套接口通信
  14. Ubuntu 16.04安装Matlab R2016b
  15. 基于STM32F407的人脸追踪
  16. android判断音频是否是噪音,声音检测器sound detector(噪音分贝检测)
  17. 知识竞赛软件使用说明
  18. 【微信小程序】初识微信小程序组件
  19. SAP HANA:下一代开放应用平台
  20. 2023新年红包,兔年HTML红包页面代码【2023新年快乐_附源码】

热门文章

  1. 朗诵素材-《少年正是读书时》(两角色主持朗诵)
  2. 买电脑需要考虑的电脑配置
  3. 新库上线 | CnOpenData全球地震信息数据
  4. ts判断数据是否存在
  5. windows涉及所有协议及默认端口
  6. 毕设-springboot物资管理系统
  7. 事件驱动库 libev 使用详解
  8. php商城系统文和答题_java商城系统好 还是PHP的商城系统好?
  9. 洛谷 1365 WJMZBMR打osu! / Easy
  10. 如何解决vscode使用ajax获取本地文件报错问题