You are not logged in.

#1 2015-06-24 17:51:22

zacariaz
Member
From: Denmark
Registered: 2012-01-18
Posts: 539

Hibernation and swap file

I'm in the process of planning the configuration of a small laptop with somewhat limited resources, though with a very fast SSD, which I will hopefully acquire soon, and I have a question or two.

The thing is that I will have enough RAM that a swap partition is somewhat wasted for any other purpose than hibernation, and disk space may be at a premium.

So I was thinking, upon entering into hibernation, simply creating an empty file with the appropriate size, using dd or whatever, perhaps checking if enough space is available, if this is even necessary, do an mkswap, swapon end then hibernate, and upon resume simply doing swapoff and delete the file.

Now, I don't know if this is even possible, nor do I know how big of a file size will be required, though obviously I know it need not be larger than the amount of RAM available.
Since I'll end up with 3 different partitions, boot/EFI, root and home, I don't know either, which of these partitions will be appropriate to place it on, or if it makes a difference at all.

And that is that I think. Obviously I can't play around with this stuff just yet, but I would like to know if I'm on the right track and perhaps get a few pointers.


Best regards.


I am a philosopher, of sorts, not a troll or an imbecile.
My apologies that this is not always obvious, despite my best efforts.

Offline

#2 2015-06-24 17:55:49

dockland
Member
From: Sweden
Registered: 2015-06-06
Posts: 861

Re: Hibernation and swap file

zacariaz wrote:

I'm in the process of planning the configuration of a small laptop with somewhat limited resources, though with a very fast SSD, which I will hopefully acquire soon, and I have a question or two.

The thing is that I will have enough RAM that a swap partition is somewhat wasted for any other purpose than hibernation, and disk space may be at a premium.

So I was thinking, upon entering into hibernation, simply creating an empty file with the appropriate size, using dd or whatever, perhaps checking if enough space is available, if this is even necessary, do an mkswap, swapon end then hibernate, and upon resume simply doing swapoff and delete the file.

Now, I don't know if this is even possible, nor do I know how big of a file size will be required, though obviously I know it need not be larger than the amount of RAM available.
Since I'll end up with 3 different partitions, boot/EFI, root and home, I don't know either, which of these partitions will be appropriate to place it on, or if it makes a difference at all.

And that is that I think. Obviously I can't play around with this stuff just yet, but I would like to know if I'm on the right track and perhaps get a few pointers.


Best regards.

Is "Suspend" not an option?


I possess a device, in my pocket, that is capable of accessing the entirety of information known to man.
I use it to look at funny pictures of cats and to argue with strangers.

Offline

#3 2015-06-24 18:47:22

zacariaz
Member
From: Denmark
Registered: 2012-01-18
Posts: 539

Re: Hibernation and swap file

dockland wrote:
zacariaz wrote:

I'm in the process of planning the configuration of a small laptop with somewhat limited resources, though with a very fast SSD, which I will hopefully acquire soon, and I have a question or two.

The thing is that I will have enough RAM that a swap partition is somewhat wasted for any other purpose than hibernation, and disk space may be at a premium.

So I was thinking, upon entering into hibernation, simply creating an empty file with the appropriate size, using dd or whatever, perhaps checking if enough space is available, if this is even necessary, do an mkswap, swapon end then hibernate, and upon resume simply doing swapoff and delete the file.

Now, I don't know if this is even possible, nor do I know how big of a file size will be required, though obviously I know it need not be larger than the amount of RAM available.
Since I'll end up with 3 different partitions, boot/EFI, root and home, I don't know either, which of these partitions will be appropriate to place it on, or if it makes a difference at all.

And that is that I think. Obviously I can't play around with this stuff just yet, but I would like to know if I'm on the right track and perhaps get a few pointers.


Best regards.

Is "Suspend" not an option?

Well, yes and no, and the main focus on this particular laptop is to extend the battery life as far as possible. I suspect suspend doesn't do much to the batter, but still. And in any case, I'd still like to know.


I am a philosopher, of sorts, not a troll or an imbecile.
My apologies that this is not always obvious, despite my best efforts.

Offline

#4 2015-06-24 20:10:24

The Loko
Member
From: Spain
Registered: 2014-07-23
Posts: 100

Re: Hibernation and swap file

You could create a swap partition on a SD or USB drive, and plug it when needed:
https://wiki.archlinux.org/index.php/Sw … USB_device

Offline

#5 2015-06-24 20:15:27

zacariaz
Member
From: Denmark
Registered: 2012-01-18
Posts: 539

Re: Hibernation and swap file

The Loko wrote:

You could create a swap partition on a SD or USB drive, and plug it when needed:
https://wiki.archlinux.org/index.php/Sw … USB_device

I don't think I'm going that route. Too fiddle and rather slow storage too. still a good idea though.


I am a philosopher, of sorts, not a troll or an imbecile.
My apologies that this is not always obvious, despite my best efforts.

Offline

Board footer

Powered by FluxBB