创建文件:

# fallocate -l 4G /swapfile

# chmod 600 /swapfile

# mkswap /swapfile
# swapon /swapfile

编辑/etc/fstab文件。添加:/swapfile none swap defaults 0 0

编辑/etc/mkinitcpio.conf文件:
HOOKS="... block lvm2 resume filesystems ..."
# mkinitcpio -p linux

# filefrag -v /swapfile

查找偏移指针:

Filesystem type is: ef53
File size of /swapfile is 4294967296 (1048576 blocks of 4096 bytes)
ext: logical_offset: physical_offset: length: expected: flags:
0: 0.. 0: .. 38912: 1:
1: 1.. 22527: 38913.. 61439: 22527: unwritten
2: 22528.. 53247: 899072.. 929791: 30720: 61440: unwritten

# ls -l /dev/disk/by-uuid/ 查看swapfile文件所在盘的UUID。
lrwxrwxrwx 1 root root 10 Aug  8 19:22 415bb7cf-5a71-4481-a832-c789643ce12c -> ../../sda4

GRUB配置:

# vim /etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="resume=/dev/disk/by-uuid/415bb7cf-5a71-4481-a832-c789643ce12c resume_offset= quiet"

参考:https://wiki.archlinux.org/index.php/Hibernate#Hibernation_into_swap_file

https://wiki.archlinux.org/index.php/Swap#Swap_file

Arch Linux 休眠到文件的更多相关文章

  1. Arch Linux PDF格式文件无法显示中文

    From: http://blog.sina.com.cn/s/blog_5e54bc6801012gfg.html $ sudo pacman -S poppler-data

  2. Arch Linux VMware虚拟机(新手)安装教程

    准备工作: 下载好Arch Linux的镜像文件    百度打开Arch官网点击download(下载)转到下载界面,点击磁力下载或者种子下载(官网默认是英文,英文不好的童鞋可以安装浏览器翻译插件,本 ...

  3. Arch Linux 的休眠设置

    https://wiki.archlinux.org/index.php/Power_management/Suspend_and_hibernate_(简体中文)https://wiki.archl ...

  4. Arch Linux 安装、配置、美化和优化

    国庆假期玩了下Arch Linux,发现这货跟Ubuntu之流相差甚远,甚难调教,而且安裝过程全命令行,会有各种问题,各种知识... --- 安装引导器--- -------------------- ...

  5. 把Arch Linux安装到U盘上的具体教程

    Arch Linux简介 Arch Linux(或称Arch)是一种以轻量简洁为设计理念的Linux发行版.其开发团队秉承简洁.优雅.正确和代码最小化的设计宗旨.Arch Linux 项目受 CRUX ...

  6. Arch Linux 简易打包指南

    本文时代久远,请参阅更可靠的:Arch User Repository (简体中文) - 分享和维护软件包 这两天给 Kreogist µ 打 Arch Linux 包,照着 wiki 跟着搞,同时在 ...

  7. Arch Linux Installation Guide

    Arch Linux Installation Guide   timedatectl set-ntp true   sed -i '/Score/{/China/!{n;s/^/#/}}' /etc ...

  8. Linux内核Makefile文件(翻译自内核手册)

    --译自Linux3.9.5 Kernel Makefiles(内核目录documention/kbuild/makefiles.txt) kbuild(kernel build) 内核编译器 Thi ...

  9. 如何在 Arch Linux 的终端里设定 WiFi 网络

    如果你使用的是其他 Linux 发行版 而不是 Arch CLI,那么可能会不习惯在终端里设置 WiFi.尽管整个过程有点简单,不过我还是要讲一下.在这篇文章里,我将带领新手们通过一步步的设置向导,把 ...

随机推荐

  1. jquery的$.extend和$.fn.extend作用及区别

    jQuery为开发插件提拱了两个方法,分别是: jQuery.fn.extend(); jQuery.extend(); (1)类级别 类级别你可以理解为拓展jquery类,最明显的例子是$.ajax ...

  2. ASP.NET MV3 部署网站 报"Could not load file or assembly ' System.Web.Helpers “ 错的解决方法

    转自:http://www.cnblogs.com/taven/archive/2011/08/14/2138077.html 国内很多网站空间都只支持.NET 2.0 和 .NET 3.0 3.5, ...

  3. Spring boot配合Spring session(redis)遇到的错误

    背景:本MUEAS项目,一开始的时候,是没有引入redis的,考虑到后期性能的问题而引入.之前没有引用redis的时候,用户登录是正常的.但是,在加入redis支持后,登录就出错!错误如下: . __ ...

  4. SPOJ #440. The Turtle´s Shortest Path

    Coding a Dijkstra is not hard. %70 of my time spent on tackling TLE, as my last post. Dijkstra works ...

  5. 【LVM】LVM自动扩容脚本

    概要说明: /dev/mapper/vg0-data挂载在目录/data下: 当新增物理磁盘时,需要自动对/dev/mapper/vg0-data磁盘时进行扩容(自动化脚本): 当新增物理磁盘时,自动 ...

  6. bzoj2289: 【POJ Challenge】圆,圆,圆

    Description 1tthinking随便地画了一些圆. ftiasch认为这些圆有交集(面积非零)的可能性不大.因为他实在画了太多圆,所以你被请来判断是否存在交集. Input 第1行,一个整 ...

  7. Enable EPEL Repository for RHEL/CentOS 7.x/6.x/5.x

    This howto guide shows you’ll how to enable EPEL repository under RHEL/CentOS 6/5 to install additio ...

  8. android学习笔记四

    TextView.Button.CheckBox.RadoiButton.EditView.ImageButton.ToogleButton——略 AnalogClock.DigitalClock = ...

  9. android studio使用发布者证书调试

    某些时候还是要用到的,直接说步骤,修改app.gradle apply plugin: 'com.android.application' android { .................... ...

  10. 25. Reverse Nodes in k-Group

    Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If ...