[opensuse] Creating a 4 GB swap partition
Hello, Recently installed opensuse but made a mistake while installation. I've installed without any swap partition. So the system is sluggish. Went to google and found out this command will create a 512 MB file and use it as a swap: dd if=/dev/zero of=/swapfile bs=1k count=524288 && mkswap /swapfile && sync && swapon /swapfile Question is, As My ram is 2 GB I need a swap partition of at least 4 GB (It is stated on that site). What'll be the necessary changes to turn that 512 MB into 4GB file? I know it's not about ubuntu, but this command is not distro based, it's general Linux command. Can anybody help me out? -- I am me, I wanna be me. Like me or not, this is the way I am- Junayeed Ahnaf Nirjhor Linux Mint Bangladesh Facebook- http://www.facebook.com/nirjhor Twitter - http://www.twitter.com/nirjhor Myspace- http://www.myspace.com/nirjhor1992 Blog - http://nirjhor.wordpress.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sat, 2010-07-17 at 20:57 +0600, Junayeed Ahnaf Nirjhor wrote:
Hello, Recently installed opensuse but made a mistake while installation. I've installed without any swap partition. So the system is sluggish. Went to google and found out this command will create a 512 MB file and use it as a swap: dd if=/dev/zero of=/swapfile bs=1k count=524288 && mkswap /swapfile && sync && swapon /swapfile Question is, As My ram is 2 GB I need a swap partition of at least 4 GB (It is stated on that site). What'll be the necessary changes to turn that 512 MB into 4GB file? I know it's not about ubuntu, but this command is not distro based, it's general Linux command.
Correct; all this labeling articles "How the files in a directory on Ubuntu" has risen to a level of absurdity.
Can anybody help me out?
swapoff /swapfile
dd if=/dev/zero of=/swapfile bs=1k count=4194304 && mkswap /swapfile &&
sync && swapon /swapfile
Of course how much swap you actually need is a topic of much [mostly
pointless] debate. Just make "a lot" and don't worry about it. But for
the record - the RAM x 2 rule doesn't really have much 'science' behind
it. But it isn't a bad idea either.
--
Adam Tauno Williams
On Saturday 17 July 2010 10:10:11 Adam Tauno Williams wrote:
Of course how much swap you actually need is a topic of much [mostly pointless] debate.
There is one fact that is not matter of opinion. When you want to hibernate system (suspend to disk) then your swap will be the place to store status, so its size must accommodate all status info. I don't know how hibernate works, so as a precaution swap size is 1.5 times size of RAM. It works fine by now :) -- Regards, Rajko -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Adam Tauno Williams wrote:
On Sat, 2010-07-17 at 20:57 +0600, Junayeed Ahnaf Nirjhor wrote:
Hello, Recently installed opensuse but made a mistake while installation. I've installed without any swap partition. So the system is sluggish.
As others have said, the system may be sluggish for some other reason.
Can anybody help me out?
swapoff /swapfile
dd if=/dev/zero of=/swapfile bs=1k count=4194304 && mkswap /swapfile && sync && swapon /swapfile
Personally I run all the commands on separate lines so I can check the results but perhaps I'm just paranoid. Also, dd will run faster with a bigger block size. i.e. if you multiply bs by some number and divide count by the same number. But doing the sums is a bit harder then :(
Of course how much swap you actually need is a topic of much [mostly pointless] debate. Just make "a lot" and don't worry about it. But for the record - the RAM x 2 rule doesn't really have much 'science' behind it. But it isn't a bad idea either.
+1 Cheers, Dave -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2010-07-17 16:57, Junayeed Ahnaf Nirjhor wrote:
Hello,
Recently installed opensuse but made a mistake while installation. I've installed without any swap partition. So the system is sluggish.
I understand you have 2 GB of ram, so you do not _need_ swap, nor will be your system slow because of that. If you feel your system is slow, investigate the reasons.
Went to google and found out this command will create a 512 MB file and use it as a swap:
dd if=/dev/zero of=/swapfile bs=1k count=524288 && mkswap /swapfile && sync && swapon /swapfile
Question is, As My ram is 2 GB I need a swap partition of at least 4 GB (It is stated on that site). What'll be the necessary changes to turn that 512 MB into 4GB file?
You not _need_ any swap at all. Plus the 2X rule is for Windows (3.x), not Linux. - -- Cheers / Saludos, Carlos E. R. (from 11.2 x86_64 "Emerald" GM (Elessar)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAkxCB5MACgkQU92UU+smfQXlPgCfVDr8Jh80brBZB9g0SFqZIKmx 5/kAniImbLfNnZM97Ks8NSWimstSrej0 =fkAs -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
dd if=/dev/zero of=/swapfile bs=1k count=524288 && mkswap /swapfile && sync && swapon /swapfile Question is, As My ram is 2 GB I need a swap partition of at least 4 GB (It is stated on that site). What'll be the necessary changes to turn that 512 MB into 4GB file?
You not _need_ any swap at all.
You have no way of saying that. I have 8GB machines that swap regularly. It depends upon the applications and the work load.
Plus the 2X rule is for Windows (3.x), not Linux.
It was often repeated in the context of UNIX admin articles and
training.
--
Adam Tauno Williams
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2010-07-18 01:38, Adam Tauno Williams wrote:
dd if=/dev/zero of=/swapfile bs=1k count=524288 && mkswap /swapfile && sync && swapon /swapfile Question is, As My ram is 2 GB I need a swap partition of at least 4 GB (It is stated on that site). What'll be the necessary changes to turn that 512 MB into 4GB file?
You not _need_ any swap at all.
You have no way of saying that. I have 8GB machines that swap regularly. It depends upon the applications and the work load.
Me too :-) But, if he really needed swap, he would be reporting about applications dying (the kernel making space), not about slowness. I don't think he needs swap, not for the reason he gave, at least. Yes, he should have swap space. But for the right reasons.
Plus the 2X rule is for Windows (3.x), not Linux.
It was often repeated in the context of UNIX admin articles and training.
Yes, but with no real support for saying so, for linux at least. Dunno about unix. - -- Cheers / Saludos, Carlos E. R. (from 11.2 x86_64 "Emerald" GM (Elessar)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAkxCaasACgkQU92UU+smfQWkTACcDwUv3SwawaUZr638EC7bWho6 yqAAnRhlBFuO6OCoTeqZbRi6a8m9NHbY =gtjL -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Carlos E. R. wrote:
Plus the 2X rule is for Windows (3.x), not Linux.
It was often repeated in the context of UNIX admin articles and training.
Yes, but with no real support for saying so, for linux at least. Dunno about unix.
It's general issue on any system with virtual storage and how much swap space you need depends entirely on your workload. The problem in return is that most people do not know the workload, so in the early days when systems only rarely had more than 1Gb of memory, any everyday distro would expect to set up swap-space. How much? Uh well ... hence "twice your amount of memory". To accurate estimate amount of swap-space needed, you'll always need to know the workload, but with disk-space being as cheap as it is, who really cares? I have some mailservers where I always (the number grows regularly) allocate 16Gb for the system and 16Gb for swap. -- Per Jessen, Zürich (23.8°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2010-07-18 16:16, Per Jessen wrote:
Carlos E. R. wrote:
Plus the 2X rule is for Windows (3.x), not Linux.
It was often repeated in the context of UNIX admin articles and training.
Yes, but with no real support for saying so, for linux at least. Dunno about unix.
It's general issue on any system with virtual storage and how much swap space you need depends entirely on your workload. The problem in return is that most people do not know the workload, so in the early days when systems only rarely had more than 1Gb of memory, any everyday distro would expect to set up swap-space. How much? Uh well ... hence "twice your amount of memory". To accurate estimate amount of swap-space needed, you'll always need to know the workload, but with disk-space being as cheap as it is, who really cares? I have some mailservers where I always (the number grows regularly) allocate 16Gb for the system and 16Gb for swap.
The first time I saw that number was when Windows appeared, version 3.0 IIRC. At the time it was common to have 2 MiB of memory, or thereabouts (MsDos could not make use of more than 1 MiB (tricks aside), so there was no reason to have more and it was expensive). Windows swap file had a limit of twice the ram... so the advice, when setting it manually, was to create a swap file (that was not the name) of as much as possible, which was double the ram. With only 2 o 4 MiB of ram it made a lot of sense to have as much swap as the system would allow. In Linux, there is no such limit, we can add as much as we like. Then we need to know how much we really need... which is difficult to predict, it depends on the workload or what applications we run. If you use hibernation, then the figure is same as ram. - -- Cheers / Saludos, Carlos E. R. (from 11.2 x86_64 "Emerald" GM (Elessar)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAkxDF4MACgkQU92UU+smfQWHqgCfW1V9rgwrbeyOfbaWxwMwEScT rbQAoI/628oohimvohFN+OeHKhsBWSF2 =PdjA -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Am 18.07.2010 16:16, schrieb Per Jessen:
Carlos E. R. wrote:
Plus the 2X rule is for Windows (3.x), not Linux.
It was often repeated in the context of UNIX admin articles and training.
Yes, but with no real support for saying so, for linux at least. Dunno about unix.
It's general issue on any system with virtual storage and how much swap space you need depends entirely on your workload. The problem in return is that most people do not know the workload, so in the early days when systems only rarely had more than 1Gb of memory, any everyday distro would expect to set up swap-space. How much? Uh well ... hence "twice your amount of memory". To accurate estimate amount of swap-space needed, you'll always need to know the workload, but with disk-space being as cheap as it is, who really cares? I have some mailservers where I always (the number grows regularly) allocate 16Gb for the system and 16Gb for swap.
I care for my desktop/notebook, for one drawbak: system gets really slow if it is swapping to much. Nowadays I use only half of RAM siz for SWAP on desktop type systems and a little bit more than RAM size on laptop for suspend. -- Harald Müller-Ney, Project Manager Maintenance Coordination SUSE LINUX Products GmbH, Maxfeldstrasse 5, D-90409 Nürnberg Phone: +49 (0) 911 74053130 Mobile: +49 (0) 179 2287009 Fax: +49 (0) 911 74053575 eMail: hmuelle@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 18.07.2010, Harald Mueller-Ney wrote:
I care for my desktop/notebook, for one drawbak: system gets really slow if it is swapping to much.
This is not neccessarily a swap issue. If commiting data to disc gets slowing down/partially blocking your system, you can set vm.dirty_ratio = 10 vm.dirty_background_ratio = 5 in your sysctl.conf. This will reduce the time pdflush needs to commit cache dirty data to disc, because it's done more frequently, thus resulting in shorter commit time. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2010-07-18 17:43, Harald Mueller-Ney wrote:
I care for my desktop/notebook, for one drawbak: system gets really slow if it is swapping to much. Nowadays I use only half of RAM siz for SWAP on desktop type systems and a little bit more than RAM size on laptop for suspend.
If your system needs swap, it will swap the same regardless if you have 512MiB or 512 GiB swap space available. Nor will it run faster if you remove all swap - rather the contrary. The system runs faster if it doesn't _need_ swap, not if it doesn't have swap space. - -- Cheers / Saludos, Carlos E. R. (from 11.2 x86_64 "Emerald" GM (Elessar)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAkxDTHIACgkQU92UU+smfQWkDwCfcyTX7kNPukFW3USVB7KRTfAT hBkAn2/UFaUCfhrfXPXPAtYGX+xO5tmR =RGY6 -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 2010-07-18 at 20:48 +0200, Carlos E. R. wrote:
If your system needs swap, it will swap the same regardless if you have 512MiB or 512 GiB swap space available. Nor will it run faster if you remove all swap - rather the contrary.
The system runs faster if it doesn't _need_ swap, not if it doesn't have swap space.
Well said. If your system doesn't have (enough) swapspace, OOM will start shooting off processes, and your system will be rather slugish, i presume. otoh, how can you be absolutely sure that your system won't _need_ any swap? (besides starting up the system and watch it closely?) There are a number of cases on would like to avoid swapping at all costs. For instance when running from self-made dvd, or from SDD, where swapping would means additional whereout of the sdd. hw -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Am 18.07.2010 20:48, schrieb Carlos E. R.:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 2010-07-18 17:43, Harald Mueller-Ney wrote:
I care for my desktop/notebook, for one drawbak: system gets really slow if it is swapping to much. Nowadays I use only half of RAM siz for SWAP on desktop type systems and a little bit more than RAM size on laptop for suspend.
If your system needs swap, it will swap the same regardless if you have 512MiB or 512 GiB swap space available. Nor will it run faster if you remove all swap - rather the contrary.
The system runs faster if it doesn't _need_ swap, not if it doesn't have swap space.
The culprit for me is to avoid swapping at all - it is been a implicit assumption. I have a little bit of swap to get some really rarely needed stuff out of RAM in case of memory congestion. It is my personal way, as mentioned earlier in this thread is a lot about workload. Like in case of a laptop (or suspend/resume at all) you will need a bit more swap. -- Harald Müller-Ney, Project Manager Maintenance Coordination SUSE LINUX Products GmbH, Maxfeldstrasse 5, D-90409 Nürnberg Phone: +49 (0) 911 74053130 Mobile: +49 (0) 179 2287009 Fax: +49 (0) 911 74053575 eMail: hmuelle@novell.com SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 18.07.2010, Adam Tauno Williams wrote:
I have 8GB machines that swap regularly. It depends upon the applications and the work load.
I'd like to second that. On my machines, I always have enough swap and they are all running with vm.swappiness = 100. I do not want big (blown?) applications to poison the memory/cache all the time when not in use over some time. (In idle state:) htd@liesel:~> free -m total used free shared buffers cached Mem: 7933 7267 666 00 6994 -/+ buffers/cache: 272 7660 Swap: 8187 0 8187 If you want to have working suspend, you have to have enough swap to store the image, at least slightly more than your amount of memory. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
awilliam@whitemice.org :
dd if=/dev/zero of=/swapfile bs=1k count=524288 && mkswap /swapfile && sync && swapon /swapfile Question is, As My ram is 2 GB I need a swap partition of at least 4 GB (It is stated on that site). What'll be the necessary changes to turn that 512 MB into 4GB file?
You not _need_ any swap at all.
You have no way of saying that. I have 8GB machines that swap regularly. It depends upon the applications and the work load.
Man, 4G swapfile on a 5400/7200 rpm HDD will also slow his system down. -- Architecte Informatique chez Blueline/Gulfsat: Administration Systeme, Recherche & Developpement +261 34 56 000 19 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2010-07-19 14:15, Mihamina Rakotomandimby wrote:
awilliam@whitemice.org :
dd if=/dev/zero of=/swapfile bs=1k count=524288 && mkswap /swapfile && sync && swapon /swapfile Question is, As My ram is 2 GB I need a swap partition of at least 4 GB (It is stated on that site). What'll be the necessary changes to turn that 512 MB into 4GB file?
You not _need_ any swap at all.
You have no way of saying that. I have 8GB machines that swap regularly. It depends upon the applications and the work load.
Man, 4G swapfile on a 5400/7200 rpm HDD will also slow his system down.
Only if it is used, and then only while it is been used. And if it needs to be used and you don't have it, you are in deep trouble. - -- Cheers / Saludos, Carlos E. R. (from 11.2 x86_64 "Emerald" GM (Elessar)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iEYEARECAAYFAkxEsocACgkQU92UU+smfQUQjgCfadbQFla6Re+0VrNlSOxWZTI1 UZkAniegFGfPI8aU0NiPU8DDa6zMeB7U =bBxv -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sat, 17 Jul 2010 21:42:11 +0200, "Carlos E. R."
You not _need_ any swap at all.
Not quite right. If you want to use suspend to disk, you definitely need swap.
Plus the 2X rule is for Windows (3.x), not Linux.
No, it's also for Unix systems but stems from a time when 512 MiB were an astronomical amount of memory. Philipp -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 2010-07-20 11:24, Philipp Thomas wrote:
On Sat, 17 Jul 2010 21:42:11 +0200, "Carlos E. R."
wrote: You not _need_ any swap at all.
Not quite right. If you want to use suspend to disk, you definitely need swap.
I know, but that is not the case. :-) I don't think it is possible to suspend with a swap file, which was what the OP contemplated. He mentioned the system was slow, so he wanted to add swap. For the reasons he posted, he did not need swap, with emphasis on "need". For other reasons, he may need or benefit, yes.
Plus the 2X rule is for Windows (3.x), not Linux.
No, it's also for Unix systems but stems from a time when 512 MiB were an astronomical amount of memory.
I first saw the rule applied to Windows when 4 MiB was astronomical, and Windows maximum swap was double the ram. So the rule was "double" because that was the maximum you could define, and more was really needed. - -- Cheers / Saludos, Carlos E. R. (from 11.2 x86_64 "Emerald" GM (Minas Tirith)) -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.12 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org/ iF4EAREIAAYFAkxGofkACgkQja8UbcUWM1wO1wD+LzWDzxEd+OGgROkJWqUhC17D 0Cx1z6xJX3O0TPc1YDgBAIXMaj1U0tXEbRRq+QJVBWruPbOZYqZtEnBBthtYLtLQ =1COp -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sat, 2010-07-17 at 20:57 +0600, Junayeed Ahnaf Nirjhor wrote:
Hello,
Recently installed opensuse but made a mistake while installation. I've installed without any swap partition. So the system is sluggish. Went to google and found out this command will create a 512 MB file and use it as a swap:
dd if=/dev/zero of=/swapfile bs=1k count=524288 && mkswap /swapfile && sync && swapon /swapfile
Question is, As My ram is 2 GB I need a swap partition of at least 4 GB (It is stated on that site). What'll be the necessary changes to turn that 512 MB into 4GB file?
In the very early days of SUNos, when Linus was still a schoolboy, the people from sun-microsystems advised to use a swap area about twice the amount of mem. (atleast, that was in my trainings stuff from then) On of the reasons was, that they used this area also after a crache, as an area to write the coredump into. Since those day one might state that some progress has been made in the area of computer development. So unless you still are using SUNos 2.x you might want to reconsider the amount of swap. Swap is something of a last resort, if you are overcommiting the system or you are running a program for a long time with a memory leak. Consider it something like the safety lane on the highway. (it should be there, but it size doesn't reflect the size of the road) Whatever the amount of mem in your system, if you define a swap area with 1GB or 2GB you should have enough. If your systems runs out of mem AND you don't have swap, the Out-Of-Memory feature will shoot down processes you would rather still have keep on running. With some swap, you will be able to shoot of the offender yourself. (and dash off to by some extra mem) I have some servers with 64GB of mem, you don't seriously think i would sacrefice 128GB of diskspace for swap ???? hw -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday 17 July 2010 22:31:56 Hans Witvliet wrote:
Whatever the amount of mem in your system, if you define a swap area with 1GB or 2GB you should have enough.
Unless you want to suspend to disk, in which case it would be a good idea to have swap == RAM, since on suspend, the system image gets written to swap. Some parts may get compressed, but you can't really rely on that. Also, untim kdump came along, lkcd wrote its crash images to the swap partition, so on a slightly older system (or a newer one where you've chosen to use lkcd), again, having swap == RAM is a good idea Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Junayeed Ahnaf Nirjhor wrote:
Hello,
Recently installed opensuse but made a mistake while installation. I've installed without any swap partition. So the system is sluggish. Went to google and found out this command will create a 512 MB file and use it as a swap:
dd if=/dev/zero of=/swapfile bs=1k count=524288 && mkswap /swapfile && sync && swapon /swapfile
Question is, As My ram is 2 GB I need a swap partition of at least 4 GB (It is stated on that site). What'll be the necessary changes to turn that 512 MB into 4GB file?
I know it's not about ubuntu, but this command is not distro based, it's general Linux command.
Can anybody help me out?
That 2x ram swap size idea has been obsolete for many years. It's entirely possible to run Linux without any swap at all. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Junayeed Ahnaf Nirjhor wrote:
Hello,
Recently installed opensuse but made a mistake while installation. I've installed without any swap partition. So the system is sluggish. Went to google and found out this command will create a 512 MB file and use it as a swap:
dd if=/dev/zero of=/swapfile bs=1k count=524288 && mkswap /swapfile && sync && swapon /swapfile
Question is, As My ram is 2 GB I need a swap partition of at least 4 GB (It is stated on that site). What'll be the necessary changes to turn that 512 MB into 4GB file?
I know it's not about ubuntu, but this command is not distro based, it's general Linux command.
Can anybody help me out?
512MB should be more than enough, 256MB, might be more than enough... I find it's good to have SOME swap, since any system can use up RAM with filecache, so it's good to have a SOME swap, so any programs that you run at startup but that *generally* just sit around in memory -- NOT even twiddling their bits (i.e. they are idle, so they never get swapped in). can be swapped out. They are still ready to be swapped in -- so they and or your system is 'happy' with the 'whatifs', but after some large memory even I'll see maybe a few SCORE of pages 'resident' in swap, that will just sit there until I reboot. So something or some programs just get swapped out -- and never ask to be swapped in again. Might as well let them so you can put your active memory to better use for other things...like file buffers...etc... -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (15)
-
Adam Tauno Williams
-
Anders Johansson
-
Carlos E. R.
-
Dave Howorth
-
Hans Witvliet
-
Harald Mueller-Ney
-
Harald Müller-Ney
-
Heinz Diehl
-
James Knott
-
Junayeed Ahnaf Nirjhor
-
Linda Walsh
-
Mihamina Rakotomandimby
-
Per Jessen
-
Philipp Thomas
-
Rajko M.