Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a feeling it's not. I'm running Ubuntu 11.10 on a Toshiba Satellite L305-S5944 Laptop. Says I have 1.8 GiB of Ram (thought I had 2). When I look at the Resources tab in the System Monitor the Swap always says 0 bytes of 0 bytes. I tried reinstalling Ubuntu 11.10, but still says the same. Both times I choose the encrypt home directory option during install. Some times when I'm booting it says some thing like "could not mount cryptswap". Tried to get a screen shot but now it's not doing it. When I look at my hard disk in the Disk Utility it shows 3 partitions created during install: 248 GB ext 4, Extended 2.0 GB, and Unknown 2.0 GB. As you can see on the screen shots the partition called Unknown, has the Partition Type: Linux swap (0x82). Sorry wouldn't let me post images.

Been having problems with crashes and slow downs pretty regularly. Also I don't see a hibernate option when I click on the button in the upper right corner. So does it look like my swap space is not functioning properly?

It's my understanding that the swap space is encrypted. Is this why it's not registering in the System Monitor or is that indicating a problem?

Is there any way to test if the swap is functioning?

If it's not working, how would I make it work, looks like it's there already, just not working possibly?

The output of "free -m" is:

                total used free shared buffers cached 
Mem:            1883  1729 154  0      21      634 
-/+ buffers/cache:    1073 810 
Swap:           0     0    0 

Not sure whether it's LUKS or ecryptfs. All I did was click the check mark box that says "encrypt my home directory" or something similar during the normal installation process. I think it's ecryptfs cause I just checked the hidden files in my home folder and there's a hidden folder called ".ecryptfs"

ran blkid and the output was:

/dev/sda1: UUID="92a6b5e8-695f-4d54-a389-d5dd7c7b862e" TYPE="ext4" 
/dev/sdc1: LABEL="FreeAgent GoFlex Drive" UUID="04684AE3684AD2DA" TYPE="ntfs" 

sdc1 is my external HD. Also tried GParted and in addition to the sda1 it shows a sda 2 with a File System: "extended" and Size 1.87 GiB. It also shows a parition, sda5, nested inside sda2, with a File System "unknown" and size 1.87 GiB. Though next to the sda5 there is a red cirle with a "!" inside.

When I right on it and select "information" it says Status: Not mounted and at the bottom Warning: Unable to detect file system! Possible reasons are: -The file system is damaged -The file system is unknown to GParted -There is no file system available (unformatted) -The device entry /dev/sda5 is missing. Did I do something wrong during the install? I thought when I choose erase and use the whole hard drive that Ubuntu would create the swap automatically. Looks like it's there there but not working for some reason.

My /etc/fstab file looks like this:

# /etc/fstab: static file system information.
#
# Use 'blkid' 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/sdb1 during installation
UUID=92a6b5e8-695f-4d54-a389-d5dd7c7b862e /               ext4    errors=remount-ro 0       1
# swap was on /dev/sdb5 during installation
#UUID=088145ec-4c28-43e4-b3de-9f6971b08704 none            swap    sw              0       0
/dev/mapper/cryptswap1 none swap sw 0 0

The output of sudo fdisk -l is:

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 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: 0x0001d8e9

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   484472831   242235392   83  Linux
/dev/sda2       484474878   488396799     1960961    5  Extended
/dev/sda5       484474880   488396799     1960960   82  Linux swap / Solaris

Disk /dev/sdc: 640.1 GB, 640135028224 bytes
1 heads, 63 sectors/track, 19845455 cylinders, total 1250263727 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: 0x2bc1313e

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1              63  1250258687   625129312+   7  HPFS/NTFS/exFAT

I noticed that my swap in the fstab was commented out so I deleted the # to uncomment and restarted though still not working.

share|improve this question
    
post the output of free -m If swap is not working we will need to look at how you configured it, with LUKS or ecryptfs –  bodhi.zazen Dec 29 '11 at 15:21
    
@bodhi.zazen Thank you. The output of "free -m" is: total used free shared buffers cached Mem: 1883 1729 154 0 21 634 -/+ buffers/cache: 1073 810 Swap: 0 0 0 Not sure whether it's LUKS or ecryptfs. All I did was click the check mark box that says "encrypt my home directory" or something similar during the normal installation process. I think it's ecryptfs cause I just checked the hidden files in my home folder and there's a hidden folder called ".ecryptfs". –  BentSpace Dec 30 '11 at 15:12
    
@bodhi.zazen sorry for the bad formatting, I'm new to this and still trying to figure it out. –  BentSpace Dec 30 '11 at 15:17
1  
don't worry about the formatting. From what you posted it appears you did not configure a swap partition. –  bodhi.zazen Dec 31 '11 at 2:07

4 Answers 4

No. I had the same issue. You have to make sure you have no swap on at all by running cat /proc/swaps. Then use mkswap to format the swap partition. Then in /etc/conf.d/dm-crypt (might be crypttab or something similar), you have to use the default urandom dmcrypt stuff at boot by adding these lines to the file:

swap=crypt-swap
target='/dev/sd*'

At least that's how I did it in Sabayon. Also if its acting up when you're booting and throwing you some random error about LUKS partitions, press e at the GRUB boot menu and remove "crypt_swap=/dev/sda5" from the kernel parameter line.

I'm a noob so don't blindly listen to me, but this is how I got where I am now.

share|improve this answer
    
You’re one of the few people who have actually gone into any kind of actionable detail about these issues, beyond vague “oh, do you really need swap?” or “oh, try re-installing” or “oh, heh, if you run out of memory without a swap partition your processes may silently die”. –  qubex May 18 at 16:57

OP posted a solution that worked in the comments

I kinda got tried of fooling with it and just turned it into a normal swap instead of the encrypted swap. Looks like it's working now.

share|improve this answer

Did you make a swap partition when you installed ? You can list your partitions with fdisk or graphically with gparted.

If not, then you would need to make a swap partition. You can do this with gparted from a live CD.

List your partitions with blkid

You then edit /etc/fstab and add in your swap partition. An entry would look like

UUID=xxx.yyy.zzz swap swap default 0 0

See: https://help.ubuntu.com/community/SwapFaq#How_do_I_add_more_swap.3F

http://tldp.org/HOWTO/Partition/setting_up_swap.html

If you feel you need an encrypted swap, IMO, it is easiest to install from the alternate CD as it will set up the encryption for you.

share|improve this answer
    
@bodhiI ran blkid and the output was: /dev/sda1: UUID="92a6b5e8-695f-4d54-a389-d5dd7c7b862e" TYPE="ext4" /dev/sdc1: LABEL="FreeAgent GoFlex Drive" UUID="04684AE3684AD2DA" TYPE="ntfs" sdc1 is my external HD. Also tried GParted and in addition to the sda1 it shows a sda 2 with a File System: "extended" and Size 1.87 GiB. It also shows a parition, sda5, nested inside sda2, with a File System "unknown" and size 1.87 GiB. Though next to the sda5 there is a red cirle with a "!" inside. –  BentSpace Dec 31 '11 at 6:22
    
When I right on it and select "information" it says Status: Not mounted and at the bottom Warning: Unable to detect file system! Possible reasons are: -The file system is damaged -The file system is unknown to GParted -There is no file system available (unformatted) -The device entry /dev/sda5 is missing. Did I do something wrong during the install? I thought when I choose erase and use the whole hard drive that Ubuntu would create the swap automatically. Looks like it's there there but not working for some reason. Thank you for your kind help, you are wise and I am but a grasshopper... : ) –  BentSpace Dec 31 '11 at 6:22
    
If the swap is there but just not mounted, how would I go about mounting it? –  BentSpace Dec 31 '11 at 6:25
    
Normally swap is mounted automatically. You normally have an entry in /etc/fstab for swap. You can try sudo swapon -a From your original post, you are taking about encryption and you really have not given sufficient information on your configuration. –  bodhi.zazen Jan 2 '12 at 3:55
    
I added the contents of my fstab in my question. When I run sudo swapon -a it says swapon: /dev/mapper/cryptswap1: stat failed: No such file or directory –  BentSpace Jan 3 '12 at 14:13

It looks like you never allocated any swap space on your hard drive during your install. Extended is the space in which your swap space and your Linux Distro will be placed..Hope this helps you.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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