Announcement

Collapse
No announcement yet.

No /swap

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

    No /swap

    I've noticed a few problems since upgrading to Gutsy. Most have been minor but this has got me puzzled. When I run "free" in Konsole I get.

    Code:
    dan@kubuntu:~$ free
          total   used   free  shared  buffers  cached
    Mem:   2075996  361984  1714012     0   12504  204640
    -/+ buffers/cache:  144840  1931156
    Swap:      0     0     0
    No swap file?? So I try fdisk to see.

    Code:
     Device Boot   Start    End   Blocks Id System
    /dev/hda1 *     1    1306  10490413+ 83 Linux
    /dev/hda2      1307    1437  1052257+ 82 Linux swap / Solaris
    /dev/hda3      1438    5274  30820702+ 83 Linux
    Swap is there. I also check the fstab.

    Code:
    # /etc/fstab: static file system information.
    #
    # <file system> <mount point> <type> <options>   <dump> <pass>
    proc /proc proc defaults 0 0
    # /dev/hda1
    UUID=69e3f501-7477-4227-9677-53aaa4dee363 / ext3 nouser,defaults,errors=remount-ro,atime,auto,rw,dev,exec,suid 0 1
    # /dev/hda3
    UUID=af7c2a9d-f582-4d40-9ca9-0cb7626b4f3b /home ext3 nouser,defaults,atime,auto,rw,dev,exec,suid 0 2
    #/dev/hda2
    UUID=7655b975-b4c3-4148-bd36-c2515c7f4a5a none swap sw 0 0
    /dev/hdc /media/cdrom0 udf,iso9660 user,atime,noauto,rw,dev,exec,suid 0 0
    /dev/hdd /media/cdrom1 udf,iso9660 user,atime,noauto,rw,dev,exec,suid 0 0
    All looks good but I don't have any /swap. What do you think?

    eriefisher


    ~$sudo make me a sandwich

    #2
    Re: No /swap

    That's pretty weird!

    Run "blkid" and see if the UUID matches /etc/fstab. I think I've noticed UUID changes sneaking into my system when I'm playing "master re-partitioner".

    If blkid shows the swap as a different UUID than /etc/fstab, you can just paste the one from the blkid output into /etc/fstab, but make sure to delete the quote marks. Then after you reboot all should be well again.

    Comment


      #3
      Re: No /swap

      That's got it. Thanks dibl.

      Code:
      dan@kubuntu:~$ free
             total    used    free   shared  buffers   cached
      Mem:    2075996   348144  1727852     0   14160   203884
      -/+ buffers/cache:   130100  1945896
      Swap:   1052248     0  1052248
      I hate these uuid's.

      eriefisher
      ~$sudo make me a sandwich

      Comment


        #4
        Re: No /swap

        Cool.

        I'm getting pretty used to the UUIDs -- I wasn't that invested in "/dev/xdx", being only a one-year Linux user, so it's probably less traumatic to me to just learn to use the UUIDs. It's just one more new thing on top of a whole lotta new things. 8)

        Comment


          #5
          Re: No /swap

          Im having similar problems no swap. Everything was fine before update.

          free
          total used free shared buffers cached
          Mem: 1034932 574296 460636 0 17188 320684
          -/+ buffers/cache: 236424 798508
          Swap: 0 0 0


          :~$ fdisk

          Usage: fdisk [-l] [-b SSZ] [-u] device
          E.g.: fdisk /dev/hda (for the first IDE disk)
          or: fdisk /dev/sdc (for the third SCSI disk)
          or: fdisk /dev/eda (for the first PS/2 ESDI drive)
          or: fdisk /dev/rd/c0d0 or: fdisk /dev/ida/c0d0 (for RAID devices)
          ...


          # /etc/fstab: static file system information.
          #
          # <file system> <mount point> <type> <options> <dump> <pass>
          proc /proc proc defaults 0 0
          # /dev/hda4
          UUID=df081272-23f7-4079-8986-40030355e143 / ext3 defaults,errors=remount-ro 0 1
          # /dev/hda1
          UUID=44E0069CE0069478 /media/hda1 ntfs defaults,nls=utf8,umask=007,gid=46 0 1
          # /dev/hda3
          UUID=2481-29B2 /media/hda3 vfat defaults,utf8,umask=007,gid=46 0 1
          # /dev/hda2
          UUID=c43a0ba5-2a15-47bd-a9f8-759d888f8822 none swap sw 0 0
          /dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0

          any help would be appreciated




          Comment


            #6
            Re: No /swap

            also this is what i get when i run blkid

            :~$ blkid
            /dev/hda1: TYPE="ntfs" UUID="44E0069CE0069478"
            /dev/hda2: TYPE="swap"
            /dev/hda3: LABEL="RECOVERY" UUID="2481-29B2" TYPE="vfat"
            /dev/hda4: UUID="df081272-23f7-4079-8986-40030355e143" SEC_TYPE="ext2" TYPE="ext3"

            Comment


              #7
              Re: No /swap (Thanks for this!)

              Glad I found this thread, it helped me solve my own swap problem that started with the Gutsy "upgrade."

              Just an FYI, I found that I had to completely remove the /dev/hd* designation and use only UUID= to get my swap partitions working.

              Thanks again! The Kubuntu community comes through in the clutch again!
              I distrust morning people, largely because I suspect them of getting together early one day while the rest of us were asleep and setting up the rules of civilization.

              Comment


                #8
                Re: No /swap

                I have in the fstab:

                # swap
                # /dev/sda3
                /dev/sda3 none swap sw 0 0
                Swapping

                Code:
                sudo mkswap -c /dev/sda3
                Setting up swapspace version 1, size = 2097438 kB
                no label, UUID=39c37ab3-0ad3-4009-bc45-a9f4ea2b1796
                man mkswap
                MKSWAP(8) Linux Programmer’s Manual MKSWAP(8)

                NAME
                mkswap - set up a Linux swap area

                SYNOPSIS
                mkswap [-c] [-vN] [-f] [-p PSZ] [-L label] device [size]

                DESCRIPTION
                mkswap sets up a Linux swap area on a device or in a file.

                (After creating the swap area, you need the swapon command to start
                using it. Usually swap areas are listed in /etc/fstab so that they can
                be taken into use at boot time by a swapon -a command in some boot
                script.)

                The device argument will usually be a disk partition (something like
                /dev/hda4 or /dev/sdb7) but can also be a file. The Linux kernel does
                not look at partition Id’s, but many installation scripts will assume
                that partitions of hex type 82 (LINUX_SWAP) are meant to be swap parti‐
                tions. (Warning: Solaris also uses this type. Be careful not to kill
                your Solaris partitions.)

                -c Check the device (if it is a block device) for bad blocks before
                creating the swap area. If any are found, the count is printed.
                and

                Code:
                sudo swapon -a
                man swapon
                SWAPON(8) Linux Programmer’s Manual SWAPON(8)

                NAME
                swapon, swapoff - enable/disable devices and files for paging and swap‐
                ping

                SYNOPSIS
                /sbin/swapon [-h -V]
                /sbin/swapon -a [-v] [-e]
                /sbin/swapon [-v] [-p priority] specialfile ...
                /sbin/swapon [-s]
                /sbin/swapoff [-h -V]
                /sbin/swapoff -a
                /sbin/swapoff specialfile ...

                DESCRIPTION
                Swapon is used to specify devices on which paging and swapping are to
                take place.

                The device or file used is given by the specialfile parameter. It may
                be of the form -L label or -U uuid to indicate a device by label or
                uuid.

                -a All devices marked as ‘‘swap’’ swap devices in /etc/fstab are
                made available, except for those with the ‘‘noauto’’ option.
                Devices that are already running as swap are silently skipped.
                =>
                :~$ free
                total used free shared buffers cached
                Mem: 1035636 880676 154960 0 154288 439424
                -/+ buffers/cache: 286964 748672
                Swap: 2048276 0 2048276

                Link

                Swap Partition FAQ
                https://help.ubuntu.com/community/SwapFaq
                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


                  #9
                  Re: No /swap

                  Thanks, Rog131!

                  I knew about swapon, but didn't know about mkswap. I was using gparted and kcontrol's disk & filesystem utils and neither one would activate the swap even though they both showed them.

                  Like I said, I finally had to resort to editing fstab and removing the /dev/hdb5 and /dev/hdb6 lines and replacing them with the drives' UUID= numbers. THAT worked. Don't ask me why...

                  It could be because the HD I'm using is about 200 gb and the bios on my Aptiva doesn't really support drives that large. But the system works, so who am I to question it...??
                  I distrust morning people, largely because I suspect them of getting together early one day while the rest of us were asleep and setting up the rules of civilization.

                  Comment

                  Working...
                  X