LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-17-2003, 09:38 PM   #1
jbeedham
Member
 
Registered: May 2003
Location: Las Vegas, NV
Posts: 57

Rep: Reputation: 15
Can I install linux without a swap partition?


Ok, I got 2 partitions on my hard drive dedicated to my Mandrake 9.0. I wanted to upgrade to 9.1 and was curious if I could get rid of the swap partition so I could dedicate more space to my files.
 
Old 08-17-2003, 09:41 PM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
Short answer, No. Its also a very bad Idea.

But you can reduce it in size. try half your RAM. It shouldn't be much bigger anyway.

Last edited by leonscape; 08-17-2003 at 09:47 PM.
 
Old 08-17-2003, 09:43 PM   #3
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
well i would recommend at least leaving a small swap size....maybe just reduce it to 64megs or so...
 
Old 08-17-2003, 10:01 PM   #4
2damncommon
Senior Member
 
Registered: Feb 2003
Location: Calif, USA
Distribution: PCLINUXOS
Posts: 2,918

Rep: Reputation: 103Reputation: 103
You can set up a swap file instead. It will be slower.

dd if=/dev/zero of=/swap bs=1024 count=65664
to create a file called swap that is about 64MB.

mkswap /swap 65664
swapon /swap
to activate it.
 
Old 08-17-2003, 10:04 PM   #5
jbeedham
Member
 
Registered: May 2003
Location: Las Vegas, NV
Posts: 57

Original Poster
Rep: Reputation: 15
I think I will just tinker with the size of it instead of getting rid of it completely. I think I got 500 megs dedicated to it know so if I drop it down to like 128 or 64 that will save me a lot of space.
 
Old 08-17-2003, 11:42 PM   #6
blaisepascal
LQ Newbie
 
Registered: Jun 2002
Distribution: Red Hat Linux 9
Posts: 27

Rep: Reputation: 16
Quote:
Originally posted by leonscape
Short answer, No. Its also a very bad Idea.
Does Mandrake require a swap on installation/upgrade, just out of curiosity? When I installed RedHat 9 without a swap partition, I got a warning box. I quickly clicked the wrong button (I was going to correct the partitions but didn't, so no swap), but the install proceeded normally. In fact, everything's seems to be working; now, whether the system is slower or faster with no swap partition or swap file, I don't know.


BP

0012

Last edited by blaisepascal; 08-18-2003 at 12:03 AM.
 
Old 08-17-2003, 11:55 PM   #7
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
You can get away with no swap and use a file, but its just not worth the effort.

Its one of the reasons I hate windows is the horrible page file. Page files are a lot slower than a partition.

A dedicated swap doesn't mess with your files, and you can put on the outside of your disk to make it even faster.

You always need some sort of swap (just in case you run out of memory) file or partition. Partition is a good solution (the best at the moment).
 
Old 08-18-2003, 12:15 AM   #8
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
In the days of yore, you needed swap because disk storage was cheaper than physical memory (still is, but both are far cheaper - physical memory is a hell of a lot cheaper now than disk storage was then). Now, some programs may expect it, possibly, and malfunction without it but that would be bizarre. Nothing should really *need* swap unless you run *out* of physical memory. If you've got 512 MB and constantly run at 300 MB usage, you don't need it. On the other hand, if you get a surge, like you're compiling a kernel and downloading an iso and watching a DVD and 20 other things and one of those apps goes a little haywire and spikes it when your running near the edge, you're going to wish you had some swap as a safety buffer. Or if you have gigs of memory, I can't conceive *ever* needing swap. Whereas if you're trying to run X on 16 MB, you've pretty much *got* to have swap. It all depends on your hardware and your usage. I think it's a good idea to have some just so that if you ever notice you're using it (beyond the few megs Linux sometimes decides to take advantage of in advance) it gives you a clear sign to cut back. But I'm not surprised there are people like you, blaisepascal, running fine without it. And I don't believe you're running any slower.

All swap does is change 'running fast -> locking up' to 'running fast -> running slow -> locking up'. It's a safety buffer of slow running before locking.

Or so I theorize.
 
Old 07-26-2010, 04:50 AM   #9
ChristopherJ
LQ Newbie
 
Registered: Dec 2008
Location: Cairns, Queensland, Australia
Posts: 10

Rep: Reputation: 0
I have installed "GKRellM" so that I can see how much memory is in use. And out of the 2 Gb I am using about 1/4 and NO swap.

Will this be ok to preceed? I have Ubuntu installed on a 4 Gb USB drive.

Christopher

Last edited by ChristopherJ; 07-30-2010 at 03:21 PM. Reason: Spelling
 
Old 07-26-2010, 05:04 AM   #10
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
"If it works, it's OK."

Normally, with a large hard drive, there is NO reason not to have SWAP---With your 4GB USB (thumb drive, I assume), it's obviously different.

By the way, it is normally better not to exhume old threads like this---no problem in this case.
 
Old 07-26-2010, 04:04 PM   #11
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,980

Rep: Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624Reputation: 3624
Older systems needed swap files. Not sure one needs it on a home based system with newer hardware.
 
Old 11-14-2010, 06:56 PM   #12
beowulfnode
Member
 
Registered: Jun 2007
Distribution: debian, ubuntu, centos, esxi
Posts: 39

Rep: Reputation: 4
you do not want to put a swap drive on a flash memory device that is not an SSD HDD, as most of the USB memory sticks do not have decent wear leveling firmware built in (see http://en.wikipedia.org/wiki/Wear_leveling ).

For my test nas with zfs-fuse, system it has
- 1GB usb stick system drive
- 2GB ram
- ubuntu server 10.10 minimum install (no gui) + samba + zfs-fuse + ssh
In fact for added life on the usb stick, I'm going to be making a RAM disk for storing temporary info such as logs to minimise the number of write operations to the usb stick.

Edit: yes you can install with no swap space.
Some situations are better without swap, such as my case, and some are better with swap.

Last edited by beowulfnode; 11-15-2010 at 05:43 PM. Reason: Clarification
 
Old 11-14-2010, 10:25 PM   #13
theKbStockpiler
Member
 
Registered: Sep 2009
Location: Central New York
Distribution: RPM Distros,Mostly Mandrake Forks;Drake Tools/Utilities all the way!GO MAGEIA!!!
Posts: 986

Rep: Reputation: 53
Swap partition of One gig is plenty.

Unless you are gaming one gig of RAM should be plenty and up to one gig of swap is plenty. One gig is not much as far as hard drive space is concerned. If this small amount is critical maybe you can compress files or remove some. I messed up my swap space on a install once and had a swap partition of one kilobyte. I had two gigs of ram and it worked fine.
 
Old 11-14-2010, 10:59 PM   #14
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
The simple answer is that you need swap space if you need swap space and the only way to find out if you do is by monitoring whether it is used for which GKrellM is helpful (you can set it always on top of other windows) or you can run something like the free command in an infinite delayed loop writing to a log file. There have been some reports that systems run faster without swap ... but I don't recall any hard measurements to prove it.

EDIT: it all depends on the actual memory usage patterns so rules of thumb like "swap should be whatever times real memory" and "more than 4 GB of memory and you don't need swap" are useless.

Last edited by catkin; 11-14-2010 at 11:02 PM.
 
Old 11-15-2010, 07:21 AM   #15
hughetorrance
Member
 
Registered: Aug 2009
Location: London North West
Distribution: x86_64 Slack 13.37 current : +others
Posts: 459

Rep: Reputation: 59
Can I install linux without a swap partition? Yes !
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to pick the SWAP partition after install of FC4 Peanutman Fedora 9 10-27-2005 07:25 AM
Is it okay to alter swap partition with fdisk after FC4 install? Dimension User Fedora 6 09-19-2005 06:21 PM
install Linux without swap partition? leduytien Linux - Software 19 02-02-2005 01:21 PM
Activating swap partition early in install Septus Linux - Newbie 3 09-10-2003 10:54 PM
RH 7.2 install and swap partition hedstrom Linux - Software 2 12-31-2001 10:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:23 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