1

I had a swap partition of 1GB (RAM 1GB, Ubuntu 12.04 lts). Now swap is not shown on System Monitor neither can I hibernate my pc (sudo pm-hibernate).

blkid output:

/dev/sda1: UUID="B8B4FBB1B4FB706C" TYPE="ntfs" 
/dev/sda2: UUID="2ea7d608-2d89-4e41-9436-d05cb3ce8871" TYPE="swap" 
/dev/sda3: UUID="3219d03a-67e4-454b-8ce7-a27831846e35" TYPE="ext4" 
/dev/sda5: LABEL="Softwares" UUID="AC1CC3301CC2F47C" TYPE="ntfs" 
/dev/sda6: LABEL="Education" UUID="1E103E6C103E4B53" TYPE="ntfs" 
/dev/sda7: LABEL="Recreation" UUID="2CC8D181C8D149AA" TYPE="ntfs" 
/dev/sda8: LABEL="Miscellaneous" UUID="0274D6B174D6A727" TYPE="ntfs" 

/etc/fstab

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda6 during installation
UUID=3219d03a-67e4-454b-8ce7-a27831846e35 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=2ea7d608-2d89-4e41-9436-d05cb3ce8871 none            swap    sw              0       0

free -m

     total       used       free     shared    buffers     cached
Mem:           991        867        123          0         27        418
-/+ buffers/cache:        421        569
Swap:            0          0          0

cat /proc/swaps

Filename                Type        Size    Used    Priority

fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x9f369f36

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63    31471334    15735636    7  HPFS/NTFS/exFAT
/dev/sda2        31471616    33470447      999416   82  Linux swap / Solaris
/dev/sda3        33472512    62539775    14533632   83  Linux
/dev/sda4        62541045   312592769   125025862+   f  W95 Ext'd (LBA)
/dev/sda5        62541108   125066024    31262458+   7  HPFS/NTFS/exFAT
/dev/sda6       125066088   187591004    31262458+   7  HPFS/NTFS/exFAT
/dev/sda7       187591068   250115984    31262458+   7  HPFS/NTFS/exFAT
/dev/sda8       250116048   312576704    31230328+   7  HPFS/NTFS/exFAT

swapon --all

swapon: /dev/sda2: swapon failed: Invalid argument

dmesg | grep -A 5 -B 5 -i swap

[    9.487404] EXT4-fs (sda3): ext4_orphan_cleanup: deleting unreferenced inode 131645
[    9.487413] EXT4-fs (sda3): ext4_orphan_cleanup: deleting unreferenced inode 131330
[    9.487418] EXT4-fs (sda3): 16 orphan inodes deleted
[    9.487420] EXT4-fs (sda3): recovery complete
[    9.578600] EXT4-fs (sda3): mounted filesystem with ordered data mode. Opts: (null)
[   20.580539] Swap area shorter than signature indicates
[   20.588363] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   20.619443] udevd[330]: starting version 175
[   20.649959] lp: driver loaded but no devices found
[   20.662972] [drm] Initialized drm 1.1.0 20060810
[   20.675515] i915 0000:00:02.0: setting latency timer to 64
--
[   72.288573] PM: thaw of drv:sr dev:3:0:0:0 complete after 178.143 msecs
[   72.288578] PM: thaw of drv:scsi_device dev:3:0:0:0 complete after 178.136 msecs
[   72.299677] PM: thaw of drv:scsi_device dev:2:0:0:0 complete after 189.270 msecs
[   72.309473] PM: thaw of devices complete after 202.763 msecs
[   72.309668] PM: writing image.
[   72.309670] PM: Cannot find swap device, try swapon -a.
[   72.309699] PM: Cannot get swap writer
[   72.329896] Restarting tasks ... done.
[   72.331777] PM: Basic memory bitmaps freed
[   72.331792] video LNXVIDEO:00: Restoring backlight state
[   72.420048] option1 ttyUSB0: option_instat_callback: error -84
[   72.804047] option1 ttyUSB0: option_instat_callback: error -84
--
[  145.960625] sd 7:0:0:0: Attached scsi generic sg2 type 0
[  145.972036] sd 7:0:0:0: [sdb] Attached SCSI removable disk
[  172.430508] PPP BSD Compression module registered
[  172.455583] PPP Deflate Compression module registered
[  332.260789] type=1400 audit(1381814763.342:27): apparmor="DENIED" operation="capable" parent=1 profile="/usr/sbin/cupsd" pid=636 comm="cupsd" pid=636 comm="cupsd" capability=36  capname="block_suspend"
[ 1913.030998] Swap area shorter than signature indicates
[ 2022.530155] type=1400 audit(1381816453.610:28): apparmor="DENIED" operation="capable" parent=1 profile="/usr/sbin/cupsd" pid=636 comm="cupsd" pid=636 comm="cupsd" capability=36  capname="block_suspend"
[ 4062.729509] Swap area shorter than signature indicates

Please help. Thanks in advance.


df -h

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        14G  6.1G  7.0G  47% /
udev            488M  4.0K  488M   1% /dev
tmpfs           199M  868K  198M   1% /run
none            5.0M  4.0K  5.0M   1% /run/lock
none            496M  224K  496M   1% /run/shm
0

To On the Swap use command swapon -a

To see the status of swap use command swap -s

This command will on all Swap Partitions

 swapon -a

This command will Show the Swap Status

  swapon -s

Here is my output While Swap is running

Filename                Type        Size    Used    Priority
/dev/sda5                          partition    3998716 0   -1

It's Running , then go to the system monitor and have a look , Your Command is Wrong

4
  • sudo swapon -a [sudo] password for xyz: swapon: /dev/sda2: swapon failed: Invalid argument #sudo swapon -s Filename Type Size Used Priority //didn't work – Zaki Oct 15 '13 at 6:31
  • post you df -h output please – Babin Lonston Oct 22 '13 at 4:46
  • done..plz note the edit in op. – Zaki Oct 23 '13 at 15:43
  • 1
    If sudo swapon -a isn't turning it on I would really just save time. Boot a livecd/dvd/usb and use gparted to delete the existing swap and create a new one. You can then mount sda3, edit the fstab file with the new swap uuid and then reboot. – 23 93 26 35 19 57 3 89 Oct 23 '13 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.