Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
10
rated 0 times [  10] [ 0]  / answers: 1 / hits: 10912  / 2 Years ago, thu, march 10, 2022, 11:45:55

I've read this question, but it doesn't definitively answer my question.



If I want my computer to be able to hibernate, do I need to have a swap partition as large as my RAM, or will Ubuntu wisely be able to hibernate if the swap partition can fit the currently-in-use RAM? I'm about to install Ubuntu on a computer with a lot of RAM, and a relatively small hard drive, so I don't want to use more hard drive space than necessary.



I wanted to avoid giving my actual specifications to keep this question more general, though I'll give them if necessary.


More From » hibernate

 Answers
3

It's hard to predict: your swap needs to accommodate




  • what's already in the swap when you hibernate

  • what's in RAM when you hibernate, but only the part that's not disk cache or buffers; the RAM image is compressed if you use uswsusp

  • a few kernel data structures



So you can fail to hibernate even if your swap is bigger than your RAM, because most of your swap is already in use. And convertly you can successfully hibernate with a swap that's smaller than RAM, if you're not using much of either at the time.



If you want to avoid a fixed-size swap partition because your disk is very small, you can go for a swap file instead. It's easier to resize, and hibernation to a swap file is supposed to be supported (not sure if it currrently works out of the box, that's come and gone between Ubuntu releases; IIRC it did in 9.10 but it had to be set up in 10.10).


[#44491] Friday, March 11, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
terneive

Total Points: 329
Total Questions: 117
Total Answers: 105

Location: Denmark
Member since Tue, Oct 18, 2022
2 Years ago
;