Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: swap problem (swapon: cannot find the device for ...)

  1. #1
    Join Date
    Oct 2008
    Beans
    45

    swap problem (swapon: cannot find the device for ...)

    Hi, I recently added the system monitor applet to one of my panels and realised that the swap space is never used. I read the Swap FAQ in the community documentation but couldn't solve the problem.

    andres@andres-laptop:~$ cat /proc/sys/vm/swappiness
    60

    (some appications open)
    andres@andres-laptop:~$ free
    total used free shared buffers cached
    Mem: 3018928 1234988 1783940 0 32364 387884
    -/+ buffers/cache: 814740 2204188
    Swap: 0 0 0

    (many applications open)
    andres@andres-laptop:~$ free
    total used free shared buffers cached
    Mem: 3018928 2994644 24284 0 7408 341180
    -/+ buffers/cache: 2646056 372872
    Swap: 0 0 0

    andres@andres-laptop:~$ sudo fdisk -l

    Disk /dev/sda: 250.1 GB, 250059350016 bytes
    255 heads, 63 sectors/track, 30401 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0xc17b6006

    Device Boot Start End Blocks Id System
    /dev/sda1 1 1275 10240000 27 Unknown
    /dev/sda2 * 1275 8924 61439996 7 HPFS/NTFS
    /dev/sda3 8925 30401 172514002+ 5 Extended
    /dev/sda5 8925 9653 5855661 82 Linux swap / Solaris
    /dev/sda6 9654 30401 166658278+ 83 Linux

    Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x4db9b9e8

    Device Boot Start End Blocks Id System
    /dev/sdc1 1 121602 976760536 7 HPFS/NTFS


    andres@andres-laptop:~$ cat /etc/fstab
    # /etc/fstab: static file system information.
    #
    # <file system> <mount point> <type> <options> <dump> <pass>
    proc /proc proc defaults 0 0
    # /dev/sda6
    UUID=e154ab05-4256-43fe-ba99-47f94b7f32b7 / ext3 relatime,errors=remount-ro 0 1
    # /dev/sda5
    UUID=b3790e73-7855-4797-862f-ad8b8a30dcfd none swap sw 0 0
    /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
    andres@andres-laptop:~$ sudo swapoff -a
    andres@andres-laptop:~$ sudo /sbin/mkswap /dev/sda5
    Setting up swapspace version 1, size = 5855656 KiB
    no label, UUID=5372e6d3-3e16-4fdf-9902-4eb4fbe3b3d5
    andres@andres-laptop:~$ sudo swapon -a
    swapon: cannot find the device for UUID=b3790e73-7855-4797-862f-ad8b8a30dcfd

    I guess the last line says sums up the problem.

    Any help would be very appreciated.

  2. #2
    Join Date
    Jan 2007
    Beans
    3,202

    Re: swap problem (swapon: cannot find the device for ...)

    Open a terminal, and paste in this command:

    Code:
    sudo blkid -c /dev/null -o list
    and post back with the output.
    Intel Core i7-950 / Asus P6X58D-E / Nvidia GTX480 / siduction 64-bit on OCZ Revodrive SSD / KDE4.10.2/ Kubuntu 13.04

  3. #3
    Join Date
    Jan 2007
    Beans
    3,202

    Re: swap problem (swapon: cannot find the device for ...)

    OK, as you can see, /etc/fstab has a UUID for swap, but the blkid output shows a different UUID.

    Open your text editor with root privileges, open /etc/fstab, and carefully replace the UUID number with the correct one from the blkid output. You can copy and paste from the terminal output, but be careful not to include the quote marks in the /etc/fstab line. Don't forget to do File > Save before you exit gedit.

    Then issue
    Code:
    sudo mount -a
    to mount it, and then you can check it with
    Code:
    sudo mount
    , and it should be mounted correctly.
    Intel Core i7-950 / Asus P6X58D-E / Nvidia GTX480 / siduction 64-bit on OCZ Revodrive SSD / KDE4.10.2/ Kubuntu 13.04

  4. #4
    Join Date
    Oct 2008
    Beans
    45

    Re: swap problem (swapon: cannot find the device for ...)

    well I don't really understand the output of mount so here it is:

    andres@andres-laptop:~$ sudo mount -a
    [1]+ Done sudo gedit /etc/fstab
    andres@andres-laptop:~$ sudo mount
    /dev/sda6 on / type ext3 (rw,relatime,errors=remount-ro,commit=0)
    proc on /proc type proc (rw)
    none on /sys type sysfs (rw,noexec,nosuid,nodev)
    fusectl on /sys/fs/fuse/connections type fusectl (rw)
    none on /sys/kernel/debug type debugfs (rw)
    none on /sys/kernel/security type securityfs (rw)
    none on /dev type devtmpfs (rw,mode=0755)
    none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
    none on /dev/shm type tmpfs (rw,nosuid,nodev)
    none on /var/run type tmpfs (rw,nosuid,mode=0755)
    none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
    binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
    gvfs-fuse-daemon on /home/andres/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=andres)
    /dev/sdc1 on /media/TOSHIBA EXT type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_ permissions)

    is it ok now?

  5. #5
    Join Date
    Oct 2008
    Beans
    45

    Re: swap problem (swapon: cannot find the device for ...)

    I don't think it's ok, the swap space is still 0% in use

  6. #6
    Join Date
    Dec 2010
    Beans
    573
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: swap problem (swapon: cannot find the device for ...)

    Why are you concerned that Swap is not being used? Are you running out of physical memory?

    Like dabl asked what do you get when you run the command:
    Code:
    sudo blkid -c /dev/null -o list
    Last edited by hawkmage; January 19th, 2011 at 01:06 AM. Reason: Typo

  7. #7
    Join Date
    Oct 2008
    Beans
    45

    Re: swap problem (swapon: cannot find the device for ...)

    Well I posted the output of "sudo blkid -c /dev/null -o list" before, but since I posted it twice by mistake I reported one of the posts for the moderator to delete it, but it seems like both were deleted, anyway here's the output:

    andres@andres-laptop:~$ sudo blkid -c /dev/null -o list
    device fs_type label mount point UUID
    -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    /dev/sda1 vfat PQSERVICE (not mounted) EAEE-EB49
    /dev/sda2 ntfs ACER (not mounted) 3A240EDB240E99D1
    /dev/sda5 swap (not mounted) 4d85d9bf-0085-45fd-96c3-986843bce895
    /dev/sda6 ext3 / e154ab05-4256-43fe-ba99-47f94b7f32b7
    /dev/sdc1 ntfs TOSHIBA EXT /media/TOSHIBA EXT AEDC9232DC91F535

    andres@andres-laptop:~$ cat /etc/fstab
    # /etc/fstab: static file system information.
    #
    # <file system> <mount point> <type> <options> <dump> <pass>
    proc /proc proc defaults 0 0
    # /dev/sda6
    UUID=e154ab05-4256-43fe-ba99-47f94b7f32b7 / ext3 relatime,errors=remount-ro 0 1
    # /dev/sda5
    UUID=4d85d9bf-0085-45fd-96c3-986843bce895 none swap sw 0 0
    /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0

    I don't think I'm running out of physical memory but I'd like to solve it anyway (I'm on vacation hehe)

  8. #8
    Join Date
    Jan 2007
    Beans
    3,202

    Re: swap problem (swapon: cannot find the device for ...)

    Hmmm -- where did that second post go?

    Quote Originally Posted by andres.ordonez View Post
    well I don't really understand the
    is it ok now?
    Nope.


    The UUID of the partition that you are using for swap, apparently /dev/sda5, must be the UUID that is used in the /etc/fstab file to mount it.

    The /etc/fstab file that you listed looks right.

    Try again in the terminal
    Code:
    sudo mount -a
    and then post the output of
    Code:
    sudo mount
    Last edited by dabl; January 19th, 2011 at 01:30 AM.
    Intel Core i7-950 / Asus P6X58D-E / Nvidia GTX480 / siduction 64-bit on OCZ Revodrive SSD / KDE4.10.2/ Kubuntu 13.04

  9. #9
    Join Date
    Oct 2008
    Beans
    45

    Re: swap problem (swapon: cannot find the device for ...)

    andres@andres-laptop:~$ sudo mount
    /dev/sda6 on / type ext3 (rw,relatime,errors=remount-ro,commit=0)
    proc on /proc type proc (rw)
    none on /sys type sysfs (rw,noexec,nosuid,nodev)
    fusectl on /sys/fs/fuse/connections type fusectl (rw)
    none on /sys/kernel/debug type debugfs (rw)
    none on /sys/kernel/security type securityfs (rw)
    none on /dev type devtmpfs (rw,mode=0755)
    none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
    none on /dev/shm type tmpfs (rw,nosuid,nodev)
    none on /var/run type tmpfs (rw,nosuid,mode=0755)
    none on /var/lock type tmpfs (rw,noexec,nosuid,nodev)
    binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
    gvfs-fuse-daemon on /home/andres/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=andres)
    /dev/sdc1 on /media/TOSHIBA EXT type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096,default_ permissions)
    Last edited by andres.ordonez; January 19th, 2011 at 01:35 AM.

  10. #10
    Join Date
    Jan 2007
    Beans
    3,202

    Re: swap problem (swapon: cannot find the device for ...)

    Hmmmmmm -- I'm confused!

    Can you remove that Toshiba thingy, please? Then, since the UUID of /dev/sda5 has changed twice already, let's have one more look at the output of
    Code:
    sudo blkid -c /dev/null -o list
    (just to make sure it hasn't changed again)
    Intel Core i7-950 / Asus P6X58D-E / Nvidia GTX480 / siduction 64-bit on OCZ Revodrive SSD / KDE4.10.2/ Kubuntu 13.04

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •