Re: [SLUG] Hard Drive

From: steve szmidt (steve@szmidt.org)
Date: Sat Oct 09 2004 - 10:23:31 EDT


On Saturday 09 October 2004 08:45 am, Bill Shaw wrote:
> Frank,
>
> Short of what's already been suggested(diagnostic disk, slave,
> bootable linux) I don't know of any other way of testing the drive.
>
> On Fri, 08 Oct 2004 23:14:03 -0400, SOTL <sotl155360@earthlink.net> wrote:
> > Hi All
> >
> > Lets be clear about the sequence of events here.
> >
> > 1. First, I entered a web site which may or [may not] have caused a HD
> > issue. I suspect yes because of the response of the drive and because I
> > have had this happen in the past. How I do not have a clue; that is way
> > above my level.

If you are running windows you can easily have gotten viral instructions
installed and executed. Now from Windows you cannot read or write a Linux
partition, but you can write anywhere using low level instructions.

You get these instructions from f.ex. an image or a web page. Windows just
executed them for you in it's quest of being helpful.

> > 2. My normal method of solving these type of issues is to reinstall the
> > system which is Mandrake 9.1. Problem I have no idea where the system
> > disk but I did find the 9.2 disk which system I do not like. The 9.1 disk
> > is DVD while the 9.2 is CD. There are major differences between the DVD
> > and CD version; the DVD having all the programs in the CD version plus a
> > number of ones including like Midnight Commander which I like. Since I
> > plan on upgrading to 10.1 ASAP I decided I would sacrifice the additional
> > programs in 9.1 and update to 9.2.

Sorry I have no idea of what you are saying here, and I've not followed the
thread (I just jumped in when I saw it had not resolved.) Try to rephrase it.
If you are missing CD's then download them. If you cannot then have someone do
it for you. If you live in Clw I can help you as I have all versions.

> > 3. At this point I can still boot Windows. Being some what whipped out I
> > did what I should never do and started trying to repair a computer. I
> > thus proceed to put the install / update first disk of 9.2 in the old CD
> > drive.
> >
> > 4. My update process ended half way through the process with an error
> > message of unable to find something; if I recall correctly the HD but it
> > could have been something else. I tried this a number of times. The HD
> > made a horrible scratching sound here in Linux but not in Windows. I can
> > still boot windows at this point.

Scratching sound is an absolute no no. The head on a drive is flying over the
surface at a distance which is so narrow that a piece of hair is like a house
on the road. If it touches the surface it will scratch it and that portion
will become useless. That drive is fatally wounded if it made a scratching
sound.

> > 5. The next day or maybe the following day, most probably the following
> > day, I tried again. This is when I lost the ability to boot into either
> > Windows or Linux so the boot record is now corrupt. For me loosing boot
> > is normal too when I have problems with reinstallation. This is where I
> > stopped two days ago.
> >
> > My next idea was to reinstall Windows which should allow me to boot
> > widows if I did not destroy the Windows separation partitions.
> >
> > As for partitions the drive is partitioned as follows:
> > hda1 10GB Windows Sorry I forgot the petition type but it is Windows XP
> > standard
> > hda2 20GB Data Fat32
> > hda3 100 MB /boot ext3
> > hda4 10GB / ext3
> > hda5 10GB /home ext3
> >
> > Personally I do not see an issue with what I am proposing but considering
> > ny last two week hard luck I chickened out and posted my posting.
> >
> > As far as the hard luck lets let that suffice with the above computer
> > issues and the fact that I broke mt hand. Typing with two fingers on one
> > hand is a bitch. I will also state for what ever reason my Linux desktop
> > system is down too for some reason related to modem. That one I don't get
> > as I have a system on one of my drawer HD that has not been used in a
> > couple of years. Implication being this is a hardware problem which will
> > have to wait until I have two hands to work with.
> >
> > Question: Does anyone have any better idea of how to verify if the HD is
> > bad or good with out using the recovery disk. I did not get a tools or
> > diagnostic disk.

Simply create one partition on the drive and checking it with df will tell you
how much of the drive is useful. It will skip over bad sectors, and what
remains should be good. So you will see with 'df -h' the size of that
partition (in a human formatted list).

You could test it further by writing to the whole drive. (I suggest you use
Linux to test with has it's more efficient.) You will need Linux running of a
floppy or CD.

Format the whole drive with ext3 and write a little script that writes to the
whole drive. Like so:

#!/bin/sh
i=0
Disk=""
while [ "$Disk" != "100%" ] ;do
        i(($i+1)
        clear
        echo $i
        echo "$i" >> testfile
        Disk=`df|grep "hda1 "|cut -d" " -f22`
done
df -h
        
You may need to play with f22 as it can vary depending on your version of df.

If you don't know what the script does;
It loops through the instructions until the disk is reportedly full. While
doing so it increases a counter $i. Disk is a variable that contains the
value of drive usage. When it says "100%" it will stop the looping. Then
report your disk usage.

That Disk= line does this; The variable Disk receives the result of what's to
the right of the equal sign. It executes disk free to see how much the disk
is used. But since we only want one value (% used) we use grep and cut to get
to that value. Grep locates the line which has the value, and cut cuts out
the specific field we are looking for.

f22 is the field number. We arrive at 22 as there are many spaces on the line,
and each space is a field. So you should execute this manually first to make
sure it matches what you have. You can play wit the number to see what it
picks up.

Do whis;

df
(Note the size used, is probably 0%)
df |grep "hda1 "
(that has a space inside the quotes)
df|grep "hda1 "|cut -d" " -f22

If that produces "0%" (or the size used) then we are fine. If not play with 22
until it does. You are now ready to write the script.

Earlier I said "reportedly full". When df is executed it only has full
percentages to play with. So it will round off and that means you still have
a few bytes left when it goes from 99% to 100%. But for all practical
purposes it will be full.

Note the number the script has at the end as you could add code that reads the
drive back and it should be able to count with it. I'll give you that code if
you get that far.

Remember you need to format the drive using ext2 or ext3, and it needs to be
one big partition, and only one. The script can be written on the test drive.

I think I covered everything here... : )

-- 

Steve Szmidt

"They that would give up essential liberty for temporary safety deserve neither liberty nor safety." Benjamin Franklin ----------------------------------------------------------------------- This list is provided as an unmoderated internet service by Networked Knowledge Systems (NKS). Views and opinions expressed in messages posted are those of the author and do not necessarily reflect the official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 19:26:41 EDT