LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 10-02-2013, 06:00 AM   #1
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,201

Rep: Reputation: 244Reputation: 244Reputation: 244
Problem resuming from suspend to disk with multiple swap partitions


Hello,

I have multiple swap partitions on different physical hard disks. Searching on the Internet showed no way to configure suspend to disk / resume in this case.

Finally I had to assemble my swaps into a RAID0 and use its UUID in the initrd. However, the init script in initrd needs a bit of change:
Code:
--- initrd-tree/init    2013-06-22 07:27:43.000000000 +0200
+++ initrd-tree.new/init        2013-10-02 12:28:22.042119407 +0200
@@ -282,6 +282,10 @@
   fi
   
   # Resume state from swap
+  if echo $RESUMEDEV | grep -q "LABEL=" || \
+     echo $RESUMEDEV | grep -q "UUID=" ; then
+    RESUMEDEV=$(findfs $RESUMEDEV)
+  fi
   if [ "$RESUMEDEV" != "" ]; then
     if ls -l $RESUMEDEV | grep -q "^l" ; then
       #RESUMEDEV=$(ls -l $RESUMEDEV | awk '{ print $NF }')
I have heard that running a swap on RAID0 is unwise. So I want to know is the way I set s2d up stupid? Is there a better way to do that?

BTW, My device names for swap may change sometimes. Sometimes they are sdaX and sdbY but sometimes they are sdbX and sdcY. So even without RAID, I have to use UUIDs for them.
 
Old 10-02-2013, 07:08 AM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by guanx View Post
I have heard that running a swap on RAID0 is unwise.
Can't comment on the rest, but at least on this. I wouldn't say it is stupid, but it is unnecessary and may complicate things. If you have multiple swap partitions on multiple disks the kernel internally will run them as RAID-0, which seems to be more transparent and may solve your issues with having to assemble the array first.
 
Old 10-02-2013, 08:57 AM   #3
guanx
Senior Member
 
Registered: Dec 2008
Posts: 1,201

Original Poster
Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by TobiSGD View Post
Can't comment on the rest, but at least on this. I wouldn't say it is stupid, but it is unnecessary and may complicate things. If you have multiple swap partitions on multiple disks the kernel internally will run them as RAID-0, which seems to be more transparent and may solve your issues with having to assemble the array first.
That would be the best but I don't know how.

How to resume from suspend-to-disk when I have multiple swaps? This was exactly the problem

Last edited by guanx; 10-02-2013 at 09:31 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Is it possible to use two swap partitions for multiple uses? texasone Linux - General 9 09-07-2011 06:32 AM
Wireless stops working after resuming from suspend to disk/ram piratesmack Slackware 9 12-25-2009 10:16 PM
Hibernate (suspend to disk) breaks swap alienDog Linux - General 4 07-21-2008 09:25 AM
Hibernate/suspend with two swap partitions ordealbyfire83 Linux - Hardware 8 07-30-2007 12:11 PM
Multiple swap partitions? [GOD]Anck Slackware 10 01-01-2004 11:00 PM

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

All times are GMT -5. The time now is 05:06 PM.

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