View Full Version : Swap partition?
mediabob
Jun 8th 2006, 09:56 PM
Ok I have the dvd of kubuntu 6.06 and I plan on installing it. I started to read the guide that was posted, so that I do not make any mistakes. I was wondering if u actually need another partition for the swap data thing. I already have 4 partitions; first one is the main XP, 2nd and 3rd are logical drives with random stuff, and I have a 4th 20 gb partition. The 20gb partition is where I plan on installing kubuntu. So, my question is if I need to resize my 20 gb partition to make a partition for swap data. Also, in the guide i saw there was /root partition and a /home partition. Is there a difference? Do I need to resize and make new partitions for these?
thanks a bunch, I'm new to linux but my friend said kubuntu is good for beginning, thanks again
OuchOfDeath
Jun 8th 2006, 10:43 PM
Yes you need an extra partition for swap files, i'd recommend about 1.5 to 2 times the size of your memory. The /home is like your My Documents, it's where all your personal files and settings go, you don't need a separate partition for it, that's just optional. :)
mediabob
Jun 8th 2006, 11:41 PM
so the /root and /home can be on the same partition right?
Paulo
Jun 9th 2006, 12:07 AM
No! You don't need any partition for swap.
Depending on the memory available you have and on your needs for memory you may not need a swap at all.
If you really want a swap you may use a swap file.
I lived with a swap file for long time until I tried "suspend2".
"suspend2" needed a swap partition but I think it is not needed anymore. I'm now using a partition because it is too hard repartitioning my disks and I have lots of space available.
So:
1. Tell me how much RAM you have.
2. What do you expect to do with your PC.
3. If you need swap, you can create 1 or more swap files at any moment without rebooting your computer - just on fly.
And also get rid of them at any moment.
Except for security reasons, you may even create them on FAT vols.
Sorry but is too late to go into further details. If you are interested, post here and during the next weekend I'll post here the details.
Regards.
mediabob
Jun 9th 2006, 01:26 AM
ok i have 1 GB of RAM, and i plan on using it for entertainment purposes. So like editing and burning videos, video games, general home usage.
kubicle
Jun 9th 2006, 05:07 AM
1Gb is quite enough for most tasks, so you probably won't need swap very often (only for very memory intensive tasks)...so you might be able to do without a swap partition (possibly with only swap files as suggested)...swap files are usually a bit slower than a dedicated swap partition (or partitions), but it's often not a major issue on modern computers.
Also, /home can be in the same partition as / (the default installer actually sets it up like that), but many people still put them on separate partitions as having /home on a different partition makes it a lot easier to keep your personal data and settings intact in case of a reinstallation (you don't have to backup your home on a separate media).
So you can put everything on that 20 Gb partition, but if you haven't already formatted it to a linux filesystem (ext3, for example)...you still need to edit it a bit during installation...so it might be worth it to slice it (it's a simple process which you can do with the installer)...but in the end it's your machine...your call :)
Paulo
Jun 9th 2006, 09:57 AM
Ok. Let's see ...
1Gb RAM is more than enough for current use (photos editing included) except for video stuff. I know nothing about video editing, so I have no idea about how much memory it uses.
Being a very good OS, Linux kernel uses all RAM it can to speed up things. It also avoids swapping. This is good too. Swap is generally used to put idle tasks as much as I could see.
So, suppose you have lots of open pages in your browser or an instance of open office with a few spreadsheets. Then you start a intensive memory application - a video editor for ex.. The kernel will swap out the other applications to make room for the new one.
To tune your swap memory needs, you can monitor it using for ex. "top". Just type top on any console. Exit with q. There are other tools. KDE has one. I prefer top. Take a look at the swapped memory. Pls. notice that once swapped, the kernel also avoids bringing back to RAM the swapped stuff. So, monitor frequently trying to understand what is happenning.
While writing this, a problem came up to my mind. I am not sure if kubuntu installer let you proceed without a SWAP partition. If not, it is one thing developpers should mofify.
In this event, you may slice your 20Gb partition leaving no more than 1 Gb for SWAP. It is very unlikely you need more than this. However, if you later feel it is insuficient you can add a swap file or better increase your RAM.
Allowed or not to skip the SWAP partition creation, let's see how you can create 1 or more swap files.
1. Choose any directory and file name for your SWAP file. See if you have enough space (command df may help). Although you may use a FAT partition, it is not a good choice for security reasons. You may use your 20Gb partition.
Let's call it /SWAP1. i.e. filename=SWAP and put it on the root of your system
2. Launch a console (kde -> system -> konsole or something ...) or just jump to a really console CTRL+ALT+F1 or F2 or ...
3. Enter as root - in kubunto do
sudo bash
then enter your password.
FROM NOW ON BE CAREFUL. YOU CAN DO EVERYTHING INCLUDING REMOVE ALL FILES FROM YOUR SYSTEM :-)
4. Create the swap file. For 512Mb do for ex.
dd if=/dev/zero of=/SWAP1 bs=1M count=512
5. Protect it
chmod 600 /SWAP1
6. Format it as swap
mkswap /SWAP1
7. Activate it
swapon /SWAP1
8. Exit from root privileges
exit or logout or CTRL+D
That's it ...
Other things you can do
1. Deactivate it
swapoff /SWAP1
This can take some time if you have many things swapped. Only do this if you are sure you have droped your memory consuption applications. If not, your system may freeze. May be these days it only refuses to swapoff.
2. If you want to have this swap file activated when booting your system put the following line in the /etc/fstab file (use your favourite text editor - kate, nano, ...):
/SWAP1 none swap pri=1
This also allows you to activate/deactivate all your swap files and partitions with
swapon -a and swapoff -a
You must be root to do this.
Hope this helps.
Regards
mediabob
Jun 9th 2006, 11:18 PM
if you upgrade kubuntu ever will the data on the partition be erased?
Paulo
Jun 10th 2006, 01:14 AM
No if you are carefull enough when answering installer questions. You may be asked for a partition reformat.
Anyway, you make backups don't you?!
Unless you create other special dirs, everything of each user go to /home/<username>. Just backup your /home dir before any deep change, upgrade included.
mediabob
Jun 10th 2006, 02:07 AM
ok i gather i should create different /root and /home partitions. My only concern is i might make one too small. Im an avid gamer, I need lots of room to transfer up to 8 gb videos and such, and i dont know how big those 2 partitions should be. Can you help me out with this too?
thanks again
Paulo
Jun 10th 2006, 05:47 AM
You haven't!
The only advantage to have them in different partitions is if you need to reformat the whole partition. But because you must have backups - always, this does not seem necessary. When you become comfortably with linux, you may give LVM a try. You may "give" to LVM the space you want for it to manage, of one or more physical volumes (partitions for ex.), and then you may create logical volumes of any size you need and later enlarge or shrink them on fly (if you choose reiserfs - I don't know if ext3 is shrinkable on fly).
Now, go with 1Gb for a swap and the rest for the system and user stuff.
Slicing the 20Gb between /home and / is wasting space.
This is my opinion. You may choose the way you want.
askrieger
Jun 10th 2006, 05:58 AM
My advice is DON'T make separate '/' and /home partitions. When people who are not experienced Linux users do this they almost always get it wrong, because they don't know how their habits will affect the amount of space they will need on each partition. I've seen several people who came up with elaborate partition schemes. Only one of them actually knew what he was talking about, and it wasn't me. Where are you going to store all those 8GB videos? Under /home/mediabob/, or maybe under /opt/? How about /usr/local/? How often are you going to clean out /var?
I assume you've figured out that I'm deliberately trying to snow you. I hope you've further figured out that the reason I'm doing so is to try to make you realize that partitioning is easy to screw up. That's why I advise new users to make only one partition and make it big enough to hold everything. A normal Kubuntu installation fits easily into 10 or 15 GB. So add 2xyour best estimate of the amount of video you'll be storing to 15 GB and make one partition of that size.
mediabob
Jun 10th 2006, 04:11 PM
so let me get this straight. 1 partition for swap and another partition for everything else, right?
you guys have been really helpful
kubicle
Jun 12th 2006, 06:14 AM
so let me get this straight. 1 partition for swap and another partition for everything else, right?
That should work just fine :)
In a relatively small space (like your 20Gb) the benefits of putting everything on one partition (like no wasted space) usually outweigh the benefits you might (or might not) get from a more advanced partition scheme (especially on desktop use)
Though in your case 20Gb might just not be enough if you need to have many 8Gb videos on your system at all times ;)
aysiu
Jun 12th 2006, 07:14 AM
If you have only 20 GB for Kubuntu, I agree with askrieger that you shouldn't create a separate /home partition.
And with 1 GB of RAM, you'd never use any swap partition you create. Unfortunately, I think the Ubuntu installer forces you to create a swap partition. Correct me if I'm wrong.
If you're forced to create one, just create one that's 2 MB or something. If not, just don't create one.
If, later on, you find you do want to create a separate /home partition, you can follow these instructions:
http://www.psychocats.net/ubuntu/separatehome.html
I used to have a separate home, but I kind of like having fresh settings with a reinstall. I do have a separate documents partition, though.
kubicle
Jun 12th 2006, 09:51 AM
And with 1 GB of RAM, you'd never use any swap partition you create.
That isn't true on all occasions, there are cases where swap is used even with 1Gb of RAM, though that is relatively rare and even then you probably won't need 1Gb of Swap space...so you might be better off with creating swap-files if needed (if disk space is a major issue).
However, creating an (oversized?) swap-partition is a 'care-free' solution...you don't have to worry about running out of memory in the middle of an intense video editing session :P...and you don't have to manage your swap files. (which can be automatized of course)
1Gb of ram is certainly enough for 'regular' use, though I still consider swap-space as insurance, well worth of the disk space taken (which is cheap). You could try without a swap partition (and using swap-files as needed)...and if (read:when) you need a new disk for your videos and documents you could make a decent-sized swap partition on your new disk.
IndyTim
Jun 12th 2006, 04:26 PM
I just went through an install last night and yes, Kubuntu does force a swap install if you're setting up a specific destintation for your Kubuntu. If you're doing a clean-sweep install, you should not have to be concerned about it.
IndyTim
mediabob
Jun 12th 2006, 07:06 PM
ok i like to get all my worries out and answered before I install anything major on my computer, even though this is off-topic it would be a waste to create a new thread. Since I have XP and plan on installing kubuntu, does XP have a boot menu to let me dual-boot or does kubuntu install a boot-manager like grub? If it installs grub how do you uninstall? I want to know how to uninstall grub so that if I ever remove kubuntu I won't be stuck with a boot manager.
And again a big thanks
askrieger
Jun 12th 2006, 11:35 PM
You can uninstall Grub with the M$ program that "repairs" the MBR. I believe it's "fdisk /fixmbr" from the "run command" thingie on the menu, but I'm probably wrong. ;D
jdawiz
Jun 14th 2006, 02:40 PM
Sorry but I had to put my two cents. I recommend saving 5 gig or so and not partition it to anything. So swap will be 2mb / (root) will be 15gb - 2mb and 5 gb non partitioned for a 20 gb drive. Why would I do this? Well because it is sometimes easier to extend a partition then to shrink and add a partition. So, if down the road I needed/wanted to add a doc partition then wow I have a 5gb non partition available to use. If I need to extend root because I am running out of space then I can allocate all or some of the 5gb. I always like to leave some of my space unallocated if I can. That is, unless I have unlimited access to hard drives.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.