The Ubuntu installation does not create swap partition.

Bug #1186811 reported by tres86dx
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
ubiquity (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

The Ubuntu installation does not create swap partition. This issue happen with both 12.04.2 and 13.04.

I tested it with two diferents pc and with a virtual machine in virtual box into Ubuntu. I tried both automatic and manual installation options during installation.

The partition is created but with errors and the system can not mount the partition swap at startup.

I solved the problem by booting the system from pendrive, then start gparted and format the partition again. This worked for several days, until it happened again today.

I include a picture (of gparted) with the problem.

ProblemType: Bug
DistroRelease: Ubuntu 13.04
Package: linux-image-3.8.0-23-generic 3.8.0-23.34
ProcVersionSignature: Ubuntu 3.8.0-23.34-generic 3.8.11
Uname: Linux 3.8.0-23-generic x86_64
ApportVersion: 2.9.2-0ubuntu8
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC1: fenix 3510 F.... pulseaudio
 /dev/snd/controlC0: fenix 3510 F.... pulseaudio
CRDA:
 country AU:
  (2402 - 2482 @ 40), (N/A, 20)
  (5170 - 5250 @ 40), (3, 23)
  (5250 - 5330 @ 40), (3, 23), DFS
  (5735 - 5835 @ 40), (3, 30)
Date: Sun Jun 2 18:46:07 2013
EcryptfsInUse: Yes
HibernationDevice: RESUME=UUID=b4021e2d-c260-4080-8691-a1f402176394
InstallationDate: Installed on 2013-05-05 (28 days ago)
InstallationMedia: Ubuntu 13.04 "Raring Ringtail" - Release amd64 (20130424)
MachineType: Gigabyte Technology Co., Ltd. P67A-UD3-B3
MarkForUpload: True
ProcFB: 0 radeondrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.8.0-23-generic root=UUID=59a5ed6f-0962-4146-b993-11e0251226b8 ro splash quiet
RelatedPackageVersions:
 linux-restricted-modules-3.8.0-23-generic N/A
 linux-backports-modules-3.8.0-23-generic N/A
 linux-firmware 1.106
RfKill:
 0: phy0: Wireless LAN
  Soft blocked: yes
  Hard blocked: no
SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 07/29/2011
dmi.bios.vendor: Award Software International, Inc.
dmi.bios.version: F6
dmi.board.name: P67A-UD3-B3
dmi.board.vendor: Gigabyte Technology Co., Ltd.
dmi.board.version: x.x
dmi.chassis.type: 3
dmi.chassis.vendor: Gigabyte Technology Co., Ltd.
dmi.modalias: dmi:bvnAwardSoftwareInternational,Inc.:bvrF6:bd07/29/2011:svnGigabyteTechnologyCo.,Ltd.:pnP67A-UD3-B3:pvr:rvnGigabyteTechnologyCo.,Ltd.:rnP67A-UD3-B3:rvrx.x:cvnGigabyteTechnologyCo.,Ltd.:ct3:cvr:
dmi.product.name: P67A-UD3-B3
dmi.sys.vendor: Gigabyte Technology Co., Ltd.

Revision history for this message
tres86dx (tres86dx-ubuntu) wrote :
Revision history for this message
Brad Figg (brad-figg) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
affects: linux (Ubuntu) → ubiquity (Ubuntu)
Changed in ubiquity (Ubuntu):
status: Confirmed → New
Revision history for this message
tres86dx (tres86dx-ubuntu) wrote :

It may be that one of the problems is the installation program (ubiquity), and affecting two different versions of ubuntu (12.04.2 and 13.04).

But I solved the problem as I explained above, and after a few days of having the swap partition running well the same thing happened. Therefore I think there is another problem.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubiquity (Ubuntu):
status: New → Confirmed
Revision history for this message
tres86dx (tres86dx-ubuntu) wrote :

I recently installed ubuntu 13.10 (clean install) and the problem persist in this release too.
I have always installed the operative system in the same way in three diferent partitions one for root, one for home (both ext4) and another for swap. But since 12.04 i have the same problem after the installation the swap partition is unmounted and is not operational.
During installation, I always choose to encrypt the home partition.
Thanks

Revision history for this message
Imad Ahmed (imad-a-ahmed) wrote :

I have the same problem in 13.04 and when recently upgraded to 13.10. Swap does not mount regardless for the several solutions I found elsewhere! Hopefully someone will come up with useful solution.

It worth mentioning that Gparted see the swap partition as Unknown and you cannot format it again there as you get an error. So going no where!!

Please help.

Thanks

Revision history for this message
tres86dx (tres86dx-ubuntu) wrote :

Last week i had time to search a solution in google. First i discovered that the problem happen when the installation is made from usb stick. I realized that i started with the problem in 12.04 when i change from cd to usb. I guess the problem is in the installation program.
I found the next solution and it works for me.
Open a terminal windows:
1.- sudo swapoff -a
(the previous command turns off "swap" anyway it don't work)
2.-edit the crypttab file in /etc/crypttab
For do that use nautilus like superuser. In the terminal execute:
sudo nautilus
next go to /etc/crypttab and open the file. Search for:
cryptswap1 /dev/sdb8 /dev/urandom swap,cipher=aes-cbc-essiv:sha256

and put # at the begining to ignore the coomand when ubuntu start. Something like this:

#cryptswap1 /dev/sdb8 /dev/urandom swap,cipher=aes-cbc-essiv:sha256

save the file and close it.
3.- Do the same for another file named fstab
sudo nautilus
next go to /etc/fstab and open the file. Search for:

/dev/mapper/cryptswap1 none swap sw 0 0

put # again at the beginning.

#/dev/mapper/cryptswap1 none swap sw 0 0

save the file.

4.-Close all the programs and restart ubuntu.

5.- start gparted and reformat the correct partition like swap. Be sure the correct partition. In my case is:

/dev/sdb5

6.- open terminal and execute:

sudo mkswap /dev/sdXX

sdXX in my case is sdb5, this can vary from system to system. Pay attention to the system answer and copy to use later the UUID=xxxxxxxxxxxxxxxx For example:

setting up swapspace version 1, size = 4208636 KiB
no label, UUID=06a9be15-d05b-466d-bfe3-a086bb9cdba0

7.-edit the resume file in /etc/crypttab
For do that use nautilus like superuser. In the terminal execute:
sudo nautilus
next go to /etc/initramfs-tools/conf.d/resume and open the file. Search for:

RESUME=UUID=06a9be15-d05b-466d-bfe3-a086bb9cdba0

and change the numbers for yours numbers (previously saved):

RESUME=UUID=xxxxxxxxxxxxxxxxxxxx

save the file

8.- in the terminal execute:
sudo update-initramfs -u

this upgrade the configuration

9.- sudo swapon /dev/sdXX

this activate the swap

10.- sudo ecryptfs-setup-swap
this encrypt the swap partition

11.- to check the partition is working execute:

free -m

the report indicate the size of swapp partition.

Revision history for this message
David Nemeskey (nemeskeyd) wrote :

Hi tres86dx,

I tried your workaround, but it didn't work for me:

$ sudo ecryptfs-setup-swap

WARNING:
An encrypted swap is required to help ensure that encrypted files are not leaked to disk in an unencrypted format.

HOWEVER, THE SWAP ENCRYPTION CONFIGURATION PRODUCED BY THIS PROGRAM WILL BREAK HIBERNATE/RESUME ON THIS SYSTEM!

NOTE: Your suspend/resume capabilities will not be affected.

Do you want to proceed with encrypting your swap? [y/N]: y

INFO: Setting up swap: [/dev/sda6]
swapon: /dev/mapper/cryptswap1: stat failed: No such file or directory

$ free -m
             total used free shared buffers cached
Mem: 2004 1198 805 0 117 549
-/+ buffers/cache: 531 1472
Swap: 0 0 0

I had done everything by your comment up till then.

Revision history for this message
David Nemeskey (nemeskeyd) wrote :

I forgot to mention that I'm using 12.04.

Revision history for this message
tres86dx (tres86dx-ubuntu) wrote :

David:

I'm not an expert, I found this procedure by searching in Google. I had success in two computer one have 12.04.2. But both had the Home partition encrypted, because I choosed to do this during the installation. I don't remember If I have had the same warning that you. The first time I applied the procedure did not work because I dont restart the PC (the original web site where i read this not said anyting about restart the pc).

I hope somebody fixed this in the correct way. Apparently the problem happen because I installed ubuntu from a pendrive and choosed during the proccess to encrypt the home partition. The next time I reinstall the system I will do it from a DVD, because i began with this problem since I started using a pendrive.

Good luck!

Revision history for this message
Lee H (popov-ghost) wrote :

I'm using Ubuntu 12.04.3 (installed from USB), and also get the `/dev/mapper/cryptswap1 is not ready yet or not present` at bootup. I tried the steps outlined by tres86dx (and at http://punygeek.blogspot.co.uk/2012/10/ubuntu-1204-how-to-solve-disk-drive-for.html), yet I the message still persists at bootup. Nevertheless, if I do `swapon -s` or `free -m` the swap drive does seem to appear correctly...

Revision history for this message
Bug Reporter 11 (bugreporter11) wrote :

I believe this may be a better workaround. The workaround in comment #7 appears to remove encryption. Check this out instead:

http://askubuntu.com/a/236518

Pasted from the link above:

I happened to stumble upon this problem for 3 different releases of Ubuntu on two different computers. While most of the time the swap-partition was mounted despite the warning message, sometimes the GUI refused to start upon boot completion because of it.

Here's what I did as a workaround:

Open a terminal by pressing Ctrl + Alt + T.

Type gksudo gedit /etc/fstab and press Enter.

Search for the line that reads:

/dev/mapper/cryptswap1 none swap sw 0 0

Now enter the value noauto right after sw (separated by a comma), so it looks like this:

/dev/mapper/cryptswap1 none swap sw,noauto 0 0

Save and exit. This way, your swap partition won't be mounted while booting, thus the warning message won't appear or even hinder the login screen to appear.

Now type in a terminal

gksudo gedit /etc/rc.local

and enter the following lines before the entry exit 0:

sleep 10

swapon /dev/mapper/cryptswap1

If there's no entry exit 0, you'll have to enter it right beneath those two lines. Save and exit again. This will tell your system to wait 10 seconds after login to mount your encrypted swap partition.

Reboot your system. You should not get the warning message any longer. After login, wait some time, then open up a terminal again and type

free -m

Your output should look something like this:

    fuzzyq@Samsung-R710:~$ free -m

                  total used free shared buffers cached

     Mem: 3949 3806 143 0 86 1783

     -/+ buffers/cache: 1936 2013

     Swap: 4095 0 4095

    The last line is the important one. If there's a positive value showing for total swap, your swap partition was being mounted successfully.

Revision history for this message
tres86dx (tres86dx-ubuntu) wrote :

The bug is already fixed in ubuntu 16.04.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.