v16.04 resize option could also use a swap partion creation option

It’s great that one can now automagically resize partitions from Ubuntu MATE Welcome. It would also be nice if the resizing process provided an option to create a swap partition.

1 Like

Is that desirable?

On a normal PC, the Swap moves data from RAM to the hard disk. In a Raspberry Pi, the ‘hard disk’ is an SDcard. Will this not only slow down the Pi, but potentially shorten the life span of the microSD card?

where can I download this 16.04? can you please provide a working link :slight_smile: thanks

See this thread:

This is the beta 2 release. It is not the final release.

The RPi2 and 3 have 1GB of RAM, which is fairly limited even when compared to a smartphone. The Linux kernel's memory management system is virtual-based, was designed with swap in mind, and not having available swap hobbles the system by using memory less efficiently(Technically, with a backing store, as the Linux kernel doesn't swap, but pages memory. However, common vernacular is to use "swap," so I will also). The kernel is loaded into memory, and AFAIK, never swapped. The left over memory is available for user-space apps.

Apps often take up memory for initialization, and never use those pages again. Instead of wasting the memory, the Linux memory management system is designed to move those pages to swap to maximize the available physical memory. As is self-evident, in a system with a small amount of physical RAM such as the Pi, this is even more important.

Yes, having a swap partition (or file) will shorten the life span of the microSD card; every write shorten's the lifespan of a flash device. IMHO, microSD cards are so cheap that this should only be of concern to the most cash-strapped of individuals.

Alternative solution, get a usb stick, put swap file on that. Or a exHDD… I just use a USB Stick, as I need the swap for compiling, lots of compilations run out of memory without it.

And lets not forget that SDCard’s are not the most pricy thing on the planet anymore. My class10 32gb was 10€… The more important issue here is that a swap on the card would slow down my pi, so on a USB Stick It’s, 'least in my situation, better.

1 Like

I guess having swap on a separate USB stick would be faster because it could perform I/O concurrently on both the microSD card and the USB stick. But that's assuming you are really using the swap for active virtual memory, and not just as a store for paging unused RAM out to swap.

Well, that's the point. In most cases I just need it as storage for unused pages while compiling tho.

Example: I think it was mysql which cried that there is not enough memory when I compiled it, adding a swap on my usb stick solved that issue.

But back on the actual topic, ye a option to create swap on a usb storage or the sdcard would be useful for people that do not know so much about linux, but it would need a proper description telling the cons and pros of having a swap and where you have it (sd/usb/hdd)