Thread: I just inherited a laptop and got some questions

  1. #1
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743

    I just inherited a laptop and got some questions

    So a friend of mine dropped his Gateway laptop on the cement several months ago, and supposedly it has not been the same ever since. Consequently, he got a new laptop.

    I asked him today if I could play with his old laptop, and he said I could, so here is what I got so far:

    The laptop is a Gateway with a Pentium 4 2.8 Ghz processor (hyperthreaded). I don't know how much memory it has (I haven't checked yet). It has a 60 GB hard drive.

    He threw away the power cord after he dropped the computer on the cement, and so right now I am running off of a borrowed power cord which has the appropriate voltage level but about half of the amperage.

    I want to check the hard drive to see what condition it is in, but I am not sure if Linux has a chkdsk utility like Windows does. I am planning on installing Ubuntu on the thing, and I am actually running the live CD right now, and it is working great. Anyways, does Linux have some kind of chkdsk utility?
    My Website

    "Circular logic is good because it is."

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Sent from my iPadŽ

  3. #3
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    If the HDD has SMART capability (which it should) you can use smartctl.

    Since there may be physical damage, which fsck may not pick up (other than the FS being corrupt).

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    As zacs7 suggests, fsck and chkdsk may not find hard errors on the disk, as they check that the filesystem is correct (sectors in the free-list aren't used by any file, all used sectors are listed to a file, no "multiple file using the same sector" problems, no file points to a sector "outside the disk", etc), but not that all sectors on the disk are OK to read and write.

    Also, hard-disks, when not running (powered off), tolerate quite a bit of dropping - if the screen on the laptop didn't crack, I expect the hard disk is fine.

    Installing Linux would be a good start (formatting the disk in the process), then write a simple program that fills the remaining [1] diskspace with some predictable pattern, and reads it back - start out with filling with for example 0x11111111, then 0xEEEEEEEE [bitwise opposite of 0x11111111], then counting 0x0000001 ... 0xFFFFFFFFF in a "unsigned int" [or unsigned long long - that way you get even more pattern spread], then do a read, invert, write back, read over again. [Reading blocks of 512-4096 bytes at a time will speed things up a bit].

    If all parts of the disk reads/writes are OK, then it should be fine. [To check the diskspace where you installed Linux, you may want to re-install with an empty partition at the start of the disk, and then run the above program over that part too].

    I'd try to find a power-supply that gives sufficient current (amperage), as you may find that it's not capable of powering the machine at all times otherwise. It's probably going to be fine if you only use it for short periods at a time.

    [1] You may want to leave a few megabytes free - just in case something else writes to the disk and needs some space.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Doesn't disk utilities scanning the surface do this?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Elysia View Post
    Doesn't disk utilities scanning the surface do this?
    Sure, but then you need to find one - and most of them work on Windows only, often only for a particular brand of disk. It shouldn't take more than an hour to hack up a program to test it.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  7. #7
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743
    I installed Ubuntu and everything seems to be working great. The version I installed was 7.10 because I did not have a copy of 8.04, but oh well.

    So far everything seems to be working great. The screen is most definitely not cracked...in fact...it is a beautiful screen. It is much better than my own laptop's screen So far all I have done is installed a bunch of apps and written a hello world program and tested its internet capabilities.

    The only fikity thing has been the power supply somewhat, and it didn't seem that the amperage was the problem. Occasionally the computer would think that the power supply had become unplugged, and so I would have to wiggle the cable a bit to make sure that it recognized the power cable was in there. This could be the fact that I was using a power cable that didn't come with the computer, or it could also be that its possible that some small amount of damage was done to this part of the computer when it was dropped (which I don't think would be unreasonable). Despite that fact, everything else was working great.

    I would like to run some sort of diagnostic on the disk though, just to make sure it is not physically damaged. I am not sure if it has SMART capabilities, but I assume it probably should because it is a fairly new computer (within the past 3 years). When I get home today I will look into that. I might also even try matsp's suggestion of writing/reading to the entire disk.
    My Website

    "Circular logic is good because it is."

  8. #8
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743
    Maybe someone could help me interprete the results of running smartctl?

    I ran it like thus:

    david@david-laptop:~$ sudo smartctl --test=long /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 OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
    Sending command: "Execute SMART Extended self-test routine immediately in off-line mode".
    Drive command "Execute SMART Extended self-test routine immediately in off-line mode" successful.
    Testing has begun.
    Please wait 53 minutes for test to complete.
    Test will complete after Sat Aug 16 12:17:02 2008

    Use smartctl -X to abort test.
    david@david-laptop:~$
    Then about two hours later I did the following:
    david@david-laptop:~$ sudo smartctl --attributes --log=selftest /dev/sda
    [sudo] password for david:
    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 0x000b 098 098 062 Pre-fail Always - 327680
    2 Throughput_Performance 0x0005 100 100 040 Pre-fail Offline - 0
    3 Spin_Up_Time 0x0007 132 132 033 Pre-fail Always - 1
    4 Start_Stop_Count 0x0012 099 099 000 Old_age Always - 1735
    5 Reallocated_Sector_Ct 0x0033 100 100 005 Pre-fail Always - 0
    7 Seek_Error_Rate 0x000b 100 100 067 Pre-fail Always - 0
    8 Seek_Time_Performance 0x0005 100 100 040 Pre-fail Offline - 0
    9 Power_On_Hours 0x0012 092 092 000 Old_age Always - 3552
    10 Spin_Retry_Count 0x0013 100 100 060 Pre-fail Always - 0
    12 Power_Cycle_Count 0x0032 099 099 000 Old_age Always - 1730
    191 G-Sense_Error_Rate 0x000a 100 100 000 Old_age Always - 0
    192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 95
    193 Load_Cycle_Count 0x0012 090 090 000 Old_age Always - 105147
    194 Temperature_Celsius 0x0002 137 137 000 Old_age Always - 40 (Lifetime Min/Max 7/51)
    196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 14
    197 Current_Pending_Sector 0x0022 100 100 000 Old_age Always - 2
    198 Offline_Uncorrectable 0x0008 100 100 000 Old_age Offline - 0
    199 UDMA_CRC_Error_Count 0x000a 200 200 000 Old_age Always - 0


    SMART Self-test log structure revision number 1
    Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error
    # 1 Extended offline Completed: read failure 40% 3550 85327077


    david@david-laptop:~$
    I had a hard time interpreting the results....but the last section (which I highlighted in red) is the "errors" section. Is that how much estimated lifetime is left in the hard disk?
    My Website

    "Circular logic is good because it is."

Popular pages Recent additions subscribe to a feed