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

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

    You are correct. I did change fstab to /dev/sdb5

    I've booted from USB and found /boot/grub but no menu.lst

    I do see a grub.cfg but it lists no swap or defoption.

    I know there is a grub (I see it on boot) and it seems to be this file.


    Here it is: (thanks)
    #
    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by /usr/sbin/grub-mkconfig using templates
    # from /etc/grub.d and settings from /etc/default/grub
    #

    ### BEGIN /etc/grub.d/00_header ###
    if [ -s /boot/grub/grubenv ]; then
    have_grubenv=true
    load_env
    fi
    set default="0"
    if [ ${prev_saved_entry} ]; then
    saved_entry=${prev_saved_entry}
    save_env saved_entry
    prev_saved_entry=
    save_env prev_saved_entry
    fi
    insmod ext2
    set root=(hd0,1)
    search --no-floppy --fs-uuid --set 8b2e6552-2574-401b-b6f8-6268401727dd
    if loadfont /usr/share/grub/unicode.pf2 ; then
    set gfxmode=640x480
    insmod gfxterm
    insmod vbe
    if terminal_output gfxterm ; then true ; else
    # For backward compatibility with versions of terminal.mod that don't
    # understand terminal_output
    terminal gfxterm
    fi
    fi
    if [ ${recordfail} = 1 ]; then
    set timeout=-1
    else
    set timeout=10
    fi
    ### END /etc/grub.d/00_header ###

    ### BEGIN /etc/grub.d/05_debian_theme ###
    set menu_color_normal=white/black
    set menu_color_highlight=black/white
    ### END /etc/grub.d/05_debian_theme ###

    ### BEGIN /etc/grub.d/10_linux ###
    menuentry "Ubuntu, Linux 2.6.31-16-generic" {
    recordfail=1
    if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    set quiet=1
    insmod ext2
    set root=(hd0,1)
    search --no-floppy --fs-uuid --set 8b2e6552-2574-401b-b6f8-6268401727dd
    linux /boot/vmlinuz-2.6.31-16-generic root=UUID=8b2e6552-2574-401b-b6f8-6268401727dd ro quiet splash
    initrd /boot/initrd.img-2.6.31-16-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-16-generic (recovery mode)" {
    recordfail=1
    if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    insmod ext2
    set root=(hd0,1)
    search --no-floppy --fs-uuid --set 8b2e6552-2574-401b-b6f8-6268401727dd
    linux /boot/vmlinuz-2.6.31-16-generic root=UUID=8b2e6552-2574-401b-b6f8-6268401727dd ro single
    initrd /boot/initrd.img-2.6.31-16-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-14-generic" {
    recordfail=1
    if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    set quiet=1
    insmod ext2
    set root=(hd0,1)
    search --no-floppy --fs-uuid --set 8b2e6552-2574-401b-b6f8-6268401727dd
    linux /boot/vmlinuz-2.6.31-14-generic root=UUID=8b2e6552-2574-401b-b6f8-6268401727dd ro quiet splash
    initrd /boot/initrd.img-2.6.31-14-generic
    }
    menuentry "Ubuntu, Linux 2.6.31-14-generic (recovery mode)" {
    recordfail=1
    if [ -n ${have_grubenv} ]; then save_env recordfail; fi
    insmod ext2
    set root=(hd0,1)
    search --no-floppy --fs-uuid --set 8b2e6552-2574-401b-b6f8-6268401727dd
    linux /boot/vmlinuz-2.6.31-14-generic root=UUID=8b2e6552-2574-401b-b6f8-6268401727dd ro single
    initrd /boot/initrd.img-2.6.31-14-generic
    }
    ### END /etc/grub.d/10_linux ###

    ### BEGIN /etc/grub.d/20_memtest86+ ###
    menuentry "Memory test (memtest86+)" {
    linux16 /boot/memtest86+.bin
    }
    menuentry "Memory test (memtest86+, serial console 115200)" {
    linux16 /boot/memtest86+.bin console=ttyS0,115200n8
    }
    ### END /etc/grub.d/20_memtest86+ ###

    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry "Ubuntu 9.04, kernel 2.6.28-12-netbook (on /dev/sdb2)" {
    insmod ext2
    set root=(hd1,2)
    search --no-floppy --fs-uuid --set b8581b4f-8228-408f-adda-06a58b1aa18e
    linux /boot/vmlinuz-2.6.28-12-netbook root=UUID=b8581b4f-8228-408f-adda-06a58b1aa18e ro quiet splash
    initrd /boot/initrd.img-2.6.28-12-netbook
    }
    menuentry "Ubuntu 9.04, kernel 2.6.28-12-netbook (recovery mode) (on /dev/sdb2)" {
    insmod ext2
    set root=(hd1,2)
    search --no-floppy --fs-uuid --set b8581b4f-8228-408f-adda-06a58b1aa18e
    linux /boot/vmlinuz-2.6.28-12-netbook root=UUID=b8581b4f-8228-408f-adda-06a58b1aa18e ro single
    initrd /boot/initrd.img-2.6.28-12-netbook
    }
    menuentry "Ubuntu 9.04, kernel 2.6.28-11-generic (on /dev/sdb2)" {
    insmod ext2
    set root=(hd1,2)
    search --no-floppy --fs-uuid --set b8581b4f-8228-408f-adda-06a58b1aa18e
    linux /boot/vmlinuz-2.6.28-11-generic root=UUID=b8581b4f-8228-408f-adda-06a58b1aa18e ro quiet splash
    initrd /boot/initrd.img-2.6.28-11-generic
    }
    menuentry "Ubuntu 9.04, kernel 2.6.28-11-generic (recovery mode) (on /dev/sdb2)" {
    insmod ext2
    set root=(hd1,2)
    search --no-floppy --fs-uuid --set b8581b4f-8228-408f-adda-06a58b1aa18e
    linux /boot/vmlinuz-2.6.28-11-generic root=UUID=b8581b4f-8228-408f-adda-06a58b1aa18e ro single
    initrd /boot/initrd.img-2.6.28-11-generic
    }
    menuentry "Ubuntu 9.04, memtest86+ (on /dev/sdb2)" {
    insmod ext2
    set root=(hd1,2)
    search --no-floppy --fs-uuid --set b8581b4f-8228-408f-adda-06a58b1aa18e
    linux /boot/memtest86+.bin
    }
    ### END /etc/grub.d/30_os-prober ###

    ### BEGIN /etc/grub.d/40_custom ###
    # This file provides an easy way to add custom menu entries. Simply type the
    # menu entries you want to add after this comment. Be careful not to change
    # the 'exec tail' line above.
    ### END /etc/grub.d/40_custom ###
    KDE neon LTS 5.12

    Comment


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

      Ooops, Grub 2. I should have known, since you said you installed 9.10. OK, "never mind".

      You say you see the boot progress bar, and then it halts. So, apparently it is beginning to boot, and hitting some problem. We will need to see the error, which is only visible if you boot without the splash option. It looks like your second menu entry is "Recovery Mode" -- boot that, and you should see it end with an error, which is what we need to know about.

      Comment


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

        rebooted in recovery:

        goes thru a myriad of lines then the Recovery Menu appears (resume, clean, dpkg, grub, etc)

        I choose resume

        re-sysinit...
        starts printing\
        checks battery

        then login:
        I log in and it states time and date of last login
        then"To access official documentation..."
        "9 packages can be update
        0 updates are security"
        then
        [ 30.771516] sd 2:0:0:0: [sdc] assuming drive cache: write through
        this repeats 2 more times with differnt 8 digit numbers at the beginning of the line

        then I sit at a prompt... and I don't know what to do from there

        I tried the grub option in the recovery menu a couple of times - it runs a few lines with no apparent errors - and returns to the Recovery menu

        KDE neon LTS 5.12

        Comment


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

          Does the "Recovery Menu" provide an option called "Fix X"? If so, try that one. After it runs, at the "#" prompt, enter
          Code:
          service kdm start
          and it should present your KDE login screen.

          Comment


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

            Don't bother with creating a swap partition you can easily create a swap file
            http://www.mepis.org/docs/en/index.php/Swap_file

            Sure the performance is worse, but who cares, if you have enough memory swap rarely gets used.

            Comment


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

              no, there is no xfix or the word fix anywhere
              I think there 6 choices
              I can write them down and type them out for you if you think that will help
              I tried to google for an image and couldn't find it
              the ones I found had xfix in them, perhaps it is gone or called something else in 9.10
              nothing about a server either though.
              I will be away from my computer for a few hours
              thank you for your help! using this USB version sucks. I want my pc back.

              why doesn't the grub file mention a swap file?
              arrg
              KDE neon LTS 5.12

              Comment


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

                Hmmmmm. I shall have to try my "recovery mode" and see what the choices are -- the last time I used it, which was months ago, there was a "Fix X" choice on it.

                Well, when you have a chance, I'd like to see your /etc/fstab file as it presently is, please. Also, if you could run these for me:
                Code:
                sudo rm /etc/blkid.tab
                then

                Code:
                sudo blkid
                and post the output.

                Maybe there's hope ....

                Comment


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

                  yes give the outputs dibl asked for ........... and it mite not hurt to run e2fsck on sda1 from the live medea cd/usb sence you resized it.......and eney other of the ext partitions you may have redone.
                  and repost the output of
                  Code:
                  sudo fdisk -l
                  so we can clearley see the changes made..................please

                  sorey I ben bisey with famaley in for the holadays

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

                  Comment


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

                    /etc/fstab
                    Code:
                    # /etc/fstab: static file system information.
                    #
                    # Use 'blkid -o value -s UUID' to print the universally unique identifier
                    # for a device; this may be used with UUID= as a more robust way to name
                    # devices that works even if disks are added and removed. See fstab(5).
                    #
                    # <file system> <mount point>  <type> <options>    <dump> <pass>
                    proc      /proc      proc  defaults    0    0
                    # / was on /dev/sda1 during installation
                    UUID=8b2e6552-2574-401b-b6f8-6268401727dd /        ext4  errors=remount-ro 0    1
                    # swap was on /dev/sda5 during installation
                    /dev/sdb5 swap      swap  sw       0    0
                    sudo rm /etc/blkid.tab
                    Code:
                    rm: cannot remove `/etc/blkid.tab': No such file or directory
                    sudo blkid
                    Code:
                    /dev/loop0: TYPE="squashfs" 
                    /dev/sda1: UUID="8b2e6552-2574-401b-b6f8-6268401727dd" TYPE="ext4" 
                    /dev/sdb1: LABEL="HOME" UUID="4c164d01-ad11-49de-9e79-ee649af88602" SEC_TYPE="ext2" TYPE="ext3" 
                    /dev/sdb2: UUID="b8581b4f-8228-408f-adda-06a58b1aa18e" SEC_TYPE="ext2" TYPE="ext3" 
                    /dev/sdb5: UUID="52a6bb51-0bb2-4c6a-b685-23d18584c352" TYPE="swap" 
                    /dev/sdc1: LABEL="USB STICK" UUID="147E-18C7" TYPE="vfat"

                    sudo fdisk -l
                    Code:
                    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     490   3935893+ 83 Linux
                    
                    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


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

                      OK, your /home partition is not being mounted by /etc/fstab. With your Live CD running, mount the root partition of the hard drive, do Alt-F2 "kdesudo kate" and browse to the /etc/fstab file on the root partition of the hard drive, open it and edit the file to add the /home partition, like this:

                      # /etc/fstab: static file system information.
                      #
                      # Use 'blkid -o value -s UUID' to print the universally unique identifier
                      # for a device; this may be used with UUID= as a more robust way to name
                      # devices that works even if disks are added and removed. See fstab(5).
                      #
                      # <file system> <mount point> <type> <options> <dump> <pass>
                      proc /proc proc defaults 0 0
                      # / was on /dev/sda1 during installation
                      UUID=8b2e6552-2574-401b-b6f8-6268401727dd / ext4 errors=remount-ro 0 1
                      UUID=4c164d01-ad11-49de-9e79-ee649af8860 /home ext3 users,rw,exec 0 2
                      # swap was on /dev/sda5 during installation
                      /dev/sdb5 swap swap sw 0 0
                      After you "File > Save" the edits, exit kate and reboot the computer (with that USB stick removed). It should come up.

                      Comment


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

                        Thanks dibl, that got me further. You missed a 2 at the end of the UUID but I caught it.

                        Gets to wallpaper (but no desktop) and errors: "Cannot enter the home directory using /"
                        Then login, then it cannot write to "//kde/share/config/knotifyrc and "//kde/share/config/foorc"
                        Then "kstartconfig4 does not exist or fails. The error code is 3. Check your installation"
                        Then loops back to login again.

                        Let me give some more background.
                        I'm using an eeepc that has 2 ssds: 4GB for OS, 16GB for HOME directory (and swap now)
                        Recently I went into settings/about me/paths and tried to change them all from the default 4GB SDA to the 16GB SDB
                        It was hanging a bit but seemed to work. Then when I went in to check again (I believe on a subsequent but) but they were back to defaults. I don't know what they are now as I only know the gui for that.




                        KDE neon LTS 5.12

                        Comment


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

                          Good - yes you need a sharp eye on the UUIDs.

                          OK, well, now it sounds like you are left with a KDE user/permissions issue of some sort. A search revealed only one similar thread: http://kubuntuforums.net/forums/index.php?topic=3099693

                          Geeeez -- I dunno, I've never had to fix path problems. Can you see your user's home directory under your system's /home directory?

                          Probably this is another unplanned consequence of the elimination of the old swap partition, and remounting /home on the other partition. You could probably make a new user and have it set up correctly/automatically, and then in the future you can be that user. But then he won't have sudo privileges until you put him in the admin group and all of that. If that sounds like more trouble than it's worth, and bearing in mind that you only installed it a day or two ago, I think I would just reinstall the whole OS, using "manual" for the partitioning and choosing the /dev/sdb1 partition to mount /home on.

                          Or, maybe someone with more experience on path problems can tell you how to straighten that out.

                          Comment


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

                            I was thinking the same thing.
                            It will be a good exercise for me to install again
                            All my customizations can be done properly now that I've learned a bit

                            Thanks so much for your help!
                            KDE neon LTS 5.12

                            Comment

                            Working...
                            X