Como Activar memoria de intercambio swap / Cuento mi experiencia

in STEMGeeks2 years ago

Español


Recientemente, escribí un post sobre mi experiencia con Debian Testing (“Review: Debian GNU/Linux bookworm/sid en un SSD comprado en AliExpress”). En esa oportunidad mencioné que había instalado Debian completamente en un nuevo SSD SATA, incluyendo la raíz “/” y la memoria de intercambio “swap”. Sin embargo, también tenía un disco sólido NVMe M.2 de 16 GB que quería utilizar de manera práctica. Tuve dos opciones: usarlo como almacenamiento adicional o trasladar la partición swap a ese disco. Opté por la segunda opción para aprovechar la velocidad de este tipo de discos y mejorar el rendimiento, ya que mi equipo solo tiene 4 GB de memoria RAM.

Borré la partición de intercambio “swap” del disco SSD y redimensioné la partición "/" para que ocupara todo el espacio del disco. Luego, le di formato "swap" al disco NVMe, ocupando los 16 GB de manera provisional, con el fin de realizar las pruebas pertinentes. Al principio, todo funcionó a la perfección. Sin embargo, después de reiniciar el equipo, la memoria de intercambio se encontraba desactivada y tuve que activarla manualmente desde el Gestor de particiones de KDE.


Después de hacer una consulta en Twitter, recibí respuestas oportunas de varios usuarios. Me guiaron para encontrar la solución y los comandos necesarios para que la partición de intercambio se monte automáticamente cada vez que se inicie el sistema operativo.


La solución es agregar o modificar una línea en el archivo de configuración /etc/fstab para que la partición de intercambio "swap" se monte automáticamente cada vez que se inicia el sistema. Para hacer esto, debes seguir los siguientes pasos:

1-. Abre una terminal y ejecuta el siguiente comando para identificar el UUID de tu partición de intercambio:

sudo blkid

Este comando mostrará el código de información único (UUID) de cada partición identificada por el sistema. Necesitamos copiar todo texto dentro de las comilla "", ejemplo: UUID="2b0ab7dd-e3b5-4ce7-8f24-d6f6a52578654".

2-. Abre el archivo /etc/fstab con un editor de texto con permisos de administrador, por ejemplo:

sudo nano /etc/fstab

3-. Agrega o actualizar una nueva línea al final del archivo, con la siguiente información:

UUID="UUID de la partición de intercambio" none swap defaults 0 0

Reemplaza "UUID de la partición de intercambio" (omitir las comillas) con el UUID de tu partición de intercambio obtenido en el paso 1.



Muchas gracias a todos los que me orientaron a encontrar la solución, estaré publicando este post en twitter y mencionando a cada uno que dejó su comentario en mi tweet. Con estos 3 simples pasos queda solucionado. ¿Crees que es buena idea usar la memoria Nvme para montar la partición swap?. Me gustaría leer sus comentarios. Un abrazo.


English


Recently, I wrote a post about my experience with Debian Testing ("Review: Debian GNU/Linux bookworm/sid on a SSD bought at AliExpress"). At that time I mentioned that I had installed Debian completely on a new SATA SSD, including the root "/" and swap memory. However, I also had a 16GB NVMe M.2 solid-state drive that I wanted to use in a practical way. I had two options: use it as additional storage or move the swap partition to that disk. I opted for the second option to take advantage of the speed of this type of disk and improve performance, since my computer only has 4 GB of RAM.

I deleted the "swap" swap partition from the SSD disk and resized the "/" partition to take up all the disk space. Then, I formatted the NVMe disk "swap", occupying the 16 GB temporarily, in order to perform the relevant tests. At first, everything worked perfectly. However, after rebooting the computer, the swap memory was disabled and I had to enable it manually from the KDE Partition Manager.


After making a query on Twitter, I received timely responses from several users. They guided me to find the solution and the necessary commands to make the swap partition mount automatically every time the operating system boots.


The solution is to add or modify a line in the /etc/fstab configuration file so that the swap partition is automatically mounted every time the system boots. To do this, you must follow the steps below:

1-. Open a terminal and run the following command to identify the UUID of your swap partition:

sudo blkid

This command will display the unique information code (UUID) of each partition identified by the system. We need to copy all text inside the quotes "", example: UUID="2b0ab7dd-e3b5-4ce7-8f24-d6f6a52578654".

2-. Open the /etc/fstab file with a text editor with administrator permissions, for example:

sudo nano /etc/fstab

3-. Add or update a new line at the end of the file, with the following information:

UUID="UUID of the exchange partition" none swap defaults 0 0

Replace "swap partition UUID" (omit the quotes) with the UUID of your swap partition obtained in step 1.



Thank you very much to everyone who guided me to find the solution, I will be publishing this post on twitter and mentioning everyone who left a comment on my tweet. With these 3 simple steps it's solved, do you think it's a good idea to use Nvme memory to mount the swap partition. I would like to read your comments. Best regards.

Translated with www.DeepL.com/Translator (free version)


Images are my own or screenshots taken by me, unless outside sources are indicated.


Discord: alberto0607#6813
Follow me on: Twitter

Sort:  


