LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Xubuntu Programs Randomly Closing (http://www.linuxquestions.org/questions/linux-software-2/xubuntu-programs-randomly-closing-846891/)

mbonwick 11-27-2010 08:42 AM

Xubuntu Programs Randomly Closing
 
Hi all,

I'm running Xubuntu 10.10 via USB on a Dell Latitude D505.
Wireless card is a Netgear WPN111 and I'm using ndiswrapper to make it work.

My problem is this:
when I open any web browser and try to navigate to a page, the whole system freezes for a few min before crashing to desktop.
Using Task Manager during this time reveals that processor usage jumps to 100% and stays there until the program closes.

I've tried Xubuntu on another, faster machine and it was fine.
From this I conclude that it's related to the hardware, and I think it may be some hardware protection feature operating.

Is there anything I can do to sort it?

Specs:
Dell Latitude D505
256MB RAM
Integrated Graphics
Intel Celeron M 1.4GHz

stress_junkie 11-27-2010 08:58 AM

The Netgear WPN111 has an Atheros AR2414 chip set so you shouldn't need to use ndiswrapper to make it work.

http://www.wireless-driver.com/downl...nd-Chipset.htm

http://sourceforge.net/projects/madwifi/

Nevertheless that may not be the cause of your problem. It probably wouldn't hurt to use the native Linux code.

Your actual symptoms make me wonder if you are having a RAM swapping issue. How much RAM do you have and how big is your swap partition?

Does the problem happen only on certain web sites?

If yes do those web sites download large amounts of data such as video streaming?

mbonwick 11-27-2010 11:29 AM

I'll give madwifi a go, hopefully it'll be slightly easier to setup than ndiswrapper etc

It's got 256MB RAM. As for the swap partition, I'm not sure?

Thanks for the advice so far...


EDIT: Just had a proper look on the madwifi website, it says it doesn't support USB wireless cards like the WPN111...thoughts?

stress_junkie 11-27-2010 12:50 PM

Quote:

Originally Posted by mbonwick (Post 4172793)
It's got 256MB RAM. As for the swap partition, I'm not sure?

You can see the swap space size by issuing the following command in a terminal window.
Code:

cat /proc/swaps
That will show you the location and size of the active swap files. The size is in kilobytes so multiply the size by 1024 to see the size in bytes. Here is mine.
Code:

$ cat /proc/swaps
Filename                                Type                Size        Used        Priority
/dev/sda3                              partition        3903784        0        -1

I have a 4 GB swap partition (roughly). The /proc/swaps file says that my swap partition is 3903784 kilobytes so I multiply 3903784 by 1024 to see that my swap partition is 3,997,474,816 bytes.

Quote:

Originally Posted by mbonwick (Post 4172793)
EDIT: Just had a proper look on the madwifi website, it says it doesn't support USB wireless cards like the WPN111...thoughts?

I'm sorry about that misdirection. I will investigate more. Unfortunately I don't have a WPN111 to use for testing information that I find.

mbonwick 11-27-2010 01:04 PM

It seems it doesn't have a swap file;

Code:

ubuntu@ubuntu:~$ cat /proc/swaps
Filename                                Type                Size        Used        Priority
ubuntu@ubuntu:~$

I guess I should create one, but how?

stress_junkie 11-27-2010 01:28 PM

The more I look for device support for your wireless NIC the more I find people using ndiswrapper. Here is the happiest post I've seen on the subject.
http://www.linuxquestions.org/questi...4/#post2907116

Coincidentally happens to be located here on LQ. I looked on other web sites via Google. Most of the things that I read suggested that people were frustrated.

Since you've already got it working then disregard all of the above.


Quote:

Originally Posted by mbonwick (Post 4172866)
It seems it doesn't have a swap file;

Code:

ubuntu@ubuntu:~$ cat /proc/swaps
Filename                                Type                Size        Used        Priority
ubuntu@ubuntu:~$

I guess I should create one, but how?

Yes it does seem that you are missing a swap partition. That is the key. The swap area is usually in a partition on the disk.

We should see if you have any spare space on the disk that is not already allocated to a partition. I like to use cfdisk because it shows you everything in an easy to read format.

Open a terminal window and enter the following command.
Code:

sudo cfdisk /dev/sda
That command presumes that you have only one disk drive in the computer. (/dev/sda)

The cfdisk display will show if you have any space that is not already allocated.

Do that and report back please. :)

mbonwick 11-27-2010 01:50 PM

Ran cfdisk, results below. sda is the main windows hard drive on this laptop, so I used sdb which is the flashdrive in question instead.

Code:

cfdisk (util-linux-ng 2.17.2)

                              Disk Drive: /dev/sdb
                        Size: 16173236224 bytes, 16.1 GB
              Heads: 64  Sectors per Track: 32  Cylinders: 15424

    Name        Flags      Part Type  FS Type          [Label]        Size (MB)
 ------------------------------------------------------------------------------
    sdb1        Boot        Primary  W95 FAT32 (LBA)                  16173.24

Thanks,

stress_junkie 11-27-2010 01:53 PM

Quote:

Originally Posted by mbonwick (Post 4172894)
Ran cfdisk, results below. sda is the main windows hard drive on this laptop, so I used sdb which is the flashdrive in question instead.

I'm guessing that Xubuntu is installed on /dev/sda along with Windows. This is the drive that interests us. We probably don't want to use a flash drive for swap space.

Give it another try showing /dev/sda.

mbonwick 11-27-2010 01:57 PM

No, Xubuntu is installed on the flashdrive. Sorry, should have made that clear.

Don't think that affects creating a swap file/partition?

stress_junkie 11-27-2010 02:05 PM

That's okay. Since Xubuntu is installed on the flash drive then the flash drive is a good place to put the swap partition.

Now the question is how to do it. I don't know if Xubuntu has gparted installed and I don't know if gparted will resize a mounted partition.

Ideally we want to boot a live Linux CD and shrink the existing partition on the flash drive, then create a new partition that will be used for swap space, then tell Xubuntu to use that swap space automatically when it starts.

Did you install Xubuntu from a live CD? If you did then boot that, open a terminal window, and see if it has gparted by opening a terminal window and entering the following command.
Code:

which gparted

mbonwick 11-27-2010 02:12 PM

I created the Xubuntu flashdrive with the USB Installer from pendrivelinux.com

I think the best course of action is to format and repartition the flash drive; ie. start afresh.

Am I right in thinking leaving 1GB of unallocated space (in windows), and then running gparted is the best course of action?

stress_junkie 11-27-2010 02:15 PM

Yes that is a good choice. I recommend leaving 2 GB for swap space.
:)

mbonwick 11-27-2010 02:36 PM

Ah, slight problem;

It's not possible to put more than one partiton on a USB flash drive. I guess I'm going to have to go for a swap file rather than partition.

Unless there's a way round this?

stress_junkie 11-27-2010 02:50 PM

We can make a swap file in the root directory of the Xubuntu file system. I've never made a swap file but I have manually configured a swap partition. It should be very similar.

Here are the steps:
1- create a 2 GB file in the root directory
2- mount that file as a loop device
3- format it
4- put a line in /etc/fstab to automatically mount the page file and activate swapping

Here are the commands:
1- create the 2 GB file in the root directory
Code:

sudo dd if=/dev/zero of=/swapfile bs=2048 count=1M conv=notrunc,noerror
2- mount that file as a loop device
Code:

losetup /dev/loop0 /swapfile
3- format it
Code:

mkswap /dev/loop0
4- put a line in /etc/fstab to automatically mount the swap file during system startup
Okay. Let's make a backup of the /etc/fstab file before we do anything.
Code:

sudo cp -v /etc/fstab /etc/fstab.original
Now we will add the line.
Code:

sudo echo "/swapfile        none        swap        sw    0  0" >> /etc/fstab
I have tested this. It works.

Restart Xubuntu, then cat /proc/swaps to see if the swap file is activated.

mbonwick 11-27-2010 03:33 PM

Quote:

Originally Posted by stress_junkie (Post 4172936)
2- mount that file as a loop device
Code:

losetup /dev/loop0 /swapfile

I sucessfully created the file, but when I come to mount it as above, terminal returns;
Code:

ubuntu@ubuntu:~$ sudo losetup /dev/loop0 /swapfile
losetup: /dev/loop0: device is busy

What am I doing wrong?


All times are GMT -5. The time now is 04:38 PM.