Skip to main content
NPal.2
Associate III
September 14, 2021
Solved

Swap partition creation

  • September 14, 2021
  • 4 replies
  • 1280 views

Hi all,

How can I create swap partition in STM32MP1?

Previously I did get an answer to how to increase the rootfs size. Any guidance on this will be highly appreciated.

TIA

This topic has been closed for replies.
Best answer by AntonioST

A swap partition is a good idea when you have a real hard-disk or a fast SSD that includes an internal cache.

With SD card or simple flash devices (NAND, SPI, ...) I expect that the write speed will not give you the performance you would expect.

Plus the limited write/erase cycles of flash devices could impact its life-time, when used too often as swap.

Nevertheless if your need is to just use the cache in some "special" and "limited" case, it could still be interesting to turn swap on.

But I don't have clear what is your need?

Some command to create a swap partition from command-line? Or change the flash partition to include a swap when you re-flash the board?

And which storage you plan to use? Hard-disk, SD card, ...?

4 replies

Olivier GALLIEN
ST Technical Moderator
September 14, 2021

Hi @NPal.2​ ,

Could you further elaborate what you mean by swap partition ?

Thanks

Olivier

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
NPal.2
NPal.2Author
Associate III
September 14, 2021

Hi @Oliver

In case of Linux we have : ext4 , boot and swap partition. When system runs low on RAM it takes up memory from swap memory to satisfy those need. I want to create a similar partition.

I hope I was able to provide you some clarity around this.

AntonioST
AntonioSTBest answer
ST Employee
September 22, 2021

A swap partition is a good idea when you have a real hard-disk or a fast SSD that includes an internal cache.

With SD card or simple flash devices (NAND, SPI, ...) I expect that the write speed will not give you the performance you would expect.

Plus the limited write/erase cycles of flash devices could impact its life-time, when used too often as swap.

Nevertheless if your need is to just use the cache in some "special" and "limited" case, it could still be interesting to turn swap on.

But I don't have clear what is your need?

Some command to create a swap partition from command-line? Or change the flash partition to include a swap when you re-flash the board?

And which storage you plan to use? Hard-disk, SD card, ...?

NPal.2
NPal.2Author
Associate III
September 24, 2021

Hi @AntonioST​ . Thanks for your response. I feel the comments provided by you give me a better insight. I wanted to make a swap partition in case my system runs out of memory, it can pick up some from swap.I plan to use SD-Card.