LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-14-2016, 05:38 PM   #1
Tonus
Senior Member
 
Registered: Jan 2007
Location: Paris, France
Distribution: Slackware-15.0
Posts: 1,405
Blog Entries: 3

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
Two swap partitions ?


Hi all,

I upgraded my laptop with a half-sized ssd and was wondering about swap :
I want hability to hibernate
I don't want to harm the ssd

Since I think it would be faster to resume from ssd, I am wondering if I could use a swap partition for hibernation and another one for usual swap.

For now I reduced swappiness to 20 and use the ssd.

Any advice about how you do or would do would be great.

Regards
 
Old 03-14-2016, 06:14 PM   #2
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Unless you're constrained for space on the SSD, I would keep your swap on there just for the performance boost. It's what I do. Modern SSDs are not as fragile as they're made out to be. See the following thread for more information. My posts cover a number of points, including crazy SSD testing performed by techreport that showed that SSD drives will far out-surpass your expectations for cell write capability.

http://www.linuxquestions.org/questi...sd-4175526275/
 
Old 03-14-2016, 06:31 PM   #3
bl0tt0
Member
 
Registered: Aug 2005
Location: The Glorious People's Republic of Austin
Posts: 178

Rep: Reputation: 62
bassmadrigal's advice is sound, but way back in the way back, partially for curiosity's sake, I did go ahead and set up two separate swaps for hibernation and regular use. It requires a little bit of customization of the hibernate scripts, but you can do it. First, I set up the swap partitions in /etc/fstab as follows:

Code:
/dev/luksdisk/swap      swap    swap    defaults,pri=2  0 0
/dev/slackcrypt/swap    swap    swap    defaults,noauto,pri=0   0 0
The first line is the swap partition on the spindle and platter disk, and the pri=2 value gives it a higher priority when both partitions are active. That way anything that may need to be swapped out while both partitions are active will be more likely to wind up on that partition. The noauto option on the second line keeps the SSD swap partition from being activated on boot.I then set up a custom hibernate script that explicitly activates the SSD swap and deactivates the platter partition prior to 'echo "disk" > /sys/power/state'. Then, after the system wakes up, I activate the platter swap partition and deactivate the SSD one. There's probably a way to tie all of that into the pm-utils stack with some custom hooks, but I haven't really taken the time to completely wrap my head around all of that, and my way works for me at the moment
 
Old 03-14-2016, 06:46 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
I have just added a pi 3 to my mix - 32G sdcard. I simply set swappiness to 1. Not that this will be hibernating, but I also wouldn't worry about the SSD in your case.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
one or more swap partitions marcelinul Linux - Desktop 3 02-14-2008 03:13 AM
Swap and Partitions in 10.2 ian_x SUSE / openSUSE 3 08-31-2007 11:43 PM
/ and swap partitions (but want more) How to? acummings Slackware 3 07-17-2004 12:33 AM
swap partitions chappy011 Linux - Newbie 2 03-18-2002 01:44 PM
swap partitions rakemup Linux - Software 5 12-10-2001 09:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration