Solved

System frozen by continuous harddisk-reading

Posted on 2002-04-17
14
315 Views
Last Modified: 2008-03-17
Hi Experts,

I have this problem for quite a long time.
Each time when I start my linux machine, it works quite stable in the first few hours. And then it begins to read/write the harddisk continuously. At the same time it response neither the mouse clicking nor the keyboard typing. I must restart the computer to get it to work in the next few hours :-(
Cann anybody tell me how should I do about it?

Some additional informations:
I use SUSE Linux 7.2, Kernel 2.4
I have 2 Harddisks in my machine, one for windows, one for linux.
The Harddisk for windows is full.
The one for linux has still capacity.

/dev/hda1-hda6    Windows

/dev/hdb1 ext2 23Mb  /boot  free:18.3M  
/dev/hdb3 ext2 9.14Gb  /    free:2.46G

Should I establish a swap partition? Can I do it on the hdb3?

Thanks a lot

Visu

0
Comment
Question by:visualminder
  • 8
  • 6
14 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 6947708
No swap partition, huh? That could be the cause of the disk activity since it starts after the system has been up for a while.

Adding a swap partition would be the preferred way, but unless you have unallocated space on hdb that won't be an easy thing to do. You'd have to squeeze your root partition if you tried to do it on the existing installation or reinstall the os and include a swap partition in the new configuration.

An alternative would be to make a swap file on the existing installation. The file would be created with dd, made into a swap file with mkswap, and enabled with swapon. Something along the lines of:

# dd if=/dev/zero of=/swapfile bs=1024 count=???
# mkswap /swapfile
# swapon /swapfile

The count=??? should be at least 1024 x your memory size in MB, and more, say around twice the amount of memory, is even better. If that solves the disk thrashing problem you'll want to arrainge to have the swap area enabled at boot, see "man fstab". Or you could consider the more troublesome options above.
0
 
LVL 1

Author Comment

by:visualminder
ID: 6950063
Hi Jlievie,

thanks for the anwser.
As I tried to setup a swap partition with the partition magic, I noticed that I did have a small swap partition of 136M. It should be too small for my machine (256M memory). By using the partition magic I firstly remove the swap partition and add another 430M to it to form a larger free space. Then I changed to Linux and setup this free space to be a swap partition:
/dev/hdb2  (from) 4   (to) 74   570M

But as I run "top" to see the result,the system reported:  
Swap: 136M available   93M used   43M free  173M cached

Why only 136M available?? Any idea?

Thanks

Visu
0
 
LVL 1

Author Comment

by:visualminder
ID: 6950128
Hi Jlievie,

thanks for the anwser.
As I tried to setup a swap partition with the partition magic, I noticed that I did have a small swap partition of 136M. It should be too small for my machine (256M memory). By using the partition magic I firstly remove the swap partition and add another 430M to it to form a larger free space. Then I changed to Linux and setup this free space to be a swap partition:
/dev/hdb2  (from) 4   (to) 74   570M

But as I run "top" to see the result,the system reported:  
Swap: 136M available   93M used   43M free  173M cached

Why only 136M available?? Any idea?

Thanks

Visu
0
 
LVL 40

Expert Comment

by:jlevie
ID: 6951006
I don't understand what you mean by "Then I changed
to Linux and setup this free space to be a swap partition:
/dev/hdb2  (from) 4   (to) 74   570M". Did the partition number of your swap partition remain the same? If it didn't did you change /etc/fstab?

Even though Partition Magic may have increased the size of the partiton that swap is using, Linux won't use the additional space until mkswap has been run on that area. I'd recommend that you re-make the swap partition by booting into single user mode and then doing:

# swapoff -a
# mkswap /dev/hd??
# swapon -s

You've probably got enough memory to do the above in runlevel 3, but why take a chance on something needing swap while you are re-making it. Single user mode is much safer.
0
 
LVL 1

Author Comment

by:visualminder
ID: 6951561
I used a tool called "yast" under suse Linux 7.2 to set the 570M freespace to the swap. The setup seemed to be successful. After the setup the tool reported:

device-name   from  to   Kbytes  type of the partition
/dev/hdb1       1    3    24066    83 Linux native
/dev/hdb2       4    74   570307   82 Linux Swap
/dev/hdb3      75   1232  9301635  83 Linux native

I think that means I have then 570M capacity for the swap.
But another linux tool "top" reported in this morning:
Swap: 136M available   93M used   43M free  173M cached
(Only 136M available for swap? and 173M cached??)

but now the top reported something different:
Swap:136M available    97M used  39M free  56M cached

0
 
LVL 40

Expert Comment

by:jlevie
ID: 6951631
Okay, now I understand that part of your previous comment.

I'm not really familar with yast. I thought it was just a tool for installing SuSE. Are you sure that it can re-size partitions on an existing system? There's more to that than just changing the size as the basic structure of a file system has to be adjusted to take into account the new partition size.
0
 
LVL 1

Author Comment

by:visualminder
ID: 6951954
I didn't use yast to resize the partition. I used the partition magic to resize it, acctually I moved a free space to the existing swap (The existing swap was 136M) and merged them together to form a larger free space. But this free space is not a swap partition any more. So I had to use yast to change this free space back to a swap partition.

The problem is that the yast reported the enlarged swap partition while it was not recognized by "top".

What I also don't understand is why my memory was so occupied.
I have 256M Memory and I started only netscape and a console to run top. The programm top report like this:

Mem: 256M available, 250M used ?? 5M free  3M Buff
Swap: 136M available, 97M used  39M free    6M cached  

size    cpu%    %mem    command
4544     0.1    1.5       kdeinit
16016     0.1    5.6       X
912       0.1    0.3       top
(sometimes)
138M       1.3      30%      Netscape  
(why can netscape occupy so many memories??)
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 40

Expert Comment

by:jlevie
ID: 6952201
Okay, I understand.

So it does sound like the swap partition is larger now. Have you used the procedure above to re-make swap so that it will occupy the entire partition?

0
 
LVL 1

Author Comment

by:visualminder
ID: 6952977
yes, I used yast to let the swap to occupy the entire partition. But again, another tool called top seemed not to recognize the whole swap partition. Only 136M was reported, see above...
0
 
LVL 40

Expert Comment

by:jlevie
ID: 6953472
Okay, I believe that yast only set the partition type and didn't re-make swap. You need to boot into single user mode and execute:

# swapoff -a
# mkswap /dev/hdb2
# swapon -s

Then top should report a larger size.
0
 
LVL 1

Author Comment

by:visualminder
ID: 6954015
Sorry, how could I boot into single user? You know I'm not quite familier with linux :-)
0
 
LVL 40

Accepted Solution

by:
jlevie earned 100 total points
ID: 6954427
That depends on how you boot Linux. If you are using Lilo got to single user mode by entering 'linux single' at the Lilo prompt. If you boot with Grub edit the kernel line and add 'linux single' to the end.
0
 
LVL 1

Author Comment

by:visualminder
ID: 6963842
hi jlevie

sorry for being late. I tried your suggestion. It works! thanks a lot

Visu
0
 
LVL 1

Author Comment

by:visualminder
ID: 6963856
thanks for the help
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now