Announcement

Collapse
No announcement yet.

Adding Swap to Kubuntu

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

    Adding Swap to Kubuntu

    Folks when Ive installed my system as I had 4 GB ram I added no space for swap. So I read this can be an issue in some cases so I decided I will add a 512 MB partition for it. How do I add it for my system? I know how to format it and so on. Do I just add the lines on fstab?

    #2
    Re: Adding Swap to Kubuntu

    Since a hard drive must be unmounted to work with the partitioning on it, you'll need to boot a Live CD, and run Gparted, and use it to shrink an existing partition to make space for the new swap partition. Add the new partition in the unallocated space that results from shrinking the existing partition, and then choose the "linux swap" format.

    But, are you sure you need to do this? If you're doing it out of "running out of memory" concern, you are wasting your time. If you want to use "suspend to disk", then you need to make it at least 2GB so it can hold all your running processes at the time you put it to sleep.

    MORE: http://kubuntuforums.net/forums/inde...opic=3099574.0

    Comment


      #3
      Re: Adding Swap to Kubuntu

      Cause Im afraid if I ran too many process and run out of ram I might break my system. I also run gentoo and compile a lot of stuff so this *might* also be an issue.

      Comment


        #4
        Re: Adding Swap to Kubuntu

        With 4G of RAM, this is doubtful.
        Using Kubuntu Linux since March 23, 2007
        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

        Comment


          #5
          Re: Adding Swap to Kubuntu

          Would you also doubt me needing swap space when I have 3gig of ram?

          Comment


            #6
            Re: Adding Swap to Kubuntu

            As an example I have a laptop with 2 GB of RAM and in normal use I never hit the swap partition, even when running a Virtual machine as well.. As dibl says with your sort of setup it's highly unlikely you will need swap unless you want to hibernate your machine, in which case it is mandatory.

            You may get some comfort on the issue by installing gkrellmd which will sit on your desktop enabling you to monitor system activity (your choice as to what you select - one of which is RAM). My thought is that unless you are going to do something very resource intensive, you will struggle to get to using half of your RAM.

            Comment


              #7
              Re: Adding Swap to Kubuntu

              AND, adding to what has been said already, there is NO CHANCE that "using up" all your RAM will cause Linux to crash. I been using Linux for only 12 years but I've never experienced, seen nor heard of such an event. That's because the software is designed to handle such circumstances. The more applications you use the more time-slicing your CPU will do, but executables are given "nice" values which determines how the OS schedules tasks. The task you are currently using gets the most CPU time slices. Actives threads get a little less "niceness", and inactive applications and threads are at the bottom of the CPU's attention span. They won't get any CPU time slices unless you manually "wake them up" and make them the focus of your, and the CPUs, attention.
              "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
              – John F. Kennedy, February 26, 1962.

              Comment


                #8
                Re: Adding Swap to Kubuntu

                2cents: I have a 4gb system and I have filled it up once in awhile - processing video and running multiple virtual machines.

                Bottom line IMO it takes up very little hard drive space so why not have it?

                I use 4-1gb swaps spread across my primary drives. Supposedly if you have multiple swaps and there all have the same priority, linux will treat the space much like a RAID0 device - that is to spread the data across all the drives enhancing performance - but I've never actually tested that myself. The other advantage is if I take a drive off-line for some reason, I still have plenty of swap space available.

                Please Read Me

                Comment


                  #9
                  Re: Adding Swap to Kubuntu

                  I have an 8GB swap file for hibernation and editing larger videos. In the normal use of my system (gimp, secondlife, stellarium, qtcreator, postgresql, googleearth, sage, virtualbox, various games, audacity, Skype, etc...) I have NEVER seen ANY use of the swap disk. The swap meter always resides at 0 bytes used.
                  "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
                  – John F. Kennedy, February 26, 1962.

                  Comment


                    #10
                    Re: Adding Swap to Kubuntu

                    I suppose that unless one is running low on HD space it does no harm to have some of it set up as swap esp if you might want to hibernate at some time.

                    Comment


                      #11
                      Re: Adding Swap to Kubuntu

                      Ok. So, how can I, then, take away the need for Kubuntu to require use of swap space upon booting. I did a stupid thing with this current installation. I told it to use a 16g sd card for swap. And so I took it out and used KDE Partition Manager to create a 1024kb partition for linuxswap. Can I manage the fstab dir/file to change the UUID to the newly created swap partition, via CLI?

                      Comment


                        #12
                        Re: Adding Swap to Kubuntu

                        ...Can I manage the fstab dir/file to change the UUID to the newly created swap partition, via CLI?
                        ?? - What do you mean - "via CLI" ??

                        Konsole/terminal:
                        Code:
                        sudo nano /etc/fstab

                        With the sed:

                        Before, /etc/fstab has:
                        # swap was on /dev/sda3 during installation
                        UUID=c7670658-123d-4d65-99c7-297324c923a5 none swap sw 0 0
                        konsole:
                        Code:
                        sudo sed -i 's/UUID=c7670658-123d-4d65-99c7-297324c923a5/UUID=12345678/g' /etc/fstab
                        after:
                        # swap was on /dev/sda3 during installation
                        UUID=12345678 none swap sw 0 0



                        A doc > Swap Faq
                        Another > How to fstab
                        Before you edit, BACKUP !

                        Why there are dead links ?
                        1. Thread: Please explain how to access old kubuntu forum posts
                        2. Thread: Lost Information

                        Comment


                          #13
                          Re: Adding Swap to Kubuntu

                          I think without fuller information we are all potentially going to go round in circles, or 1 question is simply going to lead to another.

                          Can you please specify the following:

                          Is your machine a laptop, netbook or desktop machine?

                          What (permanent) drives do you have available and how big are they?

                          Important - are you dual-booting with Windows? If so, how big is the windows installation?

                          Would I be right in assuming that you've only just installed kubuntu and so haven't customised it to any degree? If so, the best option might well be to reinstall, ensuring the partitioning is correct right from the beginning. With the above info we ought to be able to give you some pointers on how to get things set up properly.

                          Ian



                          Comment


                            #14
                            Re: Adding Swap to Kubuntu

                            Originally posted by DAB4970
                            Ok. So, how can I, then, take away the need for Kubuntu to require use of swap space upon booting. I did a stupid thing with this current installation. I told it to use a 16g sd card for swap. And so I took it out and used KDE Partition Manager to create a 1024kb partition for linuxswap. Can I manage the fstab dir/file to change the UUID to the newly created swap partition, via CLI?
                            Yeah - easy.

                            The CLI command blkid will list all your UUID's. I assume you know the new swap dev id so assuming /dev/sda3 you can type blkid /dev/sda3 and see the new UUID all by itself. Also blkid |grep swap will list all partition's UUID's that are formated swap. Just substitute the new UUID for the old one in fstab.

                            I don't think kubuntu requires a swap space so if you don't want it at all just comment out or remove the line from fstab.

                            You can turn swap off and on from the CLI using the swapon command. Take a look at the --help output or man page to see all the options.

                            Please Read Me

                            Comment


                              #15
                              Re: Adding Swap to Kubuntu

                              The installation is dual booted with Vista on a HP laptop. And I should have typed MB instead of KB for the swap partition's size. I can get into the GUI, but I have no wifi capabilities, for some reason. My guess it is in "safe mode". I do not wish to re-install because I have used Kmail and have not saved the emails to a different partition. Anyway, with using KDE Partition Manager, I can activate the swap partition but I doesn't stay activated on reboot. The swap partition needs to have a mount point. If I can just assign that mount point, I'm hoping that will be all I need to do. And with a CLI (cmd line interface), the blkid shows as "type" and not by "uuid". Any other info that might be helpful to you that I might have missed?

                              I would like to get rid of the Windows partition eventually, but not doing so because of iTunes, Blackberry desktop manager and a few games.

                              I have found the UUID for the swap partition.

                              I have just found this, in another thread, to modify fstab file when logged into GUI from terminal:

                              * kdesudo kate /etc/fstab

                              It is now modified and working as I had hoped.

                              Comment

                              Working...
                              X