Lines Matching +full:suspend +full:- +full:to +full:- +full:disk

2 How to use dm-crypt and swsusp together
10 You know how dm-crypt works. If not, visit the following web page:
11 http://www.saout.de/misc/dm-crypt/
13 You did read Documentation/admin-guide/initrd.rst and know how an initrd works.
14 You know how to create or how to modify an initrd.
16 Now your system is properly set up, your disk is encrypted except for
21 At this point you want to encrypt your swap, too. Still you want to
22 be able to suspend using swsusp. This, however, means that you
23 have to be able to either enter a passphrase or that you read
24 the key(s) from an external device like a pcmcia flash disk
25 or an usb stick prior to resume. So you need an initrd, that sets
26 up dm-crypt and then asks swsusp to resume from the encrypted
29 The most important thing is that you set up dm-crypt in such
30 a way that the swap device you suspend to/resume from has
32 within your running system. The easiest way to achieve this is
33 to always set up this swap device first with dmsetup, so that
36 brw------- 1 root root 254, 0 Jul 28 13:37 /dev/mapper/swap0
38 Now set up your kernel to use /dev/mapper/swap0 as the default
43 Prepare your boot loader to use the initrd you will create or
52 Finally you need to create or modify your initrd. Lets assume
53 you create an initrd that reads the required dm-crypt setup
54 from a pcmcia flash disk card. The card is formatted with an ext2
66 pcmcia flash disk. What follows now is a /linuxrc for your
67 initrd that allows you to resume from encrypted swap and that
76 noresume=`grep -c noresume /proc/cmdline`
81 dmesg -n 1
82 /sbin/cardmgr -q
85 if [ -f /proc/ide/hde/media ]
88 mount -t ext2 -o ro /dev/hde1 /mnt
89 if [ -f /mnt/swapkey ]
99 dmesg -n 6
115 umount -l /mnt
121 First we have to decide if we want to try to resume, or not.
125 Then we need to set up dmcrypt with the setup data from the
126 pcmcia flash disk. If this succeeds we need to reset the swap
127 device if we don't want to resume. The line "echo 254:0 > /sys/power/resume"
128 then attempts to resume from the first device mapper device.
129 Note that it is important to set the device in /sys/power/resume,
130 regardless if resuming or not, otherwise later suspend will fail.
133 Otherwise we just remove the encrypted swap device and leave it to the
134 mini system on /dev/hda1 to set the whole crypto up (it is up to
135 you to modify this to your taste).
137 What then follows is the well known process to change the root
138 file system and continue booting from there. I prefer to unmount
139 the initrd prior to continue booting but it is up to you to modify