LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Problem resuming from suspend to disk with multiple swap partitions (http://www.linuxquestions.org/questions/slackware-14/problem-resuming-from-suspend-to-disk-with-multiple-swap-partitions-4175479309/)

guanx 10-02-2013 06:00 AM

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.

TobiSGD 10-02-2013 07:08 AM

Quote:

Originally Posted by guanx (Post 5038509)
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.

guanx 10-02-2013 08:57 AM

Quote:

Originally Posted by TobiSGD (Post 5038544)
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 :confused:


All times are GMT -5. The time now is 01:46 AM.