swap
hi,
I'm new to linux. I noticed the swap isn't being used: the system monitor shows 0 bytes of swap and /proc/swaps is empty. Yet I have a linux swap partition (as shown in fdisk -l). I even tried mkswap /dev/my_swap_partition but it didn't work either. Please help. Thanks. |
Hi,
It might be that a swap partition is present, but not mounted. Can you post the output of the following commands: Code:
cat /etc/fstab Hope this helps. |
Thank you very much, that was the issue.
Swapon worked. How is it possible that it is not mounted by default, and how can I make it so that it is automatically mounted when the computer starts ? Thanks. |
Hi,
There should be an entry in your /etc/fstab file that mounts swap during the boot process. Something like this: Code:
/dev/sdaX swap swap pri=1 0 0 Hope this helps. |
I have an entry in my /etc/fstab file that says something like this:
UUID=some_uuid none swap sw 0 0 I don't have a pri=1 though. and I checked that this uuid is indeed the one where the swap is. So how can it be that the swap wasn't mounted during the boot process ? |
Hi,
Quote:
Have a look at your boot log file(s) to see if anything strange pops up (probably /var/log/dmesg or /var/log/boot). You can also use the dmesg command. BTW: Is this a one time thing or consistent after every (re)boot? |
hi,
This was consistent so far, but I haven't rebooted yet since I typed that swapon command. /var/log/dmesg | grep swap and /var/log/boot | grep swap return no result. dmesg | grep swap shows: [14435.771470] 0 pages in swap cache [14435.771478] Free swap = 0kB [14435.771480] Total swap = 0kB ps: what do the numbers in [] refer to ? |
Hi,
Quote:
Quote:
Code:
$ dmesg | grep -i swap Quote:
Hope this helps. |
hi,
so I did reboot. I still had to manually use the swapon command. I went through all the dmesg output and didn't find anything peculiar (though I don't understand half of it). In particular, the words 'error' and 'warn' are not present. Any idea as to what could cause my system not to automatically add the swap partition ? I only have one drive by the way. Thanks |
Hi,
Can you post the output I asked for in post #2? |
Is swap the last line in the fstab file?
It could be something as simple as no end of line character. |
No it's not the last line.
/etc/fstab: # /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 nodev,noexec,nosuid 0 0 # / was on /dev/sda1 during installation UUID=2b772b05-301a-4705-9b8b-52b52c4ec756 / ext4 errors=remount-ro 0 1 # /home was on /dev/sda7 during installation UUID=32d3f953-711a-4514-8e5b-17b7d3b34104 /home ext4 defaults 0 2 # swap was on /dev/sda6 during installation UUID=41e7d85c-9bdb-4434-a055-1e7e1124a419 none swap sw 0 0 # sd card for pandaboard UUID=42e278b3-3255-4a7f-8b1d-441d62b68515 none ext3 noauto 0 0 UUID=84F7-4051 none vfat noauto 0 0 free -m (after using swapon): total used free shared buffers cached Mem: 1982 1865 117 0 11 93 -/+ buffers/cache: 760 222 Swap: 3759 203 3555 fdisk -l: Disk /dev/sda: 150.0 GB, 150041884686 bytes 255 heads, 63 sectors/track, 19457 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: 0x00030db2 Device Boot Start End Blocks Id System /dev/sda1 * 1 2431 19530252 83 Linux /dev/sda2 2431 19451 136757149 5 Extended /dev/sda5 2432 12040 77095135 83 Linux /dev/sda6 12040 12512 3951858+ 82 Linux swap / Solaris /dev/sda7 12512 19451 55702128 83 Linux |
Can someone help me please ?
|
Have you checked the logs to see if there are any errors?
|
Well I'm not sure about which logs you're talking about, I haven't checked all the logs on my system, but I have checked /var/log/dmesg and /var/log/boot, and there was nothing unusual that I could find. In particular, the words 'warning' or 'error' aren't present.
|
All times are GMT -5. The time now is 09:44 AM. |