View previous topic :: View next topic |
Author |
Message |
halak79 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 01 Mar 2006 Posts: 30 Location: Arizona, USA
|
Posted: Wed Jun 14, 2006 11:36 pm Post subject: I broke my swap partition [solved] |
|
|
My system has 128 mb ram, and had a 500+mb swap partition on /dev/hda3
Someone suggested that I should try lowering the swap to be equal to my ram, and that it might affect applications' memory usage and preformance positively. They cited that they had a computer with 64mb ram and 64mb swap and it seemed to preform a little better then when they had 128mb swap.
Anway.. thats the background, I don't know how to resize a partition but I went ahead and tried it anyway
Now I can't activate my swap. What I did was deleted the old partition and made a new one, it looks like it all went well, but if I 'swapon -a' it says Invalid Arguments.
Code: |
% fdisk -l /dev/hda
Disk /dev/hda: 10.2 GB, 10245537792 bytes
255 heads, 63 sectors/track, 1245 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 261 2096451 7 HPFS/NTFS
/dev/hda2 * 262 266 40162+ 83 Linux
/dev/hda3 267 283 136552+ 82 Linux swap / Solaris
/dev/hda4 330 1245 7357770 83 Linux
% fdisk -l /dev/hda3
Disk /dev/hda3: 139 MB, 139829760 bytes
16 heads, 63 sectors/track, 270 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Device Boot Start End Blocks Id System
/dev/hda3p1 1 270 136048+ 82 Linux swap / Solaris
|
I do want to try the smaller swap, I think that over 500M swap is excessive for a system with 128mb ram.
Could someone please explain to me what's going on and how to fix it? And maybe how to add the freed up space [safely] to my root partition?
Thanks
-Sam
Last edited by halak79 on Thu Jun 15, 2006 8:23 pm; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
jmja89 Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 11 Jun 2005 Posts: 144
|
Posted: Wed Jun 14, 2006 11:44 pm Post subject: |
|
|
did you do and just try doing also what does you /etc/fstab look like? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
prg Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/204534513743f39e755df32.jpg)
Joined: 14 Oct 2005 Posts: 94
|
Posted: Thu Jun 15, 2006 12:05 am Post subject: |
|
|
is there any reason a system with less swap should perform better than one with more?
and if you shrink one partition you need to enlarge another one to take advantage of that... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Paapaa l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/7560954014609741ea1af8.png)
Joined: 14 Aug 2005 Posts: 955 Location: Finland
|
Posted: Thu Jun 15, 2006 9:03 am Post subject: Re: I broke my swap partition |
|
|
halak79 wrote: | My system has 128 mb ram, and had a 500+mb swap partition on /dev/hda3
Someone suggested that I should try lowering the swap to be equal to my ram, and that it might affect applications' memory usage and preformance positively. They cited that they had a computer with 64mb ram and 64mb swap and it seemed to preform a little better then when they had 128mb swap. |
Could you post a link to the above suggestion/message/article? Sounds very odd... |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Enlight Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/34498084446f6e929bedfd.jpg)
Joined: 28 Oct 2004 Posts: 3519 Location: Alsace (France)
|
Posted: Thu Jun 15, 2006 11:59 am Post subject: Re: I broke my swap partition |
|
|
halak79 wrote: |
Someone suggested that I should try lowering the swap to be equal to my ram, and that it might affect applications' memory usage and preformance positively. They cited that they had a computer with 64mb ram and 64mb swap and it seemed to preform a little better then when they had 128mb swap.
|
Please please please, there is this thing called sysctl, vm.swapiness in our case IIRC wich will tell the kernel wether he ought to kill or swap pages, so even if you seem to have probably more than needed swap, this is pointless.
Other than this, as said before it seems that you missed to run mkswap against your partition. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
halak79 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 01 Mar 2006 Posts: 30 Location: Arizona, USA
|
Posted: Thu Jun 15, 2006 5:04 pm Post subject: |
|
|
Regarding the swappiness setting, I have played with that, and it does help, I've been running with it set at 15 and it certainly uses less swap and more real ram.
About changing the swap size, this wasn't from an artical, it was a first hand suggestion. I guess the reasoning behind it is that from the perspective of an application your ram is swap+ram, so apps that allocate a certain amount of memory for themselves based on how much ram you have would take up less ram with a smaller swap. I dunno if it was actually true, I just wanted to test it out. I did notice that booting with no swap did use less ram for just booting up, before starting X than when swap was on.
The mkswap was the trick Now it is OK, but you guys are right, I do need to figure out how to add the extra space either back to /dev/hda3, or to /dev/hda4 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Paapaa l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/7560954014609741ea1af8.png)
Joined: 14 Aug 2005 Posts: 955 Location: Finland
|
Posted: Thu Jun 15, 2006 5:48 pm Post subject: |
|
|
halak79 wrote: | Regarding the swappiness setting, I have played with that, and it does help, I've been running with it set at 15 and it certainly uses less swap and more real ram. |
That is not necessarily a good thing. Swap will also be used when OS thinks that some things in RAM are not needed there and the amount should be used as disk cache. In that case more swap will be used but your computer will be more responsive. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
halak79 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 01 Mar 2006 Posts: 30 Location: Arizona, USA
|
Posted: Thu Jun 15, 2006 5:49 pm Post subject: |
|
|
Just as a side note, I was pretty impressed with how linux handeled having no swap. I thought I would kind of push it and see what happened when I tried to run several programs. I ran firefox with a few tabs open and browsing these forums and gmail and stuff, and plus I had aterm running top and that used up all my ram besides a couple k, then I popped in an audio CD and played it in XMMS, and the ram usage didn't change, then I opened up Inkscape and started working on an illustration and everything continued to work. but Inkscape was noticably slower without the swap space. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Maedhros Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/8825449514782674ca8d88.gif)
Joined: 14 Apr 2004 Posts: 5511 Location: Durham, UK
|
Posted: Thu Jun 15, 2006 6:10 pm Post subject: |
|
|
Moved from Installing Gentoo to Kernel & Hardware. _________________ No-one's more important than the earthworm. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|