我将 Windows 7 和 Ubuntu 13.04 设置为双启动,之前,ubuntu 启动时间不到 10 秒(我想可能是 7 或更低)。现在它启动时间长达 30 秒或更长时间,这非常烦人。问题是我不知道在发生这种情况之前我做了什么,而且我对 ubuntu 还很陌生。我在 Google 上搜索过,没有找到任何有用的方法。
这是 dmesg 中速度变慢的部分。
[ 2.696568] EXT4-fs (sda5): mounted filesystem with ordered data mode. Opts: (null)
[ 2.705096] usb 2-1.3: new high-speed USB device number 4 using ehci-pci
[ 2.798688] usb 2-1.3: New USB device found, idVendor=0fca, idProduct=8004
[ 2.798698] usb 2-1.3: New USB device strings: Mfr=1, Product=5, SerialNumber=3
[ 2.798705] usb 2-1.3: Product: RIM Composite Device
[ 2.798710] usb 2-1.3: Manufacturer: Research In Motion
[ 2.798716] usb 2-1.3: SerialNumber: 00793DF3233817E4C372480545113986A36D4753
[ 28.457346] Adding 4102140k swap on /dev/sda6. Priority:-1 extents:1 across:4102140k
[ 28.489449] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 28.518070] udevd[404]: starting version 175
[ 28.789652] lp: driver loaded but no devices found
[ 29.904464] ACPI Warning: 0x0000000000000428-0x000000000000042f SystemIO conflicts with Region \PMIO 1 (20121018/utaddress-251)
[ 29.904472] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
[ 29.904477] ACPI Warning: 0x0000000000000540-0x000000000000054f SystemIO conflicts with Region \SBGP 1 (20121018/utaddress-251)
[ 29.904481] ACPI Warning: 0x0000000000000540-0x000000000000054f SystemIO conflicts with Region \GPIO 2 (20121018/utaddress-251)
[ 29.904484] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
[ 29.904486] ACPI Warning: 0x0000000000000530-0x000000000000053f SystemIO conflicts with Region \SBGP 1 (20121018/utaddress-251)
[ 29.904488] ACPI Warning: 0x0000000000000530-0x000000000000053f SystemIO conflicts with Region \GPIO 2 (20121018/utaddress-251)
[ 29.904490] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
[ 29.904491] ACPI Warning: 0x0000000000000500-0x000000000000052f SystemIO conflicts with Region \SBGP 1 (20121018/utaddress-251)
[ 29.904493] ACPI Warning: 0x0000000000000500-0x000000000000052f SystemIO conflicts with Region \GPIO 2 (20121018/utaddress-251)
[ 29.904496] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
[ 29.904497] lpc_ich: Resource conflict(s) found affecting gpio_ich
有人告诉我使用 bootchart,但我不知道如何读取结果:
答案1
不要对 SSD 进行碎片整理 !!!!!!! 您最初实现的不到 10 秒的启动时间表明您使用了 SSD。完全没有必要对 SSD 进行碎片整理,恰恰相反,这会缩短 SSD 的使用寿命,并且不会带来任何性能提升。
答案2
plymouth 和 ureadahead 有大量 I/O。因此,可能有三个原因:
- ureadahead 在最后一次启动时被重新配置,通常你需要 2 次冷启动才能准确测量这一点。
- 您让 bootchart 保持激活状态。你不应该. bootchart 通常会减慢您的启动时间,因此不应使用它来测量启动时间,而应找出您的系统在启动时执行的操作。禁用/删除它。
你的分区碎片很多(是的,ext4数据碎片化)并且这些寻道时间会毁掉你的启动。运行
sudo e4defrag /dev/sda1
(将 sda1 更改为你的实际分区)并查看你的系统运行情况:e4defrag /dev/sda1 设备 (/dev/sda1) 的 ext4 碎片整理 [27442/276583]/var/崩溃/_usr_lib_x86_64-linux-gnu_gstreamer0.10_gstreamer-0.10_gst-plugin-scanner.1000.崩溃:100% [确定] [27447/276583]/var/crash/_usr_lib_firefox_firefox.1000.crash: 100% [正常] [27449/276583]/var/crash/_usr_bin_nautilus.1000.crash: 100% [正常] [27454/276583]/var/crash/_usr_lib_virtualbox_VirtualBox.1000.crash: 100% [确定] 成功:[ 7/276583 ] 失败:[ 276576/276583 ]
“成功”/“失败”是由于我以非 root 身份运行该程序。