# Solved: Ubuntu 8.04 Hangs For No Apparent Reason



## golddust (Jan 2, 2005)

Created new partition on my Gateway 5464 desktop. Hard drive is 320 GB and I partitioned it in half with it's own drive letter for the second half. Loaded Ubuntu 8.04 on the second half (Vista is on the other half). 

Problem is Ubuntu arbitrarily hangs as I'm working. No specific file or program involved. Sometimes the hang is for just a few seconds - like it is trying to catch up. Other times it completely freezes so I have to restart the computer to get out of it. Windows still works fine. I've uninstalled and reformatted that partition then reinstalled twice with no change in behavior. What could be going wrong?


----------



## lotuseclat79 (Sep 12, 2003)

Did you partition a swap partition for Linux? If not, that could be your problem.

Post the output of the command as root:
# fdisk -l
or as a regular user:
$ sudo fdisk -l

You should be seeing a separate swap partition - if not, you did not partition one.

Use the rule of thumb of partitioning 380 cylinders of the 160GB reserved for Linux, and the remainder for the root, /, partition. Use 26 cylinders for a boot partition - if you create one. Figure out the math first (from the fdisk -l data output).

-- Tom


----------



## golddust (Jan 2, 2005)

Sure did. 4 GB swap file. The OS is sitting in a 25 GB section of the drive.


----------



## lotuseclat79 (Sep 12, 2003)

Hi golddust,

Ok, then what applications were you running at the time?

In a separate Terminal window, you can run the "top" command to see what is using the cpu to monitor what is going on. Why don't you try that to help determine what may be causing the hang - hopefully, the system will hang while running top.

-- Tom


----------



## golddust (Jan 2, 2005)

That's the weird part. It seems to be random. Sometimes I'm on the internet. Other times I'm using OpenOffice Writer. Another time I was just looking through the menus to see what Linux has to offer (I'm really really new). Another time I was looking at my email.
It's whenever it decides to go nuts!! Is it possible the 30 Gigabytes I alloted for the OS/Swapfile area isnt' big enough?


----------



## lotuseclat79 (Sep 12, 2003)

Hi golddust,

If anything, I think your swap file is too big. Look at my previous post where I suggested a value for what size I thought you should make your swap partition - do the fdisk -l command first and do the math.

-- Tom


----------



## golddust (Jan 2, 2005)

Just reading on the Ubuntu site that swap file should be twice the size of computer memory (which is 2 GB). So 4 GB for the swap file should be correct. I had given up trying and removed Ubuntu from my computer so it isn't installed right now. Attended part one of a lecture at my computer club (we are just getting into Linux) about downloading the software and installing it. Part 2 of the lecture is next week. I mentioned the problem I was having and our lecturer (one of our members) was really stumped! Nobody seems to be able to figure out what is going wrong! Figured I'd do more research before trying again.


----------



## golddust (Jan 2, 2005)

Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x390ad1d5

Device Boot Start End Blocks Id System
/dev/sda1 * 1 22216 178443264 7 HPFS/NTFS
/dev/sda2 22217 33538 90943965 82 Linux swap / Solaris
/dev/sda3 33539 38913 43174687+ 5 Extended
/dev/sda5 33539 38687 41359311 83 Linux
/dev/sda6 38688 38913 1815313+ 82 Linux swap / Solaris


----------



## lotuseclat79 (Sep 12, 2003)

Hi golddust,

I see two Linux swap partitions, but only ever one is required on a disk with multiple Linux partitions. You can probably get rid of one, and reallocate the space by resizing your partitions. I would put it into the Linux partition in sda5.

Another comment. It probably does not matter, but I would juxtapose the NTFS and Extented partitions as Windows uses them, and then put the Linux partitions after.

-- Tom


----------



## golddust (Jan 2, 2005)

I thought that looked odd myself. How do I get rid of one and which one should I get rid off? I know how to partition and juggle the space around in Windows, but how do I do it in Linux? The breakdown you see here was created during the install. I just used the slider in the install to create the sections for the operating system and rest of the file area and this is what it did.


----------



## lotuseclat79 (Sep 12, 2003)

Download Gparted+parted, i.e. the frontend and partition editor (Gnome) and use that to delete the last swap partition (sda6), then add the freed up disk space to increase sda5.

-- Tom


----------



## golddust (Jan 2, 2005)

Looks like this problem is solved. My hard drive crashed this morning. Guess that was where the problem was coming from. Fortunately, it is still under warranty - only had a month to go. Gateway is going to send me a replacement hard drive. Hubby is going to put it in. Good thing I had copied my important stuff to my laptop last week.


----------