~~~ embed:1624790999603023874 twitter metadata:NzUwNjk4MDQ2NDg5NTgzNjE2fHxodHRwczovL3R3aXR0ZXIuY29tLzc1MDY5ODA0NjQ4OTU4MzYxNi9zdGF0dXMvMTYyNDc5MDk5OTYwMzAyMzg3NHw= ~~~

~~~ embed:1624985728588316673 twitter metadata:MjIxMjY2NDQ2fHxodHRwczovL3R3aXR0ZXIuY29tLzIyMTI2NjQ0Ni9zdGF0dXMvMTYyNDk4NTcyODU4ODMxNjY3M3w= ~~~
The rewards earned on this comment will go directly to the people( @sorprendente, @alberto0607, @susurrodmisterio, @aguamiel ) sharing the post on Twitter as long as they are registered with @poshtoken. Sign up at https://hiveposh.com.

Congratulations @alberto0607! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You received more than 10000 upvotes.
Your next target is to reach 15000 upvotes.
You got more than 1000 replies.
Your next target is to reach 1250 replies.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out our last posts:

Valentine's Day Challenge - Give a badge to your beloved!
The Hive Gamification Proposal
Support the HiveBuzz project. Vote for our proposal!

Hola @alberto0607. Agradecemos tu tutorial como un valioso aporte tecnológico. Tu publicación ha recibido un voto de parte de "Autismo: Un Mundo Excepcional" ahora con presencia en HIVE, gracias a su Proyecto @mundo.autismo.

anigif.gif

Hello @alberto0607. We appreciate your tutorial as a valuable technological contribution. Your post has received a vote from "Autism: An Exceptional World " now with a presence in HIVE, thanks to their Project @mundo.autismo.

Conoce nuestra Comunidad / Meet our Community
Bienvenidas las Delegaciones / Welcome Delegations

Trail de Curación / Curation Trail

Un excelente tutorial para los que buscan sacar mayor rendimiento a sus Pc usando Linux. Gran trabajo querido amigo. Gracias por compartirlo

Muchas gracias por compartir amigo. Si, a pesar de no tener un equipo con muchos recursos, he logrado que su rendimiento se óptimo.

Excelente aporte a la comunidad linuxera! Gracias por compartir tu experiencia.

Muchas gracias amigo! Ando explorando y explotando el potencial de Linux.

Sabes ahora en el artículo veo mejor el panorama y bueno si quieres algo diferente te recomendaria no usar la partición swap en ssd quizas zram podria se una alternativa, claro como son solo 4 GB de RAM puede que incluso usar la swap en archivo sea mejor, cambiando el particionado del disco de ext4 a btrfs. Btrfs ha venido implementado muchas mejoras para el manejo de nvme y ssd mejorando el uso de estos y evitando que se degraden por escrituras innecesarias. Si lo piensas dejar en ext4 revisa si tienes activo trim si no activalo para que se corra periodicamnete con cron y reduce el número de swapines para que el uso de swap sea cuando la Ram este al 90% u 80%. para Zram, alguno de estos vídeos te puede ayudar no tengo para Debian en especifico pero sirven de guia.

Zram viene teniendo un desarrollo muy bueno pero yo lo recomeindo con 8GB de Ram o más, por eso en este caso especifico, preferiria swap a archivo.

La swap en archivo esta en este vídeo en el indice te indica el minuto exacto donde lo toco

Muy valiosa tu información @ubaldonet. Voy a revisar el material que me enviaste.
Sabes que decidí usar la Nvme de esa manera, porque esta era usada como memoria Intel optane, por cierto muy mal invento.


BANNER AMAZING.png You've been curated by @amazingdrinks! Delegations welcome!
Find our community here

Curation Trail

Congratulations, your post has been upvoted by @dsc-r2cornell, which is the curating account for @R2cornell's Discord Community.

Curated by Blessed-girl

r2cornell_curation_banner.png

Enhorabuena, su "post" ha sido "up-voted" por @dsc-r2cornell, que es la "cuenta curating" de la Comunidad de la Discordia de @R2cornell.

Visit our Discord - Visita nuestro Discord

!ALIVE
!PGM
!LOLZ

Sent 0.1 PGM - 0.1 LVL- 1 STARBITS - 0.05 DEC - 1 SBT - 0.1 THG - 0.000001 SQM - 0.1 BUDS tokens to @oscarps

remaining commands 3

BUY AND STAKE THE PGM TO SEND A LOT OF TOKENS!

The tokens that the command sends are: 0.1 PGM-0.1 LVL-0.1 THGAMING-0.05 DEC-15 SBT-1 STARBITS-[0.00000001 BTC (SWAP.BTC) only if you have 2500 PGM in stake or more ]

5000 PGM IN STAKE = 2x rewards!

image.png
Discord image.png

Support the curation account @ pgm-curator with a delegation 10 HP - 50 HP - 100 HP - 500 HP - 1000 HP

Get potential votes from @ pgm-curator by paying in PGM, here is a guide

I'm a bot, if you want a hand ask @ zottone444


@alberto0607! You Are Alive so I just staked 0.1 $ALIVE to your account on behalf of @oscarps. (2/10)

The tip has been paid for by the We Are Alive Tribe through the earnings on @alive.chat, feel free to swing by our daily chat any time you want.