LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware64 14 suspend to disk with swapfile broken (http://www.linuxquestions.org/questions/slackware-14/slackware64-14-suspend-to-disk-with-swapfile-broken-4175439360/)

fl0 11-29-2012 03:45 PM

Slackware64 14 suspend to disk with swapfile broken
 
Hi,

i have set up a swapfile instead a swap partition on a fresh slackware64 14.0 system

Code:

root@orion7:~# dd if=/dev/zero of=/swapfile bs=1M count=4096
root@orion7:~# mkswap /swapfile
Setting up swapspace version 1, size = 4194300 KiB
no label, UUID=55751e8f-2792-43c8-98ff-0fae10b7834e
root@orion7:~# swapon /swapfile
root@orion7:~# cat /proc/swaps
Filename                                Type            Size    Used    Priority
/swapfile                              file            4194300 0      -1

if i try suspend to disk, is not working, dmesg says:

Code:

[ 2213.764376] PM: thaw of devices complete after 345.673 msecs
[ 2213.765505] PM: Using 1 thread(s) for compression.
[ 2213.765509] PM: Compressing and saving image data (268449 pages) ... done
[ 2221.439687] PM: Wrote 1073796 kbytes in 7.67 seconds (139.99 MB/s)
[ 2221.440114] PM: S
[ 2221.463504] PM: Swap header not found!
[ 2221.463506] |
[ 2221.596333] Restarting tasks ... done.


do i miss something?


regards fl0

H_TeXMeX_H 11-30-2012 09:22 AM

If you want to resume from a swap file, you need an extra kernel parameter, see:
https://wiki.archlinux.org/index.php..._file_resuming
Yes, I know it's the Arch wiki in the Slackware forum, but it's a good explanation.

fl0 11-30-2012 09:51 AM

Quote:

Originally Posted by H_TeXMeX_H (Post 4840215)
If you want to resume from a swap file, you need an extra kernel parameter, see:
https://wiki.archlinux.org/index.php..._file_resuming
Yes, I know it's the Arch wiki in the Slackware forum, but it's a good explanation.

yes i already found that thx.

according to
http://git.kernel.org/?p=linux/kerne...2d0319;hb=HEAD
and
http://git.kernel.org/?p=linux/kerne...af9527;hb=HEAD
and
http://suspend.sourceforge.net/

there are some more pitfalls, like LVM and initramfs usage (i use both), so i think i will use a swap partition, its much easier.
The only reason i would use a swapfile , i assumed it was easier.....

regards fl0

fl0 11-30-2012 12:19 PM


Ok i finally got it working.
..maybe i have misunderstood the kernel docs, or they are not correct.

It is a dirty hack, but works, later i write a How To at docs.slackware.com but here is the short version

- patch initrd to understand resume_offset and find the right resume device
- patch mkinitrd to write resume_offset information to the initrd image

regards fl0

fl0 12-01-2012 07:36 AM

Here is the How To;

http://docs.slackware.com/howtos:sla...and_a_swapfile

regards fl0


All times are GMT -5. The time now is 11:12 AM.