Announcement

Collapse
No announcement yet.

Swap partition?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Swap partition?

    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

    #2
    Re: Swap partition?

    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.

    Comment


      #3
      Re: Swap partition?

      so the /root and /home can be on the same partition right?

      Comment


        #4
        Re: Swap partition?

        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.

        Comment


          #5
          Re: Swap partition?

          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.

          Comment


            #6
            Re: Swap partition?

            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

            Comment


              #7
              Re: Swap partition?

              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

              Comment


                #8
                Re: Swap partition?

                if you upgrade kubuntu ever will the data on the partition be erased?

                Comment


                  #9
                  Re: Swap partition?

                  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.

                  Comment


                    #10
                    Re: Swap partition?

                    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

                    Comment


                      #11
                      Re: Swap partition?

                      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.

                      Comment


                        #12
                        Re: Swap partition?

                        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.

                        Comment


                          #13
                          Re: Swap partition?

                          so let me get this straight. 1 partition for swap and another partition for everything else, right?

                          you guys have been really helpful

                          Comment


                            #14
                            Re: Swap partition?

                            Originally posted by mediabob
                            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

                            Comment


                              #15
                              Re: Swap partition?

                              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.
                              Linux is ready for the desktop--but whose desktop?<br />How to install software in Kubuntu

                              Comment

                              Working...
                              X