•  

      今天很累也很困了,但是在浏览文章中发现了Ubuntu如果设置不好,会损坏甚至毁坏笔记本硬盘的问题,于是决定将这篇文章看完并写下这篇文章。这里就是看到的第一篇文章<Ubuntu电源管理问题的说明和解决方案>,看完之后对这个所谓的Load/unload Cycle还不是很了解,于是就做了一些调查,并且发现这个问题已经发给官方了,具体BUG Report可以在这里看到(https://bugs.launchpad.net/ubuntu/+bug/104535)。请看上图,所谓的load/unload cycle就是slider与硬盘盘片接触的周期,每一个硬盘出厂前都会有这么一个参数是固定的,也就是当硬盘快接近这个出厂参数时,就意味着这块硬盘已经接近报销的边缘。在西部数据官方上找到我的硬盘的相关参数信息,里面就有一个是Load/unload cycles at ambient condition 600,00(DATA Sheet),也就是说,我的硬盘的寿命取决于现有使用的这个参数值与官方值是否接近,具体查看及设置方法如下:
    • 安装smartmontools,因为需要名为smartctl的来检查相关的信息
      sudo apt-get install smartmontools
    • 启用硬盘SMART监控功能
      sudo smartctl -s on /dev/sda
      brucebot@brucebot-laptop:/etc/laptop-mode$ sudo smartctl -s on /dev/sda
      smartctl version 5.37 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen
      Home page is http://smartmontools.sourceforge.net/

      === START OF ENABLE/DISABLE COMMANDS SECTION ===
      SMART Enabled.

      注:/dev/sda请选择你的硬盘,如果是IDE的,则是/dev/hda
    • 查看当前硬盘的详细状态
      sudo smartctl -d ata -A /dev/sda
      brucebot@brucebot-laptop:/etc/laptop-mode$ sudo smartctl -d ata -A /dev/sda
      smartctl version 5.37 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen
      Home page is http://smartmontools.sourceforge.net/

      === START OF READ SMART DATA SECTION ===
      SMART Attributes Data Structure revision number: 16
      Vendor Specific SMART Attributes with Thresholds:
      ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
        1 Raw_Read_Error_Rate     0x000f   199   197   051    Pre-fail  Always       -       426
        3 Spin_Up_Time            0x0003   185   180   021    Pre-fail  Always       -       1733
        4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       450
        5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
        7 Seek_Error_Rate         0x000f   200   200   051    Pre-fail  Always       -       0
        9 Power_On_Hours          0x0032   100   100   000    Old_age   Always       -       480
       10 Spin_Retry_Count        0x0013   095   095   051    Pre-fail  Always       -       23
       11 Calibration_Retry_Count 0x0012   100   100   051    Old_age   Always       -       0
       12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       263
      192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       153
      193 Load_Cycle_Count        0x0032   195   195   000    Old_age   Always       -       15977
      194 Temperature_Celsius     0x0022   108   099   000    Old_age   Always       -       39
      196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
      197 Current_Pending_Sector  0x0012   200   200   000    Old_age   Always       -       0
      198 Offline_Uncorrectable   0x0010   100   253   000    Old_age   Offline      -       0
      199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0
      200 Multi_Zone_Error_Rate   0x0009   100   253   051    Pre-fail  Offline      -       0
      请看,红色的即为我的硬盘的load/unload cycles看起来,已经有了四分之一多了,也就是说这块硬盘的四分之一寿命已经没有了。
      当然,如果仅仅想知道这个参数,可以使用sudo smartctl -a /dev/sda | grep Load_Cycle_Count仅仅导出这个参数。如果你安装了Ubuntu,并且没有经过相应的设置,再次执行上面的命令后,load_Cycle_count的数值会不断增大。 Ubuntu默认不会改动内置的参数,笔记本硬盘内置的自动进入低耗状态的参数过于严厉,导致频繁的Load/Unload,其他系统则无视或者不使用硬盘的这一功能,反而保护了硬盘的寿命。也就是说,只有Ubuntu存在这个问题。
    • 解决方法
      1. 关闭高级电源管理模块(Advanced Power Management setting)
        Sudo hdparm -B 255 /dev/sda
        brucebot@brucebot-laptop:/etc/laptop-mode$ sudo hdparm -B 255 /dev/sda

        /dev/sda:
         setting Advanced Power Management level to disabled
      2. 使用laptop-mode-tools
        • Sudo apt-get install laptop-mode-tools
        • 查看Laptop-mode是否启动
          grep ENABLE_LAPTOP_MODE /etc/default/acpi-support
          brucebot@brucebot-laptop:/etc/laptop-mode$ grep ENABLE_LAPTOP_MODE /etc/default/acpi-support
          ENABLE_LAPTOP_MODE=false
        • 启动laptop-mode
          sudo cp /etc/default/acpi-support /etc/default/acpi-support_backup
          sudo gedit /etc/default/acpi
          找到ENABLE_LAPTOP_MODE=false,并且将其设置成true

          注:我是同时设置了两种方法,使用命令sudo smartctl -d ata -A /dev/sda多次后可以看到,Load_cycle_count的值没有再增长。至此,问题解决!
           
  • 2008-02-27

    安装OSS过程记录 - [软件]

      在安装新的OSS驱动之前,如果系统中还有残留的驱动文件存在,安装过程是不能够完成的,因此首先要做的就是查看一下,系统内是否有以前的驱动存在。方法如下:
    1 在终端下进入目录/var/lib/dpkg/info,命令 cd /var/lib/dpkg/info
    2 删除所有以oss-linux开头的文件,命令sudo rm oss-linux*
    3 编辑文件/var/lib/dpkg/status,sudo gedit /var/lib/dpkg/status,找到关于oss-linux的有关内容,并将其删除(内容如下)

    Package: oss-linux
    Status: install ok installed
    Priority: extra
    Section: alien
    Installed-Size: 8440
    Maintainer: root <root@dev-desktop>
    Architecture: amd64
    Version: v4.0rc9-999
    Depends: libatk1.0-0 (>= 1.12.1), libc6 (>= 2.4-1), libcairo2 (>= 1.2.4), libfontconfig1 (>= 2.3.0), libglib2.0-0 (>= 2.12.0), libgtk2.0-0 (>= 2.10.3), libpango1.0-0 (>= 1.14.5), libx11-6, libxcursor1 (>> 1.1.2), libxext6, libxfixes3, libxi6, libxinerama1, libxrandr2, libxrender1
    Conffiles:
    /etc/oss.conf 055432d38aaf37fc6de3dba4a95accc3
    Description: Open Sound System sound drivers for Linux
    Open Sound System for Linux (OSS/Linux) is a commercial quality sound driver
    distributed by 4Front Technologies (http://www.opensound.com). OSS provides
    support for practically all sound cards on the market including PnP and
    many PCI ones. Installation and configuration is higly automated and easy to
    perform. To obtain technical support and additional features, you will need to
    order a license key from http://www.opensound.com/order.html
    (Converted from a rpm package by alien version 8.64.)

    4 查看oss-linux当前状态,命令 sudo dpkg --purge oss-linux,则会显示如下信息
    dpkg - warning: ignoring request to remove oss-linux which isn't installed.
    5 安装oss-linux,命令 sudo dpkg -i oss-linux_v4.0-1013_i386.deb,安装显示信息如下
    brucebot@brucebot-laptop:~/MyDownloads$ sudo dpkg -i oss-linux_v4.0-1013_i386.deb
    Selecting previously deselected package oss-linux.
    (Reading database ... 132118 files and directories currently installed.)
    Unpacking oss-linux (from oss-linux_v4.0-1013_i386.deb) ...
    Setting up oss-linux (v4.0-1013) ...
    Building OSS Modules for Linux-unknown 2.6.22-14-generic
    OSS build environment set up for REGPARM kernels
    Building module osscore
    Building module ali5455
    Building module allegro
    Building module als300
    Building module als4000
    Building module apci97
    Building module atiaudio
    Building module audigyls
    Building module audioloop
    Building module audiopci
    Building module cmi8788
    Building module cmpci
    Building module cs4280
    Building module cs4281
    Building module digi32
    Building module digi96
    Building module emu10k1x
    Building module envy24
    Building module envy24ht
    Building module fm801
    Building module geode
    Building module hdaudio
    Building module hdsp
    Building module ich
    Building module imux
    Building module lynxone
    Building module lynxtwo
    Building module maestro
    Building module neomagic
    Building module ossusb
    Building module riptide
    Building module s3vibes
    Building module sblive
    Building module sbxfi
    Building module softoss
    Building module solo
    Building module sonorus
    Building module trident
    Building module via8233
    Building module via97
    Building module vmix
    Building module vortex
    Building module ymf7xx
    depmod -a
    -----------------------------
    Detected Intel High Definition Audio (ICH8)
    Detected Generic USB audio device (BETA)
    Detected OSS Transparent Virtual Mixing Architecture
    -----------------------------
    Starting Open Sound System

  • Lenovo F31A has used many technology from thinkpad, such as Active Protection system for the hard disk(HDAPS).What is APS system? Here we go.

    The Active Protection System

    With the new series of ThinkPads IBM introduced the Active Protection System (APS) in 2003. The APS is a protection system for the ThinkPad's internal harddrive. A sensor inside the ThinkPad recognizes when the notebook is accelerated. A software applet then is triggered to park the harddisk. This way the risk of data loss in case of when the notebook is dropped is significantly reduced since the read/write head of the harddrive is parked and hence can't crash onto the platter when the notebook drops onto the floor.

    The hardware sensor is capable of not only recognizing acceleration of the notebook, but also (to a certain degree) of its whole orientation in space, relative to gravity's axis. Furthermore, having the actual control put into software, its functionality is extendable and it gives chance to implement features like the "ignore minor shocks" feature which is present in the Windows based control applet. (This feature prevents the harddrive from parking in case of minor regular shocks such as occur when in a train or car.)
    And the following websites are recorded for the future configuration for my notebook.

    1.http://www.thinkwiki.org/wiki/Active_Protection_System
    2.http://article.gmane.org/gmane.linux.drivers.hdaps.devel/1040
    3.http://www.thinkwiki.org/wiki/How_to_protect_the_harddisk_through_APS

      

     

  • Table of Contents

    1.Introduction

    2.Summary

    3.Computer details

    1.Introduction

    I purchased a Lenovo F31A laptop days ago, it is a great laptop except the pre-installed OS VISTA, I really do not like it. As I have some experence to use ubuntu on the PC, so I decide to install the Ubuntu 7.10 to the laptop. And the installation is very easy,just download the iso file from ubutnu homepage and burn it to a CD-ROM, then use this CD to boot laptop, follow the normal way to install ubuntu. It can easily automaitcally detect almost all the hardware and install the driver to them, except two hardware, the wireless card driver and the sound driver.

    WIRELESS

    1.Download a software named bcm43xx-fwcutter_20060108-6build1_i386.deb and install it.Here http://linuxwireless.org/en/users/Drivers/b43 you will find more details about b43.
    2.Click the icon on the right above panel---Restricted Drivers, and enable the firmware for broadcom 43xx chipset family, then it will pop-up a window ask you to slect the firmware to download, pls choose the second one which is
    http://xeve.de/down/wl_apsta.o ,after finishing the download,ubuntu will automatically install the firmware.

    SOUND

    I have tested all the alsa driver version, and some patches, which still have no effect to drive my sound card. Finally I found this article http://ubuntuforums.org/showpost.php?p=3768914&postcount=60 which help me to solve my sound card issue, so now I can listen music and watch movies under my new laptop now.

    2.Summary


    Hardware component

    Status under Ubuntu 7.10

    Notes

    Intel(R) Pentium(R) Dual CPU T2330 @ 1.60GHz

    Works

     

    13.3¨WXGA TFT(1280X800)

    Works

     

    nVidia GeForce 8400M GS(128MB)

    Works

     

    1GB RAM

    Works

     

    160GB HDD(WDC WD1600BEVS-2)

    Works

     

    DVD±RW(DVD RW AD-7640A)

    Works

     

    NetLink BCM5906M Fast Ethernet PCI Express

    Works

     

    BCM94311MCG wlan mini-PCI

    Works

     

    82801H (ICH8 Family) HD Audio Controller

    Works

    OSS

    Memory Card Reader

    Not test

     

    Internal 56K modem

    Not test

     

    Lenovo EasyCamera

    Not test

     

    Bluetooth

    Works

     

    3.Computer Details

    Pls see the details attached pdf file.

    Download Install Ubuntu 7.10 on My Lenovo F31A Howto

     

  • Just bought a Lenovo F31A some days ago, the default OS is Windows Vista Home Premium, which looks nice, but I really do not like.The Effect is not very good.Ubuntu has a better solution about this. So I delete all the partition, and reinstall the Ubuntu 7.10 to my New notebook.

    Everything is Ok when finish the normal installation procedure expcept the Wireless bcm4xx firmware and the sound card.For the first issue, here with a solution:

    1.Download a software named bcm43xx-fwcutter_20060108-6build1_i386.deb and install it.Here http://linuxwireless.org/en/users/Drivers/b43 you will find more details about b43.

    2.Click the icon on the right above panel---Restricted Drivers, and enable the firmware for broadcom 43xx chipset family, then it will pop-up a window ask you to slect the firmware to download, pls choose the second one which is http://xeve.de/down/wl_apsta.o ,after finishing the download,ubuntu will automatically install the firmware.

    For the sound card, i am still under searching a way to solve it.Hope someone can give me a hand.