Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
howtos:slackware_admin:swapfile_hibernation [2012/12/01 14:26 (UTC)]
fl0 [Sources]
howtos:slackware_admin:swapfile_hibernation [2012/12/01 20:32 (UTC)] (current)
sycamorex Syntax cleanup
Line 2: Line 2:
 ====== Hibernation with LVM, LUKS and a Swapfile ​ ====== ====== Hibernation with LVM, LUKS and a Swapfile ​ ======
  
-With this How To you can use a swapfile ​instead a swap partition as described ​here: +With this How To you can use a swap file instead a swap partition as described [[http://​slackware.osuosl.org/​slackware-14.0/​README_CRYPT.TXT|here]].
-[[http://​slackware.osuosl.org/​slackware-14.0/​README_CRYPT.TXT]]+
  
-First create a swapfile: ​(you can choose another name and / or size if you want)+First create a swap file (you can choose another name and / or size if you want):
  
   dd if=/​dev/​zero of=/​swapfile bs=1M count=4096   dd if=/​dev/​zero of=/​swapfile bs=1M count=4096
   mkswap /​swapfile ​   mkswap /​swapfile ​
  
-Activate the Swap:+Activate the swap:
   swapon /swapfile   swapon /swapfile
  
-Check if the Swapfile ​is recognized by the system:+Check if the swap file is recognized by the system:
   cat /​proc/​swaps ​   cat /​proc/​swaps ​
   Filename ​                               Type            Size    Used    Priority   Filename ​                               Type            Size    Used    Priority
Line 22: Line 21:
  
  
-For suspend/​resume you need to append 2 kernel ​Parameter ​in /​etc/​lilo.conf resume and resume_offset.+For suspend/​resume you need to append 2 kernel ​parameter ​in /​etc/​lilo.conf resume and resume_offset.
  
-resume is the partition where the swapfile ​is located (e.g /dev/sda, /​dev/​cryptslack/​root) +''​resume'' ​is the partition where the swap file is located (e.g /dev/sda, /​dev/​cryptslack/​root) 
-resume_offset is the beginning of the swapfile ​on the resume partition, you can get the offset with+''​resume_offset'' ​is the beginning of the swap file on the resume partition, you can get the offset with:
   sudo /​sbin/​filefrag -v /swapfile | head -n -3 | tail -n 1 | awk ' {print $3 }'   sudo /​sbin/​filefrag -v /swapfile | head -n -3 | tail -n 1 | awk ' {print $3 }'
  
-your lilo entry should look like this:+Your ''​lilo'' ​entry should look like this:
   # Append any additional kernel parameters:   # Append any additional kernel parameters:
    ​append="​vt.default_utf8=1 resume=/​dev/​cryptslack/​root resume_offset=1134591"​    ​append="​vt.default_utf8=1 resume=/​dev/​cryptslack/​root resume_offset=1134591"​
Line 97: Line 96:
   patch < init-swapfile.patch   patch < init-swapfile.patch
  
-after successfull ​patching ,pack the initrd to /​boot/​initrd-swapfile.gz ​+After successful ​patching, pack the initrd to ''​/​boot/​initrd-swapfile.gz'':​
  
   find . -print0 | cpio -ov -0 --format=newc | gzip -9 > /​boot/​initrd-swapfile.gz   find . -print0 | cpio -ov -0 --format=newc | gzip -9 > /​boot/​initrd-swapfile.gz
  
-<​note>​recommend to test this initrd first with another ​bootentry</​note>​+<​note>​recommend to test this initrd first with another ​boot entry</​note>​
   image = /​boot/​vmlinuz   image = /​boot/​vmlinuz
   initrd = /​boot/​initrd-swapfile.gz   initrd = /​boot/​initrd-swapfile.gz
Line 109: Line 108:
  
  
-then you need to run lilo to save the changes+Then you need to run lilo to save the changes
   lilo   lilo
  
-after a reboot you can suspend to your swapfile ​as with your swap partition  +After a reboot you can suspend to your swap file as with your swap partition  
-<​note>​you need the reboot, suspend also uses resume_offset to find the swapfile</​note>​+<​note>​You need the reboot, suspend also uses resume_offset to find the swap file</​note>​
    
 ====== Sources ====== ====== Sources ======
-* [[https://​wiki.archlinux.org/​index.php/​Swap]]+  ​* [[https://​wiki.archlinux.org/​index.php/​Swap]]
  
-* [[https://​answers.launchpad.net/​ubuntu/​+source/​initramfs-tools/​+question/​193862]]+  ​* [[https://​answers.launchpad.net/​ubuntu/​+source/​initramfs-tools/​+question/​193862]]
  
  
-* Originally written by [[wiki:​user:​fl0]]+  ​* Originally written by [[wiki:​user:​fl0]]
  
 <!-- If you are copying information from another source, then specify that source --> <!-- If you are copying information from another source, then specify that source -->

In Other Languages
QR Code
QR Code howtos:slackware_admin:swapfile_hibernation (generated for current page)