Skip to playerSkip to main content
  • 2 days ago
Transcript
00:00hello i was asked to show how to set up zram on debian and derivatives
00:05this is on debian i'm not sure if it is exactly the same on the derivatives
00:10probably it is you can try it and tell me in case it's not the same or in case any problem occurred
00:19there are three things that help you manage your zram on your debian and derivatives machine
00:28first a package second the service associated with it and the third is the configuration file as
00:36we're gonna see for the package if you want to get it on your system you simply run the command
00:42apt install zram tools this way and it should install for you clear out the screen the second
00:54thing is the service which should be in our case zram swap we can check it
01:02by running systemctl status zram swap and we can see that it's automatically enabled and started
01:13you can enable you can disable it and stop it and start it and enable it the way you like simply by
01:19running the relevant commands to those operations like stopping it by running systemctl stop zram swap
01:30that can come in handy in case you want to change the settings you need to stop the service
01:35and start it again let's start it again and we can check the status to see if it is already started
01:44as long as it is the way you see it here it means it started we should clear out this thing all right
01:53now we are able to jump into the configuration file and discuss it together in my case
01:58this or in the case of this piece of software the configuration file should be in slash etc slash default
02:07slash zram swap we have some parameters that need to be configured in order to meet what you would like
02:19to have in your system the first is the algorithm which probably stands for algorithm and that is
02:29for the compression of your zram in this case or in my case it's set to lz4 the compression of
02:40zstd is superior and the speed of lz4 is superior you can choose whichever you want in my case
02:47i'ma change it to the std since it was not the initial value
02:55maybe i should show you first how much is the size of my zram by running the command lsblk in my case it's
03:05the size is 783 no the size is 967 sorry that one is another partition so the size is
03:17967 i showed you this since we want to change some of the parameters in the configuration file and seeing
03:25them take taken effects on this system so the algorithm which we said we should change them
03:33in my case i'ma put it zstd in case you don't want to change it keep it the way it is percent is the
03:40size of your zram depending on the size of your ram in my case 967 because the ram is 2 gigabytes you
03:49can change it the way you like you can for example set it to 30 percent like mine here is the static
03:56amount of ram that should be used for the for the zram device let's set it to 384 and the priority let's
04:05keep it the way it is in case you have multiple ram methods on your system that this should prioritize
04:12whichever of them and now we can save if you are running nano by pressing ctrl x y and enter
04:22before restarting the service it's still the same as before we are able to restart the service in order
04:30to see the changes taking effect on our system like this and now let's see again and we can see that
04:38see it becoming 580 in case you don't want to have more than a way of swap on your system since our
04:50debian machine comes by default with swap partition as you see here it's the traditional way for
05:00linux systems you should go to slash etc slash fstab and then you look for the line that has the swap in
05:12it which should be here the file system is swap the other ones should be something like xt4
05:19butterfs etc there are so many ones depending on your configuration this line either you comment it by
05:28adding the hash sign in front of the whole line or simply remove it in my case i'm not gonna do it
05:36and then you save and exit and then you definitely need to use a piece of software in case you want to
05:43totally get rid of the partition of the swap of your system by you use a piece of software like gparted which
05:53can be easier and reduces the possibility of breaking your system since playing around with
06:04your partitions can damage your system and break it so try to use something like gparted remove the
06:11partition and then add it as a space to to another partition make sure it's not a partition where you have
06:18some of your important data otherwise it will destroy it i'm not gonna do it for this video
06:26i don't think you need much explanation about it just make sure you know what you're doing
06:33otherwise we are done showing how to set up zram on debian and derivatives please make sure you
06:39subscribe like share and comment i'm signing out and peace
Be the first to comment
Add your comment

Recommended