[SOLVED] How hibernate to file. Swap?

Get help with KDE4 specific problems
Post Reply
User avatar
Slaxmax
Contributor
Contributor
Posts: 403
Joined: 03 Jan 2013, 09:51
Distribution: KDE4
Location: Campinas Brazil https://goo.gl/yrxwKi

[SOLVED] How hibernate to file. Swap?

Post#1 by Slaxmax » 08 Jun 2014, 18:58

How hibernate to file. Swap?

I have tried but did not work
example
mkfileswap /mnt/sda2/swapfile.swap 6000

and activate it through rc.local:
swapon /mnt/sda2/swapfile.swap

I run free -m
shows the swap but not hibernate

thanks
Last edited by Slaxmax on 09 Jun 2014, 19:34, edited 1 time in total.
“DNA is like a computer program but far, far more advanced than any software ever created.”
― Bill Gates, The Road Ahead

User avatar
fanthom
Site Admin
Site Admin
Posts: 4565
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: How hibernate to file. Swap?

Post#2 by fanthom » 09 Jun 2014, 09:21

in order to return from hibernation you have to add 'resume=/dev/sdXY' cheatcode where /dev/SDXY is your swap partition.
when you are using swap file then you have to find it's location and provide additional cheatcode: 'resume_offset='

please follow these docs for details:
http://ubuntuforums.org/showthread.php?t=1042946
https://wiki.archlinux.org/index.php/Su ... _swap_file

note: i havent try this myself.
Please add [Solved] to your thread title if the solution was found.

User avatar
Slaxmax
Contributor
Contributor
Posts: 403
Joined: 03 Jan 2013, 09:51
Distribution: KDE4
Location: Campinas Brazil https://goo.gl/yrxwKi

Re: How hibernate to file. Swap?

Post#3 by Slaxmax » 09 Jun 2014, 19:26

Thanks fanthom
Works fine now!

1 - Make .swap file
example swap file 6GB:
mkfileswap /mnt/sda2/.swapfile.swap 6000

2 - Activate .swap file in rc.local
add this line
swapon /mnt/sda2/.swapfile.swap

3 - run command (example)

Code: Select all

root@porteus:/home/guest# filefrag -v /mnt/sda2/.swapfile.swap 
Filesystem type is: ef53
File size of /mnt/sda2/.swapfile.swap is 6291456000 (487424 blocks of 4096 bytes)
 ext:     logical_offset:        physical_offset: length:   expected: flags:
   0:        0..   32767:   10940416..  10973183:  32768:
take offset number 10940416 in line 0

4 - Change porteus.cfg
add cheatcode
resume=/dev/sda2 resume_offset=10940416
example my porteus.cfg

Code: Select all

LABEL kde
MENU LABEL Graphics mode (KDE4)
KERNEL vmlinuz
APPEND initrd=initrd.xz fsck changes=/porteus resume=/dev/sda2 resume_offset=10940416
TEXT HELP
    Run Porteus the best way we can.
    Try to autoconfigure graphics
    card and use the maximum
    allowed resolution
ENDTEXT
reboot and test

Works fine! :Yahoo!:

One more time thanks fanthom :good:
“DNA is like a computer program but far, far more advanced than any software ever created.”
― Bill Gates, The Road Ahead

Post Reply