LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-13-2005, 06:59 AM   #1
pujolasdf
Member
 
Registered: Feb 2005
Posts: 70

Rep: Reputation: 15
How can I check whether I have a swap partition in Suse Linux 9.2 pro?


That's it. I'm not sure if I actually have a swap partition working, that's because the installation programme didn't tell me anything about swap partitions and my computer almost freezes when doing some kind of odd commands, such as cat /dev/hda1 (my 55GB-almost-full-windows partition).

Thanks in advance.
 
Old 02-13-2005, 07:14 AM   #2
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 47
$ df -h
if it says 'tmpfs', you definitely have a swap partition. To check if it's working, open some kind of swap-space-usage-meter (the GNOME applet 'system monitor' or similar should do), then start python:
$ python
>>> a = []
>>> while True: a.append(range(100))
...
(^C)
KeyboardInterrupt
>>> (^D)
$ (^D)

it should fill up your memory pretty fast, forcing the kernel to swap out something. If it can't, because you have no swap, you'll probably get a MemoryError (or similar) from python; of course, you might get the same message when running out of swap, so the swap-o-meter comes in handy.

Hope this helps,

Jonas
 
Old 02-13-2005, 07:16 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400Reputation: 2400
Hi,

fdisk -l /dev/hdX X being a, b. There should be an entry like this:

/dev/hda1 1 499 4008186 82 Linux swap

hda1 is just an example, could differ for you.

free and top show swap space (and how much is used).

Take a look at your /etc/fstab file, there should be an entry like:

/dev/hda1 swap swap sw,pri=128 0 0

hda1 being your swap partition. Again hda1 is just an example and sw,pri=128 can be different too.

Hope this helps.
 
Old 02-13-2005, 07:18 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,579

Rep: Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504
swapon -s
Bit simpler than cat /proc/swaps
 
Old 02-13-2005, 07:19 AM   #5
pujolasdf
Member
 
Registered: Feb 2005
Posts: 70

Original Poster
Rep: Reputation: 15
Hey, that was great! I think I have it working, but it says I only have 125MB of swap space, is it enough? Somewhere I heard that it should be about 2GB, I think. In any case, is any way of expanding it without destroying my other partitions? I mean in a Windows Partition Magic way for linux or something.

Thank you in advance again ;D
 
Old 02-13-2005, 07:19 AM   #6
kevinatkins
Member
 
Registered: Jan 2004
Location: cheshire, uk
Distribution: Ubuntu Hoary
Posts: 605

Rep: Reputation: 33
hi,

i think you could also use 'top' - it'll tell you all about what processes are running and give memory information, including any swap space..
 
Old 02-13-2005, 07:25 AM   #7
pujolasdf
Member
 
Registered: Feb 2005
Posts: 70

Original Poster
Rep: Reputation: 15
Hi and thank you to all of you for replying so incredibly fast!!

This is somewhat curious: (I don't have the fdisk command installed, it says 'command not found', maybe suse 9.2 pro doesn't install it in its typical installation..) when I type df I can see 125MB of swap space, but when I type cat /etc/fstab I can't see any swap partition, even more, I can't see the word 'swap' in the whole output! Maybe the swap space is in my main linux etc3 partition making its performance undergo a lot?

Thank you again!
 
Old 02-13-2005, 07:34 AM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,579

Rep: Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504
Quote:
Originally posted by pujolasdf
Hey, that was great! I think I have it working, but it says I only have 125MB of swap space, is it enough? Somewhere I heard that it should be about 2GB, I think. In any case, is any way of expanding it without destroying my other partitions?
How long is a piece of string ???.
Like most ROTs (rule of thumbs) they are out of date as soon as they are formulated. All the swap ROTs are from a time (not that long ago) when large RAM was uncommon.
If you have half a Gig or more (of RAM) don't worry too much about swap unless you are a *heavy* user. Oracle comes out with stupid numbers like you mentioned.
Swap can always be added if you have spare disk space - Linux supports multiple swaps.
 
Old 02-13-2005, 07:43 AM   #9
pujolasdf
Member
 
Registered: Feb 2005
Posts: 70

Original Poster
Rep: Reputation: 15
Okay, that's my output at cat /etc/fstab:

/dev/hda4 / reiserfs acl,user_xattr 1 1
/dev/hda1 /windows/C ntfs ro,users,gid=users,umask=0002,nls=utf8 0 0
/dev/hda3 /windows/D vfat users,gid=users,umask=0002,iocharset=utf8 0 0
/dev/hda5 /windows/E vfat users,gid=users,umask=0002,iocharset=utf8 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
proc /proc proc defaults 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
sysfs /sys sysfs noauto 0 0
/dev/cdrecorder /media/cdrecorder subfs fs=cdfss,ro,procuid,nosuid,nodev,exec,iocharset=utf8 0 0
/dev/fd0 /media/floppy subfs fs=floppyfss,procuid,nodev,nosuid,sync 0 0

I only have 256MB of RAM, but I'm planning to buy more. I'm worrying about swap space because of I execute some hugely CPU or RAM consuming programmes, my suse linux 9.2 pro system almost hangs, and I barely can CTRL+C, CTRL+ALT+BACKSPACE it. Sometimes it is completely impossible and I have to plug off my computer
 
Old 02-13-2005, 08:05 AM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 19,579

Rep: Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504Reputation: 3504
Quote:
Originally posted by pujolasdf
I only have 256MB of RAM, but I'm planning to buy more. I'm worrying about swap space because of I execute some hugely CPU or RAM consuming programmes, my suse linux 9.2 pro system almost hangs, and I barely can CTRL+C, CTRL+ALT+BACKSPACE it. Sometimes it is completely impossible and I have to plug off my computer
256 is a not large these days - try cfdisk /dev/hda
If you have some free space, create a partition of say 512Meg - make it larger if you want. Then,
then
Code:
mkswap /dev/hda? (whatever you created)
swapon /dev/hda?
Then add it it to fstab as;
Code:
 /dev/hda?    none    swap       sw               0   0
Looks like you may be correct about the current swap being allocated within a file system - I don't know Suse.
edit if commands don't work, try them as /sbin/?????

Last edited by syg00; 02-13-2005 at 08:07 AM.
 
Old 02-13-2005, 05:24 PM   #11
pujolasdf
Member
 
Registered: Feb 2005
Posts: 70

Original Poster
Rep: Reputation: 15
Ok, I've run fdisk and killed an old, useless and experimental-purpose win98 partition. Now I want it to be my swap, it's about 7,5 GB but I just want 1 GB of it. I've removed it with fdisk, made mkswap and swapon as root (thanks for the tip, didn't work without being root ) but when I introduce the swapon command it tells me that partition is busy. Then, I restarted my computer but in grub I still could see a "windows 2" boot possibility and linux mounted again the partition with all the files in it (!!!??). I saved changes in fdisk, what's going on?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
suse 9.3 pro: turning off swap - missing pcandpc Linux - Newbie 13 05-18-2005 03:07 PM
Swap Partition in SuSe 9.1 Pro is increasing radicaly and causing system to crash tontito_tx Linux - Newbie 3 02-28-2005 12:47 PM
Suse 9.1 Pro not using my swap partition ToBe SUSE / openSUSE 12 12-09-2004 02:05 PM
My Suse 9 Pro gives me a media check error when trying to install snoopyswiss Linux - Distributions 2 07-17-2004 05:24 PM
how can i check if my swap partition is being used correctly ? abbasakhtar Linux - Newbie 2 10-07-2003 11:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration