Fedora Linux Support Community & Resources Center
  #1  
Old 15th September 2013, 04:22 AM
nonamedotc Offline
Community Manager
 
Join Date: Mar 2011
Location: USA
Posts: 3,757
linuxfirefox
swap space on fstab not honoured in Fedora 20

Problem: Swap space shared between Debian Testing and Fedora 20 is detected in Debian but not detected in Fedora.

My Setup:

This is my Lenovo T500 which dual boots Debian Testing and Fedora 20. The hard disk setup is below.

Red text indicates partitions used exclusively by Debian Testing.

Blue Text indicates partitions used exclusively Fedora 20.

Shared swap space is in Magenta. This is shared by both Debian and Fedora.

Code:
# lsblk
NAME                                          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                                             8:0    0 465.8G  0 disk  
├─sda1                                          8:1    0   285M  0 part  
├─sda2                                          8:2    0  55.9G  0 part  

├─sda3                                          8:3    0   7.5G  0 part  
│ └─luks-UUID1 253:1    0   7.5G  0 crypt 

├─sda4                                          8:4    0     1K  0 part  
├─sda5                                          8:5    0   400M  0 part  /boot
└─sda6                                          8:6    0 401.8G  0 part  
  └─luks-UUID2 253:0    0 401.8G  0 crypt /
My /etc/fstab and /etc/crypttab show the correct entries.

fstab:
Code:
# cat /etc/fstab 

[ ... ]

/dev/mapper/luks-UUID2 /                       ext4    defaults,x-systemd.device-timeout=0 1 1
UUID=UUID-BOOT         /boot                   ext4    defaults        1 2
/dev/mapper/luks-UUID1 swap                    swap    defaults,x-systemd.device-timeout=0 0 0
crypttab:
Code:
# cat /etc/crypttab 
luks-UUID1 UUID=UUID1 none 
luks-UUID2 UUID=UUID2 none
I am able to enable swap using swapon -a but it does not survive reboots.

Code:
# swapon -a

# swapon -s
Filename				Type		Size	Used	Priority
/dev/dm-1                              	partition	7810044	0	-1
What can I do to enable swap space permanently? Thanks!
__________________
Fedora 21 x86_64 XFCE - Sager | Intel Core i7 - 4810 MQ | NVIDIA GeForce GTX 860M | 16 GB RAM | 1 TB 7200 RPM HDD |
Scientific Linux 7 x86_64 XFCE - Thinkpad T520 | Intel Core i7 - 2630 QM | NVIDIA NVS 4200M | 16 GB RAM | 500 GB 7200 RPM HDD |


The Linux Documentation Project | Fedora Documentation
  #2  
Old 15th September 2013, 05:09 AM
flyingfsck Offline
Registered User
 
Join Date: Aug 2010
Location: Al Ain, UAE
Posts: 1,845
linuxfirefox
Re: swap space on fstab not honoured in Fedora 20

Howdy,

It appears to me as if you have your swap partition on a LUKS partition, which is weird (and probably a bit inefficient). Therefore, you have to start swap after booting LUKS.

You will probably have to put the swapon -a command in rc.local or some such, putting it in fstab will be too early.
  #3  
Old 15th September 2013, 05:50 AM
SlowJet Offline
Registered User
 
Join Date: Jan 2005
Posts: 5,048
linuxfirefox
Re: swap space on fstab not honoured in Fedora 20

In the fstab,
please explain the use of /dev/mapper ;

because I would use /dev/luks-UUID2 swap.

Unless that is needed by crypt???

SJ
__________________
Do the Math
  #4  
Old 15th September 2013, 06:38 AM
nonamedotc Offline
Community Manager
 
Join Date: Mar 2011
Location: USA
Posts: 3,757
linuxfirefox
Re: swap space on fstab not honoured in Fedora 20

Quote:
Originally Posted by flyingfsck View Post
Howdy,

It appears to me as if you have your swap partition on a LUKS partition, which is weird (and probably a bit inefficient). Therefore, you have to start swap after booting LUKS.

You will probably have to put the swapon -a command in rc.local or some such, putting it in fstab will be too early.
Hi! Yes. I am using cryptsetup and both / and swap are encrypted. I can definitely try putting it in rc.local and try but I must add that I have the same setup in F19 also - which I works without problems.

Also, when setting up this partition, if swap is not encrypted, I have seen some warnings and have also read about data leakage, etc.

Quote:
Originally Posted by SlowJet View Post
In the fstab,
please explain the use of /dev/mapper ;

because I would use /dev/luks-UUID2 swap.

Unless that is needed by crypt???

SJ
Hi! As far as I know - cryptsetup uses /dev/mapper. I am not sure if this is what affects this though. Again - because my F19 has exactly the same fstab and crypttab as my F20 with the exceptions of UUIDs.

Thanks for replies flyingfsck, Slowjet!
__________________
Fedora 21 x86_64 XFCE - Sager | Intel Core i7 - 4810 MQ | NVIDIA GeForce GTX 860M | 16 GB RAM | 1 TB 7200 RPM HDD |
Scientific Linux 7 x86_64 XFCE - Thinkpad T520 | Intel Core i7 - 2630 QM | NVIDIA NVS 4200M | 16 GB RAM | 500 GB 7200 RPM HDD |


The Linux Documentation Project | Fedora Documentation
  #5  
Old 15th September 2013, 10:55 PM
Gareth Jones Offline
Official Gnome 3 Sales Rep. (and Adminstrator)
 
Join Date: Jul 2011
Location: Birmingham, UK
Age: 31
Posts: 2,765
linuxfirefox
Re: swap space on fstab not honoured in Fedora 20

Quote:
Originally Posted by flyingfsck View Post
It appears to me as if you have your swap partition on a LUKS partition, which is weird (and probably a bit inefficient).
Actually it’s completely normal. Unencrypted swap effectively negates the benefit of any encrypted file-systems, and Fedora handles encrypted swap just fine.

Did you remember to regenerate the initramfs images after setting up swap in /etc/fstab and /etc/crypttab?
Code:
dracut -f --regenerate-all
  #6  
Old 15th September 2013, 11:02 PM
Gareth Jones Offline
Official Gnome 3 Sales Rep. (and Adminstrator)
 
Join Date: Jul 2011
Location: Birmingham, UK
Age: 31
Posts: 2,765
linuxfirefox
Re: swap space on fstab not honoured in Fedora 20

Quote:
Originally Posted by SlowJet View Post
In the fstab,
please explain the use of /dev/mapper ;

because I would use /dev/luks-UUID2 swap.

Unless that is needed by crypt???
dmcrypt/LUKS, dmraid and LVM all use the device mapper. The device mapper nodes are /dev/dm-*, but there are aliases with more useful names in /dev/mapper, e.g. /dev/mapper/luks-UUID for LUKS (usually), or /dev/mapper/volgroup-logicalvol for LVM (although LVM also creates /dev/volgroup/logicalvol too).

/dev/luks-* is almost certainly wrong.
  #7  
Old 15th September 2013, 11:11 PM
nonamedotc Offline
Community Manager
 
Join Date: Mar 2011
Location: USA
Posts: 3,757
linuxfirefox
Re: swap space on fstab not honoured in Fedora 20

Yes Gareth. Did that and tried that again. No use at all.

Also, I just noticed something - this problem does not appear on unencrypted filesystems. In my Virtualbox installation, no problems with swap!

Another observation - This happens whether the installation is dual boot or not. So, it appears Debian dual boot is not a problem at all.




P.S. Another minor problem - XFCE does not seem to remember session!
__________________
Fedora 21 x86_64 XFCE - Sager | Intel Core i7 - 4810 MQ | NVIDIA GeForce GTX 860M | 16 GB RAM | 1 TB 7200 RPM HDD |
Scientific Linux 7 x86_64 XFCE - Thinkpad T520 | Intel Core i7 - 2630 QM | NVIDIA NVS 4200M | 16 GB RAM | 500 GB 7200 RPM HDD |


The Linux Documentation Project | Fedora Documentation
  #8  
Old 15th September 2013, 11:19 PM
Gareth Jones Offline
Official Gnome 3 Sales Rep. (and Adminstrator)
 
Join Date: Jul 2011
Location: Birmingham, UK
Age: 31
Posts: 2,765
linuxfirefox
Re: swap space on fstab not honoured in Fedora 20

I just noticed that you’re using F20 rather than F19, so this could be a bug that I’m not seeing.

One last suggestion, what does the GRUB_CMDLINE_LINUX parameter in /etc/default/grub look like? It should include something like “… rd.luks.uuid=UUID2 …”, assuming that it works similarly to F19.

This might turn out to be worth a Bugzilla.
  #9  
Old 16th September 2013, 12:08 AM
nonamedotc Offline
Community Manager
 
Join Date: Mar 2011
Location: USA
Posts: 3,757
linuxfirefox
Re: swap space on fstab not honoured in Fedora 20

Yup! GRUB_CMDLINE_LINUX also has the rd.luks.uuid line correctly (indentical to F19).

I am also not seeing any problem in F19 - only in F20!

Code:
$ cat /etc/default/grub 
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.luks.uuid=luks-UUID1 vconsole.font=latarcyrheb-sun16 rd.luks.uuid=luks-UUID2 vconsole.keymap=us $([ -x /usr/sbin/rhcrashkernel-param ] && /usr/sbin/rhcrashkernel-param || :) rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
I have also posted this problem on test mailing list. If nothing turns up, I will file a bug report!

Thanks Gareth.
__________________
Fedora 21 x86_64 XFCE - Sager | Intel Core i7 - 4810 MQ | NVIDIA GeForce GTX 860M | 16 GB RAM | 1 TB 7200 RPM HDD |
Scientific Linux 7 x86_64 XFCE - Thinkpad T520 | Intel Core i7 - 2630 QM | NVIDIA NVS 4200M | 16 GB RAM | 500 GB 7200 RPM HDD |


The Linux Documentation Project | Fedora Documentation
 

Tags
debian, dual boot, fedora, fedora 20, fstab, honoured, space, swap

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Swap space after Fedora installation ! eaglelinux Using Fedora 4 14th May 2013 10:06 PM
Fedora 16 boots slow because of extra swap line in /etc/fstab Jeff72 Guides & Solutions (No Questions) 3 16th December 2011 10:04 AM
why fedora uses swap space??? Nyan Using Fedora 2 9th December 2009 02:04 PM
invalid swap space in fstab JamesBenson Using Fedora 9 7th February 2006 02:44 PM
crashing swap space or swap command ? mnisay Servers & Networking 2 18th January 2006 04:01 PM


Current GMT-time: 01:55 (Tuesday, 02-09-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat