What's role of swap in initrd?

Hello, I want to know why initrd need swap for work. In the shell of mkinitrd, it look for the swap partation for "swsuspdev", then write a sentence "resume /dev/sdXX" in the file init from initrd.gz, and the /dev/sdXX is the swap partation.

Why initrd need swap when it boot a system? what is the effect of the swap for initrd? Resume, resume what?

Hope an answer,Thank you very much.

The swap space is used also used for system hibernation, and the resume line tells the kernel where to look for the hibernation signature and to load the old RAM contents from.

1 Like

Thank you for your reply. What is the mean of hibernation? How can I make a system(linux system) to hibernate? Standby? Hibernate?

You'll have to install the appropriate package(s) for your distribution first, if not already present. Run which hibernate to check for that. Most current desktop distributions automatically install and configure that feature in the default install.

Hibernation basically means that the contents of the RAM are saved to disk, and power is cut afterward. When power is restored, the old contents are loaded into RAM again, and you can resume using the system.

See TuxOnIce