Announcement

Collapse
No announcement yet.

Can I add a swap partition after installation?

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

    Can I add a swap partition after installation?

    I just installed 9.10

    Can I add a swap partition now without reinstalling?

    thx
    KDE neon LTS 5.12

    #2
    Re: Can I add a swap partition after installation?

    simpall anser ....yes.......is it that esey .....well that depend's on what you know.

    you can use a Gparted live cd to eather make (if you have unalocated space) or resize an existing partition and make a swap partition.

    BE VERY carfull you could loose data so if you go the resize route BACK UP you data.

    if resizing a NTFS partition to make room for a swap partition first run chkdsk on it from windows and then defrag and then chkdsk agin.

    post the output of

    Code:
    sudo fdisk -l
    frome a terminal in Kubuntu

    VINNY
    i7 4core HT 8MB L3 2.9GHz
    16GB RAM
    Nvidia GTX 860M 4GB RAM 1152 cuda cores

    Comment


      #3
      Re: Can I add a swap partition after installation?

      So all I have to do is create a partition and name it '/swap'? (details and safety aside)

      I am fairly experienced with partitioning

      I just need to know if it is that simple. Create it and Kubuntu will instantly start using it?

      Also, I have to be booted from a separate source? (that is no prob but thought you could do it from within and a reboot)

      thanks

      here is my fdisk output below: (eeepc 4GB+16GB SSD)


      **************************************************
      Disk /dev/sda: 4034 MB, 4034838528 bytes
      255 heads, 63 sectors/track, 490 cylinders
      Units = cylinders of 16065 * 512 = 8225280 bytes
      Disk identifier: 0x000cb2e4

      Device Boot Start End Blocks Id System
      /dev/sda1 * 1 461 3702951 83 Linux
      /dev/sda2 462 490 232942+ 5 Extended
      /dev/sda5 462 490 232911 82 Linux swap / Solaris

      Disk /dev/sdb: 16.1 GB, 16139354112 bytes
      255 heads, 63 sectors/track, 1962 cylinders
      Units = cylinders of 16065 * 512 = 8225280 bytes
      Disk identifier: 0x0008196e

      Device Boot Start End Blocks Id System
      /dev/sdb1 1 1545 12410181 83 Linux
      /dev/sdb2 1546 1839 2361555 83 Linux
      /dev/sdb3 1840 1962 987997+ 5 Extended
      /dev/sdb5 1840 1962 987966 82 Linux swap / Solaris

      Disk /dev/sdc: 2063 MB, 2063597056 bytes
      63 heads, 62 sectors/track, 1031 cylinders
      Units = cylinders of 3906 * 512 = 1999872 bytes
      Disk identifier: 0x0004f9a0

      Device Boot Start End Blocks Id System
      /dev/sdc1 * 1 1028 2007653 b W95 FAT32
      KDE neon LTS 5.12

      Comment


        #4
        Re: Can I add a swap partition after installation?

        Originally posted by finny388
        sfdsfdsfdsdfsdfdsfsd
        AAA so what's that?

        VINNY
        i7 4core HT 8MB L3 2.9GHz
        16GB RAM
        Nvidia GTX 860M 4GB RAM 1152 cuda cores

        Comment


          #5
          Re: Can I add a swap partition after installation?

          wow and thanks VINNY
          you are quick

          I was trying to find the /code function to post the output but gave up but not before accidentally clicking post
          KDE neon LTS 5.12

          Comment


            #6
            Re: Can I add a swap partition after installation?

            you allreadey have 2 swap partition's.........you onley nead 1 ........eney linux runing can use the one that's allredey thare!

            are you shure it's not being used?

            type in a terminal

            Code:
            free
            or

            Code:
            top
            and see if it is or not .

            VINNY

            i7 4core HT 8MB L3 2.9GHz
            16GB RAM
            Nvidia GTX 860M 4GB RAM 1152 cuda cores

            Comment


              #7
              Re: Can I add a swap partition after installation?

              great point
              now I remember I have a dual boot on the second drive but I don't want to use that one.

              I have no idea how the one on sda got created; I didn't specify one during the install and I used the whole drive.

              In any case, sda5 is only 220MB's. So I can just resize this one, to say 1GB?

              also the 'free' below indicates Kubuntu is using a swap correct?


              free:
              total used free shared buffers cached
              Mem: 1018028 971160 46868 0 57000 533328
              -/+ buffers/cache: 380832 637196
              Swap: 232900 696 232204
              KDE neon LTS 5.12

              Comment


                #8
                Re: Can I add a swap partition after installation?

                Originally posted by finny388

                I have no idea how the one on sda got created; I didn't specify one during the install and I used the whole drive.

                In any case, sda5 is only 220MB's. So I can just resize this one, to say 1GB?
                not shure that disk looks like it's onley 4Gig ........how big is the one on /dev/sdb5 ?
                you could point Kubuntu to that one if it's larger.

                Originally posted by finny388

                also the 'free' below indicates Kubuntu is using a swap correct?


                free:
                total used free shared buffers cached
                Mem: 1018028 971160 46868 0 57000 533328
                -/+ buffers/cache: 380832 637196
                Swap: 232900 696 232204
                correct

                VINNY
                i7 4core HT 8MB L3 2.9GHz
                16GB RAM
                Nvidia GTX 860M 4GB RAM 1152 cuda cores

                Comment


                  #9
                  Re: Can I add a swap partition after installation?

                  how do I assign the swap partition? (to sdb5)
                  sdb5 is 1gb
                  KDE neon LTS 5.12

                  Comment


                    #10
                    Re: Can I add a swap partition after installation?

                    frome the desktop do alt>F2 this will open a box.

                    type in the box

                    Code:
                    kdesudo kate /etc/fstab
                    this will open the file as root for you to eddit.

                    now you can eather remove the UUID=xxxxxxxxxxxxxx on the swap line and replace with /dev/sdb5

                    OR in a terminal do
                    Code:
                    blkid
                    to find the UUID of /dev/sdb5 and insert that in place of the curent.

                    then click save and exit kate then eather reboot or back in terminal do swapon -a



                    VINNY
                    i7 4core HT 8MB L3 2.9GHz
                    16GB RAM
                    Nvidia GTX 860M 4GB RAM 1152 cuda cores

                    Comment


                      #11
                      Re: Can I add a swap partition after installation?

                      Thanks Vinny

                      I tried to retrieve the UUID with blkid but it returned nothing.
                      no error, just nothing

                      do I need a parameter or something?
                      KDE neon LTS 5.12

                      Comment


                        #12
                        Re: Can I add a swap partition after installation?

                        Now I'm in trouble.

                        I replaced the UUID with /dev/sdb5 and rebooted.
                        no problem
                        Ran the 'free' command again and it was clearly pointing to /dev/sdb5
                        so now I wanted to reclaim sda2 ext/sda5 swap
                        I gparted to delete the ext drive
                        then booted from usb to resize sda1.
                        now Kubuntu won't boot
                        it gets to the Kubuntu logo/progress bar, then blacks out and freezes

                        Is there some other area of Kubuntu that relied on that partition perhaps? Do you know where I go from here?

                        thanks!
                        KDE neon LTS 5.12

                        Comment


                          #13
                          Re: Can I add a swap partition after installation?

                          If I understand correctly, you deleted /dev/sda2? If that is what you did, then the system will automatically renumber the remaining partitions on /dev/sda. Old /dev/sda3 is now /dev/sda2, old /dev/sda4 is now /dev/sda3, etc.

                          If you use "by-uuid" for mounting partitions, these problems don't happen, btw.

                          Comment


                            #14
                            Re: Can I add a swap partition after installation?

                            but the swap I changed to was sdb5

                            is sdb numbering affected when sda is reconfigured?
                            KDE neon LTS 5.12

                            Comment


                              #15
                              Re: Can I add a swap partition after installation?

                              Originally posted by finny388

                              is sdb numbering affected when sda is reconfigured?
                              No. But I'm concerned that you did not do what you think you did. It looks like the boot sequence is still looking for a swap partition at /dev/sda2.

                              I would need to see 2 things to know what's going on:

                              /etc/fstab

                              /boot/grub/menu.lst (specifically the part where the defoptions are listed)

                              If you can boot a Live CD, you can get to those. You might need to edit the /boot/grub/menu.lst to change the default swap location to /dev/sdb5. It also needs to be that in /etc/fstab, which I think you already did.

                              Comment

                              Working...
                              X