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. |
$ 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 |
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. |
swapon -s
Bit simpler than cat /proc/swaps |
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 |
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.. |
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! |
Quote:
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. |
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 :( |
Quote:
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) Code:
/dev/hda? none swap sw 0 0 edit if commands don't work, try them as /sbin/????? |
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 :D) 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?
|
All times are GMT -5. The time now is 07:16 PM. |