Category Archives: linux

Really disabling hibernate before installing Linux

I did a lot of research before installing Linux on my new laptop. Some people advised to disable hibernate before installing Linux in a dual boot setup. The reasoning, I think, is to prevent the machine hibernating in one OS and waking in another, leaving the first in an unusual state.

I found some instructions on how to disable hibernate https://www.tenforums.com/tutorials/2859-enable-disable-hibernate-windows-10-a.html and set about doing that armed with the Microsoft docs on the relevant command line utility https://docs.microsoft.com/en-us/windows-hardware/design/device-experiences/powercfg-command-line-options

An added complexity that I discovered while following the instructions to disable hibernate is that it can be triggered for a number of reasons, all of which need to be addressed when disabling it. The following outlines the steps I took to hunt down every way that hibernate could be triggered in my system and disable them all one by one.

The first step is to open a command line shell in administrator mode (from memory, since I am on the Linux side at the moment: hit Windows key + X, right click on command line and select administrator mode). In the resulting shell:

C:\WINDOWS\system32>powercfg /list

Existing Power Schemes (* Active)

Power Scheme GUID: 191ba8c6-5e2f-4d89-8197-303852978162  (Airplane)
Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e (Balanced) *
Power Scheme GUID: 707872dd-11b4-4409-b54f-121b8ea7ba40 (Timers off (Presentation))

Turn off hibernate

powercfg /hibernate off

Query settings for Airplane mode

From the output above, we see that the GUID for airplane mode is 191ba8c6-5e2f-4d89-8197-303852978162

C:\WINDOWS\system32>powercfg /query 191ba8c6-5e2f-4d89-8197-303852978162
 Power Scheme GUID: 191ba8c6-5e2f-4d89-8197-303852978162  (Airplane)
Subgroup GUID: 0012ee47-9041-4b5d-9b77-535fba8b1442 (Hard disk)
GUID Alias: SUB_DISK
Power Setting GUID: 6738e2c4-e8a5-4a42-b16a-e040e769756e (Turn off hard disk after)
GUID Alias: DISKIDLE
Minimum Possible Setting: 0x00000000
Maximum Possible Setting: 0xffffffff
Possible Settings increment: 0x00000001
Possible Settings units: Seconds
Current AC Power Setting Index: 0x00000384
Current DC Power Setting Index: 0x000000b4

From the full output of that command we see that we also need to change HIBERNATEIDLE in all power plans. Setting it to zero disables.

C:\WINDOWS\system32>powercfg  /setacvalueindex 191ba8c6-5e2f-4d89-8197-303852978162 SUB_SLEEP HIBERNATEIDLE 0
C:\WINDOWS\system32>powercfg /setdcvalueindex 191ba8c6-5e2f-4d89-8197-303852978162 SUB_SLEEP HIBERNATEIDLE 0

Verify it is off

C:\WINDOWS\system32>powercfg /query 191ba8c6-5e2f-4d89-8197-303852978162
...
Power Setting GUID: 9d7815a6-7ee4-497e-8888-515a05f02364 (Hibernate after)
GUID Alias: HIBERNATEIDLE
Minimum Possible Setting: 0x00000000
Maximum Possible Setting: 0xffffffff
Possible Settings increment: 0x00000001
Possible Settings units: Seconds
Current AC Power Setting Index: 0x00000000
Current DC Power Setting Index: 0x00000000

Also turn it off in the balanced power profile

powercfg  /setdcvalueindex  381b4222-f694-41f0-9685-ff5bb260df2e SUB_SLEEP HIBERNATEIDLE 0

Verify

C:\WINDOWS\system32>powercfg /query 381b4222-f694-41f0-9685-ff5bb260df2e

...
Power Setting GUID: 9d7815a6-7ee4-497e-8888-515a05f02364  (Hibernate after)
  GUID Alias: HIBERNATEIDLE
  Minimum Possible Setting: 0x00000000
  Maximum Possible Setting: 0xffffffff
  Possible Settings increment: 0x00000001
  Possible Settings units: Seconds
Current AC Power Setting Index: 0x00000000
Current DC Power Setting Index: 0x00000000

Check the last power configuration

powercfg /query 707872dd-11b4-4409-b54f-121b8ea7ba40

See that hibernate is still enabled for Critical battery action on DC power (battery). Change it to sleep in all power profiles:

powercfg  /setdcvalueindex 707872dd-11b4-4409-b54f-121b8ea7ba40 SUB_BATTERY BATACTIONCRIT 1
powercfg  /setdcvalueindex 191ba8c6-5e2f-4d89-8197-303852978162  SUB_BATTERY BATACTIONCRIT 1 
powercfg  /setdcvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e  SUB_BATTERY BATACTIONCRIT 1 

And for AC power in 381b4222-f694-41f0-9685-ff5bb260df2e (Balanced)!

powercfg  /setacvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e  SUB_BATTERY BATACTIONCRIT 1 

Verify again by querying each power scheme in turn.

Now, this should also disable Fast Boot and we can verify that using the Windows control panel:

Control Panel\All Control Panel Items\Power Options\Choose what the power buttons do – check there is no Fast Boot option

Dual Booting Pop! OS on a ThinkPad X1 Extreme

Yesterday I finally installed pop on my ThinkPad X1 Extreme. I was a little nervous because it has been a loooooooong time since I’ve set up dual booting on anything. This ThinkPad is such a beautiful machine – it would be a shame to break it.

The main issue for me when I was looking into this is getting the Pop! OS boot loader to pick up the existing Windows installation. Pop! installs its firmware in a new EFI partition which is created during installation. The Grub bootloader, which many linuxes use, automatically detects any existing Windows installation – even if it is in a different EFI partition -and adds an entry to its boot menu. Pop! uses systemd-boot instead of grub, and systemd-boot doesn’t detect that Windows is installed with a different EFI partition. I read some advice to copy the windows boot files from the Windows EFI partition into the new Pop OS EFI partition, and some other advice saying that may not work well. I re-read what System 76 say about dual booting Pop OS and I finally got it:

To boot your other OS:

– If your device is in EFI mode, use your device’s built-in boot menu.
– If your device is in BIOS mode, a menu will automatically appear when powering on.


Choose your previous OS with the arrow keys, then press Enter.


https://pop.system76.com/docs/dual-booting-windows

I also read this comment from one of their devs:

So the deal is that if you let the machine start using the systemd-boot which was installed, then you will get a boot menu which basically offers Pop. To boot Windows you need to activate the Windows boot loader either by hitting F12 (on my machine) and selecting it from the system UEFI , or, possibly by selecting the Windows boot loader option from the systemd-boot menu.