What is this and how does it work?
gpart(8), zpool(8), zzz(8), acpiconf(8),
Good luck!
If you are a native english speaker and want to correct my "gernglish", kindly ask the moderators to allow you to polish this.
- On newer Intel-based computers, the UEFI/BIOS offers a switch to enable a iFFS/IRST partition to support suspend/resume.
This is called "Intel Rapid Start Technology". It affects mainly mobiles (laptops & tablets), but also desktop and maybe server systems.
Maybe there's similar functionality on AMD based systems? - This can serve as a work-around to suspend to disk for those who can not directly suspend to disk (aka hibernate)
EDIT: Either the following is intended by the IRST specs, or a "feature" of my UEFI: When I press the power button quickly after suspending (within ~5 seconds), the system enters S4 state. This way, I can emulate hibernation w/o having to wait for the timer to fire - ACPI Power State Cheat Sheet (S0-5) Note that this might not 100% accurate...
- On suspend to RAM a countdown timer is started. The system enters the S3 state.
- When the timer fires, the UEFI/BIOS writes the contents of the RAM to this partition, flags it, the system enters S4 state and is switched off.
Obviously, this saves much energy (battery runtime), since a system that is switched off does not need to refresh the RAM like in S3 state. I.e. it needs zero except the self-drainage of the battery plus what the ME needs to run. - On restart, the UEFI/BIOS checks the iFFS/IRST partition for the flag.
- If it is flag'ed, the system boots from it, bypassing the active boot partition and usual boot procedure (efiboot->...->FreeBSD loader(8))
- Make shure your system successfully resumes from suspend-to-RAM.
(mouse, USB, graphics device, etc.) Consult the handbook, wiki, and search the forum. - Check your UEFI/BIOS settings under "Power" to see if your system supports IRST.
Watch out for "Intel Rapid Start", "Intel Fast Flash", "IRST", "iFFS" or similar - !The partition's size must be at least equal to the amount of RAM!
- Check if you already have such a partition -- it's type is "!D3BFE2DE-3DAF-11DF-BA40-E3A556D89593"
gpart show ada0
- This only works for GPT partition scheme. You want that anyway.
- Probably this only works with EFI boot; I did not try with the old legacy BIOS boot method.
- NOTE: the IRST partition can not be used as swap device, unless IRST is disabled in the UEFI/BIOS or the system will never suspend-to-RAM.
It can be used as a dump device, since a crashed kernel will not suspend-to-RAM after the crash.
Using the IRST partition as dump device is not possible yet. A patch is in the works. - Usually, one can not directly suspend-to-disk (S4) to the IRST partition without going through S3 state (suspend-to-RAM) first - this is completely out of control of the OS and managed solely by the UEFI's ACPI.
- On some systems, it is neccessary to disable the TRM/TTP security chip. So if you need TRM/TTP running, chances are it will not work for you.
- Either change the type of your existing swap partition: Step #3 or...
On ZFS, you can instead swap to a ZVOL:zfs create -b 4k -V zpool/SWAP
and add that to /etc/fstab
Currently, you can not use the IRST as a dump device. I'm working to provide a patch for this. AFAIK, dumping to a ZVOL swap is not possible either. - Create a partition of the size of your RAM and any enlargements you plan to stick in:
gpart add -t ms-basic-data -i 3 -s 12G ada0
The type does not matter and will be changed later.
Adjust "12G" to the size of your RAM, the index of the partition and name of your disk device
Or when the installer reaches the task to partition the disk/SSD, let the installer create it.
Either give the partition a type not used by FreeBSD, or open a shell and... - Change the partition type to the iFFS magic number:
gpart modify -i 3 -t \!D3BFE2DE-3DAF-11DF-BA40-E3A556D89593 ada0
Replace "-i 3" with the index of the IRST partition, and "ada0" with your disk device and number. Note the backslash! - Optionally label the partition:
gpart -i 3 -l IRST ada0
iFFS would be a good label, too. - Enable IRST in the UEFI/BIOS and set the timer to a very low value for testing purpose (e.g. 1 minute).
- Optionally de-activate or disable the TRM/TTP security chip in the UEFI/BIOS.
This applies to Lenovo (at least Thinkpad T450s, very likely other models as well) and probably other brands, too. - In the running system, enter suspend-to-RAM:
zzz
oracpiconf -s 3
, or use your GUI's way to do that.
If zzz complains, dosysctl hw.acpi.suspend_state=S3
Optionally, start the timer of you mobile phone. Wait until the timer fires.
Most computers will give feedback by a slowly blinking LED light, or in a small status LCD. Listen to the noise of the fan and disk
After the timeout, it takes a few seconds to save the contests of RAM to disk, then the system switches off.
LED/LCD goes off, fan and disk will stop - Start the computer the usual way: Press the Power button or issue a wakeup packet on the network.
The system will show something like "resuming from deep sleep state" - If the system restarts successfully into the previous state:
Click Thanks on this posting to give some feedback, so we can guess for how many it works.
In the UEFI/BIOS, set the timer to a larger value, e.g. 15 minutes, else switch IRST off completely.
See topic #6: TRM security chip and 1st topic of the Prerequisites
- If suspend-to-disk does not work with the IRST partition, it can be used otherwise, e.g. as swap or /var/tmp. Of course you'll have to change the partition type accordingly:
gpart modify -i 3 -t freebsd-swap
and optionally add a ZVOL to enlarge the swap space. - Destroy the partition with gpart(8) and enlarge it's neighbor to use the space with
gpart resize
- A ZFS zpool(8) can be enlarged to use new diskspace:
zpool set autoexpand=on
. - Use growfs(8) to enlarge an UFS filesystem.
gpart(8), zpool(8), zzz(8), acpiconf(8),
sysctl hw.acpi | grep -E 's(leep|uspend)'
Good luck!
If you are a native english speaker and want to correct my "gernglish", kindly ask the moderators to allow you to polish this.
Last edited: