€•)1Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ//translations/zh_CN/power/swsusp-and-swap-files”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ//translations/zh_TW/power/swsusp-and-swap-files”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ//translations/it_IT/power/swsusp-and-swap-files”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ//translations/ja_JP/power/swsusp-and-swap-files”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ//translations/ko_KR/power/swsusp-and-swap-files”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ//translations/sp_SP/power/swsusp-and-swap-files”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒ/Using swap files with software suspend (swsusp)”h]”hŒ/Using swap files with software suspend (swsusp)”…””}”(hh¨hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¦hh£hžhhŸŒI/var/lib/git/docbuild/linux/Documentation/power/swsusp-and-swap-files.rst”h KubhŒ block_quote”“”)”}”(hŒ)(C) 2006 Rafael J. Wysocki ”h]”hŒenumerated_list”“”)”}”(hhh]”hŒ list_item”“”)”}”(hŒ%2006 Rafael J. Wysocki ”h]”hŒ paragraph”“”)”}”(hŒ$2006 Rafael J. Wysocki ”h]”(hŒ2006 Rafael J. Wysocki <”…””}”(hhÊhžhhŸNh NubhŒ reference”“”)”}”(hŒ rjw@sisk.pl”h]”hŒ rjw@sisk.pl”…””}”(hhÔhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”Œrefuri”Œmailto:rjw@sisk.pl”uh1hÒhhÊubhŒ>”…””}”(hhÊhžhhŸNh Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h KhhÄubah}”(h]”h ]”h"]”h$]”h&]”uh1hÂhh¿ubah}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œ upperalpha”Œprefix”Œ(”Œsuffix”Œ)”Œstart”Kuh1h½hh¹ubah}”(h]”h ]”h"]”h$]”h&]”uh1h·hŸh¶h Khh£hžhubhÉ)”}”(hXÃThe Linux kernel handles swap files almost in the same way as it handles swap partitions and there are only two differences between these two types of swap areas: (1) swap files need not be contiguous, (2) the header of a swap file is not in the first block of the partition that holds it. From the swsusp's point of view (1) is not a problem, because it is already taken care of by the swap-handling code, but (2) has to be taken into consideration.”h]”hXÅThe Linux kernel handles swap files almost in the same way as it handles swap partitions and there are only two differences between these two types of swap areas: (1) swap files need not be contiguous, (2) the header of a swap file is not in the first block of the partition that holds it. From the swsusp’s point of view (1) is not a problem, because it is already taken care of by the swap-handling code, but (2) has to be taken into consideration.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Khh£hžhubhÉ)”}”(hX"In principle the location of a swap file's header may be determined with the help of appropriate filesystem driver. Unfortunately, however, it requires the filesystem holding the swap file to be mounted, and if this filesystem is journaled, it cannot be mounted during resume from disk. For this reason to identify a swap file swsusp uses the name of the partition that holds the file and the offset from the beginning of the partition at which the swap file's header is located. For convenience, this offset is expressed in units.”h]”hX&In principle the location of a swap file’s header may be determined with the help of appropriate filesystem driver. Unfortunately, however, it requires the filesystem holding the swap file to be mounted, and if this filesystem is journaled, it cannot be mounted during resume from disk. For this reason to identify a swap file swsusp uses the name of the partition that holds the file and the offset from the beginning of the partition at which the swap file’s header is located. For convenience, this offset is expressed in units.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Khh£hžhubhÉ)”}”(hŒ5In order to use a swap file with swsusp, you need to:”h]”hŒ5In order to use a swap file with swsusp, you need to:”…””}”(hj#hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Khh£hžhubh¾)”}”(hhh]”hÃ)”}”(hŒ±Create the swap file and make it active, eg.:: # dd if=/dev/zero of= bs=1024 count= # mkswap # swapon ”h]”(hÉ)”}”(hŒ.Create the swap file and make it active, eg.::”h]”hŒ-Create the swap file and make it active, eg.:”…””}”(hj8hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h Khj4ubhŒ literal_block”“”)”}”(hŒ}# dd if=/dev/zero of= bs=1024 count= # mkswap # swapon ”h]”hŒ}# dd if=/dev/zero of= bs=1024 count= # mkswap # swapon ”…””}”hjHsbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1jFhŸh¶h Khj4ubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÂhj1hžhhŸh¶h Nubah}”(h]”h ]”h"]”h$]”h&]”húŒarabic”hühhþhÿuh1h½hh£hžhhŸh¶h KubhÉ)”}”(hŒî2) Use an application that will bmap the swap file with the help of the FIBMAP ioctl and determine the location of the file's swap header, as the offset, in units, from the beginning of the partition which holds the swap file.”h]”hŒð2) Use an application that will bmap the swap file with the help of the FIBMAP ioctl and determine the location of the file’s swap header, as the offset, in units, from the beginning of the partition which holds the swap file.”…””}”(hjehžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K!hh£hžhubh¾)”}”(hhh]”hÃ)”}”(hŒzAdd the following parameters to the kernel command line:: resume= resume_offset= ”h]”(hÉ)”}”(hŒ9Add the following parameters to the kernel command line::”h]”hŒ8Add the following parameters to the kernel command line:”…””}”(hjzhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K&hjvubjG)”}”(hŒ=resume= resume_offset=”h]”hŒ=resume= resume_offset=”…””}”hjˆsbah}”(h]”h ]”h"]”h$]”h&]”jVjWuh1jFhŸh¶h K(hjvubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÂhjshžhhŸh¶h Nubah}”(h]”h ]”h"]”h$]”h&]”hújdhühhþhÿjKuh1h½hh£hžhhŸh¶h K&ubhÉ)”}”(hX?where is the partition on which the swap file is located and is the offset of the swap header determined by the application in 2) (of course, this step may be carried out automatically by the same application that determines the swap file's header offset using the FIBMAP ioctl)”h]”hXAwhere is the partition on which the swap file is located and is the offset of the swap header determined by the application in 2) (of course, this step may be carried out automatically by the same application that determines the swap file’s header offset using the FIBMAP ioctl)”…””}”(hj¢hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K*hh£hžhubhÉ)”}”(hŒOR”h]”hŒOR”…””}”(hj°hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K0hh£hžhubhÉ)”}”(hX+Use a userland suspend application that will set the partition and offset with the help of the SNAPSHOT_SET_SWAP_AREA ioctl described in Documentation/power/userland-swsusp.rst (this is the only method to suspend to a swap file allowing the resume to be initiated from an initrd or initramfs image).”h]”hX+Use a userland suspend application that will set the partition and offset with the help of the SNAPSHOT_SET_SWAP_AREA ioctl described in Documentation/power/userland-swsusp.rst (this is the only method to suspend to a swap file allowing the resume to be initiated from an initrd or initramfs image).”…””}”(hj¾hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K2hh£hžhubhÉ)”}”(hŒÐNow, swsusp will use the swap file in the same way in which it would use a swap partition. In particular, the swap file has to be active (ie. be present in /proc/swaps) so that it can be used for suspending.”h]”hŒÐNow, swsusp will use the swap file in the same way in which it would use a swap partition. In particular, the swap file has to be active (ie. be present in /proc/swaps) so that it can be used for suspending.”…””}”(hjÌhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h K8hh£hžhubhÉ)”}”(hŒôNote that if the swap file used for suspending is deleted and recreated, the location of its header need not be the same as before. Thus every time this happens the value of the "resume_offset=" kernel command line parameter has to be updated.”h]”hŒøNote that if the swap file used for suspending is deleted and recreated, the location of its header need not be the same as before. Thus every time this happens the value of the “resume_offset=†kernel command line parameter has to be updated.”…””}”(hjÚhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhŸh¶h KEnumerated list start value not ordinal-1: “C†(ordinal 3)”…””}”(hjzhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhjwubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œsource”h¶Œline”Kuh1juhh¹ubjv)”}”(hhh]”hÉ)”}”(hŒ:Enumerated list start value not ordinal-1: "3" (ordinal 3)”h]”hŒ>Enumerated list start value not ordinal-1: “3†(ordinal 3)”…””}”(hj–hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÈhj“ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”jŒsource”h¶Œline”Kuh1juhh£hžhhŸh¶h K&ubeŒtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.