diff options
Diffstat (limited to 'Documentation/power/swsusp.txt')
-rw-r--r-- | Documentation/power/swsusp.txt | 51 |
1 files changed, 44 insertions, 7 deletions
diff --git a/Documentation/power/swsusp.txt b/Documentation/power/swsusp.txt index b28b7f04abb8..d7814a113ee1 100644 --- a/Documentation/power/swsusp.txt +++ b/Documentation/power/swsusp.txt | |||
@@ -17,6 +17,11 @@ Some warnings, first. | |||
17 | * but it will probably only crash. | 17 | * but it will probably only crash. |
18 | * | 18 | * |
19 | * (*) suspend/resume support is needed to make it safe. | 19 | * (*) suspend/resume support is needed to make it safe. |
20 | * | ||
21 | * If you have any filesystems on USB devices mounted before suspend, | ||
22 | * they won't be accessible after resume and you may lose data, as though | ||
23 | * you have unplugged the USB devices with mounted filesystems on them | ||
24 | * (see the FAQ below for details). | ||
20 | 25 | ||
21 | You need to append resume=/dev/your_swap_partition to kernel command | 26 | You need to append resume=/dev/your_swap_partition to kernel command |
22 | line. Then you suspend by | 27 | line. Then you suspend by |
@@ -27,19 +32,18 @@ echo shutdown > /sys/power/disk; echo disk > /sys/power/state | |||
27 | 32 | ||
28 | echo platform > /sys/power/disk; echo disk > /sys/power/state | 33 | echo platform > /sys/power/disk; echo disk > /sys/power/state |
29 | 34 | ||
35 | . If you have SATA disks, you'll need recent kernels with SATA suspend | ||
36 | support. For suspend and resume to work, make sure your disk drivers | ||
37 | are built into kernel -- not modules. [There's way to make | ||
38 | suspend/resume with modular disk drivers, see FAQ, but you probably | ||
39 | should not do that.] | ||
40 | |||
30 | If you want to limit the suspend image size to N bytes, do | 41 | If you want to limit the suspend image size to N bytes, do |
31 | 42 | ||
32 | echo N > /sys/power/image_size | 43 | echo N > /sys/power/image_size |
33 | 44 | ||
34 | before suspend (it is limited to 500 MB by default). | 45 | before suspend (it is limited to 500 MB by default). |
35 | 46 | ||
36 | Encrypted suspend image: | ||
37 | ------------------------ | ||
38 | If you want to store your suspend image encrypted with a temporary | ||
39 | key to prevent data gathering after resume you must compile | ||
40 | crypto and the aes algorithm into the kernel - modules won't work | ||
41 | as they cannot be loaded at resume time. | ||
42 | |||
43 | 47 | ||
44 | Article about goals and implementation of Software Suspend for Linux | 48 | Article about goals and implementation of Software Suspend for Linux |
45 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 49 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
@@ -333,4 +337,37 @@ init=/bin/bash, then swapon and starting suspend sequence manually | |||
333 | usually does the trick. Then it is good idea to try with latest | 337 | usually does the trick. Then it is good idea to try with latest |
334 | vanilla kernel. | 338 | vanilla kernel. |
335 | 339 | ||
340 | Q: How can distributions ship a swsusp-supporting kernel with modular | ||
341 | disk drivers (especially SATA)? | ||
342 | |||
343 | A: Well, it can be done, load the drivers, then do echo into | ||
344 | /sys/power/disk/resume file from initrd. Be sure not to mount | ||
345 | anything, not even read-only mount, or you are going to lose your | ||
346 | data. | ||
347 | |||
348 | Q: How do I make suspend more verbose? | ||
349 | |||
350 | A: If you want to see any non-error kernel messages on the virtual | ||
351 | terminal the kernel switches to during suspend, you have to set the | ||
352 | kernel console loglevel to at least 5, for example by doing | ||
353 | |||
354 | echo 5 > /proc/sys/kernel/printk | ||
355 | |||
356 | Q: Is this true that if I have a mounted filesystem on a USB device and | ||
357 | I suspend to disk, I can lose data unless the filesystem has been mounted | ||
358 | with "sync"? | ||
359 | |||
360 | A: That's right. It depends on your hardware, and it could be true even for | ||
361 | suspend-to-RAM. In fact, even with "-o sync" you can lose data if your | ||
362 | programs have information in buffers they haven't written out to disk. | ||
363 | |||
364 | If you're lucky, your hardware will support low-power modes for USB | ||
365 | controllers while the system is asleep. Lots of hardware doesn't, | ||
366 | however. Shutting off the power to a USB controller is equivalent to | ||
367 | unplugging all the attached devices. | ||
368 | |||
369 | Remember that it's always a bad idea to unplug a disk drive containing a | ||
370 | mounted filesystem. With USB that's true even when your system is asleep! | ||
371 | The safest thing is to unmount all USB-based filesystems before suspending | ||
372 | and remount them after resuming. | ||
336 | 373 | ||