Suspend/hibernate
From Arnout Engelen
Contents |
[edit] A mounted FS on an USB disk
Normally, an USB disk will not survive suspending/resuming. This means the disk needs to be unmounted before hibernating, which means any applications using it must be closed. That is annoying.
However, 'network filesystems' like samba/cifs shares can be mounted, and those do survive reboots of the fileserver. Thus, I decided to 'serve' my USB disk to the local host. When going into hibernate, I'm doing the following:
- shutdown samba server
- unmount disk
- hibernate
- mount disk
- start samba server
- resume working as normal.
[edit] How to do it
- To have the samba server started/stopped, I added it to the MODULES in /etc/defaults/acpi-support
- To unmount the disk when suspending, I added a '67-usbdisk.sh' to my /etc/acpi/suspend.d
- To mount the disk when resuming, I added a '95-usbdisk.sh' to my /etc/acpi/resume.d
That's all there was to it!
[edit] Other solutions
[edit] lowlevel
A lower-level solution might be http://lwn.net/Articles/198333/
[edit] Coda
I also considered using Coda as a filesystem, but for a 40g disk it'd require a 1.6g rvm metadata file - and 1.6g of memory! that's way too much for my purposes.
[edit] Root fs on the usb disk
Suspend/hibernate to disk doesn't work when the root fs is on the usb disk.
[edit] nobody cared: acpi
After suspending, dmesg reports the following:
[ 113.106610] ACPI handle has no context! [ 113.106864] [drm] nouveau 0000:01:00.0: Disabling fbcon acceleration... [ 113.106866] [drm] nouveau 0000:01:00.0: Unpinning framebuffer(s)... [ 113.106893] [drm] nouveau 0000:01:00.0: Evicting buffers... [ 113.106898] pci 0000:00:1f.3: PCI INT C disabled [ 113.107287] ACPI handle has no context! [ 113.111919] ACPI handle has no context! [ 113.138647] ehci_hcd 0000:00:1a.0: PCI INT A disabled [ 113.138650] ehci_hcd 0000:00:1d.0: PCI INT A disabled [ 113.212197] HDA Intel 0000:00:1b.0: PCI INT A disabled [ 113.473766] e1000e 0000:00:19.0: PCI INT A disabled [ 113.473777] e1000e 0000:00:19.0: PME# enabled [ 113.473786] e1000e 0000:00:19.0: wake-up capability enabled by ACPI [ 113.550013] HDA Intel 0000:01:00.1: PCI INT A disabled [ 113.550110] ACPI handle has no context! [ 114.873404] [drm] nouveau 0000:01:00.0: Idling channels... [ 114.873420] [drm] nouveau 0000:01:00.0: Suspending GPU objects... [ 115.253488] [drm] nouveau 0000:01:00.0: And we're gone! [ 115.253518] nouveau 0000:01:00.0: PCI INT A disabled [ 115.268027] PM: suspend of devices complete after 2232.425 msecs [ 115.300003] PM: late suspend of devices complete after 32.022 msecs [ 115.302555] ACPI: Preparing to enter system sleep state S3 [ 115.320503] Disabling non-boot CPUs ... [ 115.486914] CPU 1 is now offline [ 115.540130] CPU 2 is now offline [ 115.706565] CPU 3 is now offline [ 115.706568] SMP alternatives: switching to UP code [ 115.710112] Extended CMOS year: 2000 [18446744059.003087] ACPI Error: Hardware did not change modes (20100121/hwacpi-144) [18446744059.003092] ACPI Error: Could not transition to ACPI mode (20100121/evxfevnt-93) [18446744059.003154] Back to C! [18446744059.003421] CPU0: Thermal monitoring handled by SMI [18446744059.003485] Extended CMOS year: 2000 [18446744059.003513] Enabling non-boot CPUs ... [18446744059.003675] SMP alternatives: switching to SMP code [18446744059.007306] Booting Node 0 Processor 1 APIC 0x4 [18446744059.095800] CPU1: Thermal monitoring handled by SMI [18446744059.144200] CPU1 is up [18446744059.144346] Booting Node 0 Processor 2 APIC 0x1 [18446744059.231585] CPU2: Thermal monitoring handled by SMI [18446744059.300244] CPU2 is up [18446744059.300454] Booting Node 0 Processor 3 APIC 0x5 [18446744059.391331] CPU3: Thermal monitoring handled by SMI [18446744059.460017] CPU3 is up [18446744059.461254] ACPI: Waking up from system sleep state S3 [18446744059.523603] pcieport 0000:00:01.0: restoring config space at offset 0x1 (was 0x100007, writing 0x100407) [18446744059.523630] pci 0000:00:16.0: restoring config space at offset 0xf (was 0x100, writing 0x10b) [18446744059.523649] pci 0000:00:16.0: restoring config space at offset 0x4 (was 0xfed17004, writing 0xe96b0004) [18446744059.523657] pci 0000:00:16.0: restoring config space at offset 0x1 (was 0x180006, writing 0x100006) [18446744059.523683] serial 0000:00:16.3: restoring config space at offset 0xf (was 0x200, writing 0x20a) [18446744059.523702] serial 0000:00:16.3: restoring config space at offset 0x5 (was 0x0, writing 0xe9690000) [18446744059.523708] serial 0000:00:16.3: restoring config space at offset 0x4 (was 0x1, writing 0x80a1) [18446744059.523717] serial 0000:00:16.3: restoring config space at offset 0x1 (was 0xb00000, writing 0xb00007) [18446744059.523745] e1000e 0000:00:19.0: restoring config space at offset 0xf (was 0x100, writing 0x105) [18446744059.523768] e1000e 0000:00:19.0: restoring config space at offset 0x1 (was 0x100000, writing 0x100007) [18446744059.523799] ehci_hcd 0000:00:1a.0: restoring config space at offset 0xf (was 0x100, writing 0x10b) [18446744059.523818] ehci_hcd 0000:00:1a.0: restoring config space at offset 0x4 (was 0x0, writing 0xe9670000) [18446744059.523826] ehci_hcd 0000:00:1a.0: restoring config space at offset 0x1 (was 0x2900000, writing 0x2900002) [18446744059.523859] HDA Intel 0000:00:1b.0: restoring config space at offset 0xf (was 0x100, writing 0x103) [18446744059.523878] HDA Intel 0000:00:1b.0: restoring config space at offset 0x4 (was 0x4, writing 0xe9660004) [18446744059.523884] HDA Intel 0000:00:1b.0: restoring config space at offset 0x3 (was 0x0, writing 0x10) [18446744059.523891] HDA Intel 0000:00:1b.0: restoring config space at offset 0x1 (was 0x100000, writing 0x100002) [18446744059.523926] pcieport 0000:00:1c.0: restoring config space at offset 0xf (was 0x100, writing 0x10b) [18446744059.523939] pcieport 0000:00:1c.0: restoring config space at offset 0x9 (was 0x1fff1, writing 0xe981e971) [18446744059.523951] pcieport 0000:00:1c.0: restoring config space at offset 0x3 (was 0x810000, writing 0x810010) [18446744059.523958] pcieport 0000:00:1c.0: restoring config space at offset 0x1 (was 0x100000, writing 0x100407) [18446744059.524007] pcieport 0000:00:1c.1: restoring config space at offset 0xf (was 0x200, writing 0x20b) [18446744059.524019] pcieport 0000:00:1c.1: restoring config space at offset 0x9 (was 0x1fff1, writing 0xe9a1e991) [18446744059.524032] pcieport 0000:00:1c.1: restoring config space at offset 0x3 (was 0x810000, writing 0x810010) [18446744059.524039] pcieport 0000:00:1c.1: restoring config space at offset 0x1 (was 0x100000, writing 0x100407) [18446744059.524089] pcieport 0000:00:1c.2: restoring config space at offset 0xf (was 0x300, writing 0x30a) [18446744059.524101] pcieport 0000:00:1c.2: restoring config space at offset 0x9 (was 0x1fff1, writing 0xeff1ec01) [18446744059.524107] pcieport 0000:00:1c.2: restoring config space at offset 0x8 (was 0xe590e310, writing 0xf5f0f000) [18446744059.524118] pcieport 0000:00:1c.2: restoring config space at offset 0x3 (was 0x810000, writing 0x810010) [18446744059.524125] pcieport 0000:00:1c.2: restoring config space at offset 0x1 (was 0x100000, writing 0x100407) [18446744059.524174] pcieport 0000:00:1c.3: restoring config space at offset 0xf (was 0x400, writing 0x40a) [18446744059.524187] pcieport 0000:00:1c.3: restoring config space at offset 0x9 (was 0x1fff1, writing 0xe9c1e9b1) [18446744059.524199] pcieport 0000:00:1c.3: restoring config space at offset 0x3 (was 0x810000, writing 0x810010) [18446744059.524206] pcieport 0000:00:1c.3: restoring config space at offset 0x1 (was 0x100000, writing 0x100407) [18446744059.524252] ehci_hcd 0000:00:1d.0: restoring config space at offset 0xf (was 0x100, writing 0x10b) [18446744059.524271] ehci_hcd 0000:00:1d.0: restoring config space at offset 0x4 (was 0x0, writing 0xe9650000) [18446744059.524280] ehci_hcd 0000:00:1d.0: restoring config space at offset 0x1 (was 0x2900000, writing 0x2900002) [18446744059.524397] ahci 0000:00:1f.2: restoring config space at offset 0x1 (was 0x2b00007, writing 0x2b00407) [18446744059.524450] pci 0000:00:1f.3: restoring config space at offset 0x1 (was 0x2800001, writing 0x2800003) [18446744059.524488] pci 0000:00:1f.6: restoring config space at offset 0x1 (was 0x100000, writing 0x100006) [18446744059.524576] HDA Intel 0000:01:00.1: restoring config space at offset 0x1 (was 0x100000, writing 0x100002) [18446744059.524630] iwlagn 0000:03:00.0: restoring config space at offset 0xf (was 0x100, writing 0x10b) [18446744059.524664] iwlagn 0000:03:00.0: restoring config space at offset 0x4 (was 0x4, writing 0xe6e00004) [18446744059.524673] iwlagn 0000:03:00.0: restoring config space at offset 0x3 (was 0x0, writing 0x10) [18446744059.524684] iwlagn 0000:03:00.0: restoring config space at offset 0x1 (was 0x100000, writing 0x100006) [18446744059.524813] yenta_cardbus 0000:04:00.0: restoring config space at offset 0xf (was 0x7000100, writing 0x580010a) [18446744059.524821] yenta_cardbus 0000:04:00.0: restoring config space at offset 0xe (was 0x0, writing 0xfc) [18446744059.524830] yenta_cardbus 0000:04:00.0: restoring config space at offset 0xc (was 0x0, writing 0xfc) [18446744059.524839] yenta_cardbus 0000:04:00.0: restoring config space at offset 0xa (was 0x0, writing 0xf3fff000) [18446744059.524847] yenta_cardbus 0000:04:00.0: restoring config space at offset 0x9 (was 0x0, writing 0xf0000000) [18446744059.524854] yenta_cardbus 0000:04:00.0: restoring config space at offset 0x8 (was 0x0, writing 0x3fff000) [18446744059.524863] yenta_cardbus 0000:04:00.0: restoring config space at offset 0x6 (was 0x0, writing 0xb0080504) [18446744059.524873] yenta_cardbus 0000:04:00.0: restoring config space at offset 0x4 (was 0x0, writing 0xf4000000) [18446744059.524884] yenta_cardbus 0000:04:00.0: restoring config space at offset 0x1 (was 0x100000, writing 0x100007) [18446744059.524920] yenta_cardbus 0000:04:00.0: setting latency timer to 64 [18446744059.524950] sdhci-pci 0000:04:00.1: restoring config space at offset 0xf (was 0x200, writing 0x20a) [18446744059.524978] sdhci-pci 0000:04:00.1: restoring config space at offset 0x4 (was 0x0, writing 0xf4001800) [18446744059.524985] sdhci-pci 0000:04:00.1: restoring config space at offset 0x3 (was 0x800000, writing 0x800010) [18446744059.524994] sdhci-pci 0000:04:00.1: restoring config space at offset 0x1 (was 0x100000, writing 0x100006) [18446744059.525044] firewire_ohci 0000:04:00.4: restoring config space at offset 0xf (was 0x300, writing 0x30b) [18446744059.525071] firewire_ohci 0000:04:00.4: restoring config space at offset 0x4 (was 0xe5900000, writing 0xf4001000) [18446744059.525079] firewire_ohci 0000:04:00.4: restoring config space at offset 0x3 (was 0x800000, writing 0x800010) [18446744059.525088] firewire_ohci 0000:04:00.4: restoring config space at offset 0x1 (was 0x100000, writing 0x100006) [18446744059.525431] PM: early resume of devices complete after 1.875 msecs [18446744059.525865] e1000e 0000:00:19.0: PCI INT A -> GSI 20 (level, low) -> IRQ 20 [18446744059.525872] e1000e 0000:00:19.0: setting latency timer to 64 [18446744059.525901] e1000e 0000:00:19.0: wake-up capability disabled by ACPI [18446744059.525908] e1000e 0000:00:19.0: PME# disabled [18446744059.525973] e1000e 0000:00:19.0: irq 29 for MSI/MSI-X [18446744059.526452] ehci_hcd 0000:00:1a.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16 [18446744059.526511] ehci_hcd 0000:00:1a.0: setting latency timer to 64 [18446744059.526807] HDA Intel 0000:00:1b.0: PCI INT A -> GSI 22 (level, low) -> IRQ 22 [18446744059.526869] HDA Intel 0000:00:1b.0: setting latency timer to 64 [18446744059.527237] HDA Intel 0000:00:1b.0: irq 32 for MSI/MSI-X [18446744059.527509] ehci_hcd 0000:00:1d.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17 [18446744059.527565] ehci_hcd 0000:00:1d.0: setting latency timer to 64 [18446744059.527790] pci 0000:00:1e.0: setting latency timer to 64 [18446744059.527897] ahci 0000:00:1f.2: setting latency timer to 64 [18446744059.528162] pci 0000:00:1f.3: PCI INT C -> GSI 18 (level, low) -> IRQ 18 [18446744059.528166] [drm] nouveau 0000:01:00.0: We're back, enabling device... [18446744059.528173] nouveau 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16 [18446744059.528183] nouveau 0000:01:00.0: setting latency timer to 64 [18446744059.528188] [drm] nouveau 0000:01:00.0: POSTing device... [18446744059.528202] [drm] nouveau 0000:01:00.0: Parsing VBIOS init table 0 at offset 0x6F74 [18446744059.528571] HDA Intel 0000:01:00.1: PCI INT A -> GSI 16 (level, low) -> IRQ 16 [18446744059.528679] HDA Intel 0000:01:00.1: setting latency timer to 64 [18446744059.529081] sdhci-pci 0000:04:00.1: PCI INT B -> GSI 19 (level, low) -> IRQ 19 [18446744059.529223] sdhci-pci 0000:04:00.1: setting latency timer to 64 [18446744059.543990] sd 0:0:0:0: [sda] Starting disk [18446744059.607165] firewire_core: skipped bus generations, destroying all nodes [18446744059.739613] usb 1-1.4: reset high speed USB device using ehci_hcd and address 3 [18446744059.764485] [drm] nouveau 0000:01:00.0: Parsing VBIOS init table 1 at offset 0x741F [18446744059.795446] [drm] nouveau 0000:01:00.0: Parsing VBIOS init table 2 at offset 0x7FCB [18446744059.795496] [drm] nouveau 0000:01:00.0: Parsing VBIOS init table 3 at offset 0x7FE4 [18446744059.802740] [drm] nouveau 0000:01:00.0: Parsing VBIOS init table 4 at offset 0x80CB [18446744059.802741] [drm] nouveau 0000:01:00.0: Parsing VBIOS init table at offset 0x8130 [18446744059.826645] [drm] nouveau 0000:01:00.0: 0x5E7A: parsing output script 0 [18446744059.826653] [drm] nouveau 0000:01:00.0: Couldn't find matching output script table [18446744059.826655] [drm] nouveau 0000:01:00.0: 0x5E7A: parsing output script 0 [18446744059.826657] [drm] nouveau 0000:01:00.0: 0x5A33: parsing output script 0 [18446744059.826658] [drm] nouveau 0000:01:00.0: 0x5E7A: parsing output script 0 [18446744059.826660] [drm] nouveau 0000:01:00.0: 0x5A33: parsing output script 0 [18446744059.826667] [drm] nouveau 0000:01:00.0: Reinitialising engines... [18446744059.832531] [drm] nouveau 0000:01:00.0: Restoring GPU objects... [18446744059.846615] ata6: SATA link down (SStatus 0 SControl 300) [18446744059.854725] ata5: SATA link down (SStatus 0 SControl 300) [18446744059.862389] [drm] nouveau 0000:01:00.0: Restoring mode... [18446744059.870702] dell-wmi: Received unknown WMI event (0x11) [18446744059.873580] ata2: SATA link up 1.5 Gbps (SStatus 113 SControl 300) [18446744059.873630] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300) [18446744059.884175] ata2.00: configured for UDMA/133 [18446744059.897832] [drm] nouveau 0000:01:00.0: 0x5EAA: parsing output script 1 [18446744059.898364] [drm] nouveau 0000:01:00.0: 0x5DAA: parsing clock script 0 [18446744059.906950] usb 2-1.7: reset full speed USB device using ehci_hcd and address 3 [18446744059.912155] ata1.00: ACPI cmd ef/5a:00:00:00:00:a0 (SET FEATURES) succeeded [18446744059.939005] ata1.00: ACPI cmd 00/00:00:00:00:00:a0 (NOP) rejected by device (Stat=0x51 Err=0x04) [18446744059.939402] ata1.00: configured for UDMA/133 [18446744059.950012] [drm] nouveau 0000:01:00.0: 0x5BB2: parsing clock script 1 [18446744060.000848] btusb 2-1.7:1.0: no reset_resume for driver btusb? [18446744060.000881] btusb 2-1.7:1.1: no reset_resume for driver btusb? [18446744060.106557] firewire_core: rediscovered device fw0 [18446744060.155708] PM: resume of devices complete after 631.098 msecs [18446744060.412584] PM: Finishing wakeup. [18446744060.412625] Restarting tasks ... [18446744060.434109] hub 1-1:1.0: unable to enumerate USB device on port 6 [18446744060.532611] done. [18446744060.532687] video LNXVIDEO:00: Restoring backlight state [18446744060.819384] dell-wmi: Received unknown WMI event (0x11) [18446744061.594676] ADDRCONF(NETDEV_UP): wlan0: link is not ready [18446744067.053574] irq 9: nobody cared (try booting with the "irqpoll" option) [18446744067.053582] Pid: 0, comm: swapper Not tainted 2.6.34-rc5-nouveau.git #1 [18446744067.053586] Call Trace: [18446744067.053589] <IRQ> [<ffffffff8108e735>] ? __report_bad_irq+0x30/0x7d [18446744067.053603] [<ffffffff8108e889>] ? note_interrupt+0x107/0x16e [18446744067.053609] [<ffffffff8108efac>] ? handle_fasteoi_irq+0x96/0xb7 [18446744067.053616] [<ffffffff8100b758>] ? handle_irq+0x17/0x1f [18446744067.053620] [<ffffffff8100ae1a>] ? do_IRQ+0x54/0xb9 [18446744067.053627] [<ffffffff812edcd3>] ? ret_from_intr+0x0/0x11 [18446744067.053630] <EOI> [<ffffffff8100f639>] ? sched_clock+0x5/0x8 [18446744067.053662] [<ffffffffa0150547>] ? acpi_idle_enter_bm+0x27a/0x2ac [processor] [18446744067.053670] [<ffffffffa0150540>] ? acpi_idle_enter_bm+0x273/0x2ac [processor] [18446744067.053680] [<ffffffff8122a406>] ? cpuidle_idle_call+0x91/0xeb [18446744067.053688] [<ffffffff81007b60>] ? cpu_idle+0xa3/0xdd [18446744067.053694] [<ffffffff816c0d71>] ? start_kernel+0x3ed/0x3f8 [18446744067.053699] [<ffffffff816c03ba>] ? x86_64_start_kernel+0xf9/0x106 [18446744067.053702] handlers: [18446744067.053705] [<ffffffff811b7acc>] (acpi_irq+0x0/0x2c)
