Linux Swap | Different Kinds and How to Use It

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ส.ค. 2024
  • This video is about Linux Swap and the different kinds of swap that exist. This shows you how to use swap partitions, swap files, and when not to use them all together. I also go over how big swap should be and how to change how often Linux will use swap. .
    ►► Digital Downloads ➜ www.cttstore.com
    ►► Reddit ➜ / christitustech
    ►► Titus Tech Talk ➜ / titustechtalk
    ►► Twitch ➜ / christitustech
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 250

  • @AndersJackson
    @AndersJackson 5 ปีที่แล้ว +53

    A hacker tip. If you forget sudo, just type.
    sudo !!

    • @amosnimos
      @amosnimos 4 ปีที่แล้ว +2

      thank.

  • @StringerNews1
    @StringerNews1 5 ปีที่แล้ว +32

    Mr. Miyagi: "swapon, swapoff"

  • @peterjansen4826
    @peterjansen4826 5 ปีที่แล้ว +21

    Chris, you can repeat the last command with !!. In your particular case you could have done it like this.
    ~ $ swapoff -a -v
    swapoff /dev/sda3
    swapoff: Not superuser
    ~ $ sudo !!
    !! replaces whatever you entered the last time. And yes, this is mostly used for all of us who forget to sudo. ;)

    • @GradyBroyles
      @GradyBroyles 5 ปีที่แล้ว +6

      When you forget to type sudo .. just
      sudo !!
      will put sudo in front of the last thing you typed. This made my morning the day I learned it.

    • @fuseteam
      @fuseteam 5 ปีที่แล้ว +5

      and here's the kicker you read it "sudo bang bang"
      when you forget sudo, just sudo bang bang 😎

    • @tylerdean980
      @tylerdean980 2 ปีที่แล้ว

      I can’t live without !! and !$

  • @terry.chootiyaa
    @terry.chootiyaa 5 ปีที่แล้ว +34

    *HI Chris, your video is NOT complete ...you should have at the beginning of the video defined what a "swap files" is ......"what is it and why it's used" ..... 😐😐*

    • @FoX84tac022
      @FoX84tac022 4 ปีที่แล้ว

      I was about to say something to the same degree. He just starts talking about where you would use one. I'm a long time Windows user/programmer/admin. This Linux shit is hard...

    • @SunnyGabe
      @SunnyGabe 3 ปีที่แล้ว

      @@FoX84tac022 It doesn't seem so hard after a time; I'm as well new to Linux and it's either you need to do step by step commands or just find that something, that only linux has, and that is better.

  • @denis11237
    @denis11237 5 ปีที่แล้ว +16

    Didn't know BTRFS didn't support swapfiles. vm.swappiness=X actually means X% of ram left to use before swap comes in.

    • @GradyBroyles
      @GradyBroyles 5 ปีที่แล้ว +3

      apparently it does now in 5.0+ of the kernel.

    • @danieljohnston3708
      @danieljohnston3708 4 ปีที่แล้ว

      Thanks, I've been trying to find out what that scale represents. None of the videos I've seen explain it very well.

  • @PoeLemic
    @PoeLemic 4 ปีที่แล้ว +1

    Chris:
    This video is exactly some of my prior experiences in Linux. I started doing something, made progress, then realized that I didn't know something that I needed to know -- from the beginning. But, again, I am thinking about giving it "Another Go" and trying to build a good skillset in Linux. But, thanks for filming this and being honest. What happened to you with creating a swap in btrfs, was my common, daily experience in Ubuntu Linux. But, that was before I tried Mint, and Mint seemed to be easier, kinder to me, and less of a learning curve to get things going (especially the packet manager).

  • @subsystemfailure8387
    @subsystemfailure8387 5 ปีที่แล้ว

    Really love your stuff! Keep up the good work :D

  • @gumbystern
    @gumbystern 5 ปีที่แล้ว

    I like the way you reversed the video when you ran htop so you were looking at the htop not only in your room but we could see you were looking at it on this video as well, your videos are inspiring for those going through the transition to Linux.

    • @johnwebster5983
      @johnwebster5983 ปีที่แล้ว

      Yes, the writing on the t-shirt was backwards.

  • @emmanuelpoirier4602
    @emmanuelpoirier4602 ปีที่แล้ว

    Thanks for explaining what the command does and why we use them, that helps a great deal to understand what we do and act logically and consciously.

  • @googIesux
    @googIesux 5 ปีที่แล้ว +12

    Arch + btrfs + swapfile user here; missing some features, but works for my purposes. Just gotta do your homework first, and I think you're right that for most it'd be easier and better just to use a separate partition.
    BTW, I use swap ;3

    • @KuroganeX3
      @KuroganeX3 ปีที่แล้ว

      I am on edge thinking about if to use swap file on my arch btrfs or use zram got 2tb nvme and 48 gb of ram

  • @gwgux
    @gwgux 5 ปีที่แล้ว

    I learned something about btrfs today. Thanks Chris!

  • @samuelitooooo
    @samuelitooooo 4 ปีที่แล้ว +3

    What stood out to me is the suggestion of 6 GB swap for 2 GB RAM. It’s usually suggested to make your swap equal to or 1.5x amount of the RAM you have. I never understood this. I mean yeah it helps with hibernate, etc. but as “extra RAM”, 1-2 GB swap may not be enough assistance for computers with 2 GB RAM, while those with 8 GB RAM should not have to worry anymore when it comes to basic use/needs. So I’m going to try Chris’ recommendation because I have a computer with 1 GB RAM that I’m gonna upgrade to 2 GB really soon and super cheap and easy on this particular computer I have. Unfortunately I’m still limited to lighter DEs like XFCE whereas I really want to try GNOME but oh well. XFCE is fun. (I’m a Linux newbie.)

  • @corey8704
    @corey8704 5 ปีที่แล้ว +34

    "Standard Linux installation...." Arch background..... Ok.

    • @WR3ND
      @WR3ND 5 ปีที่แล้ว +1

      Meh. It's a gooey instead of a GUI - six of one, a half dozen of the other.

  • @bertnijhof5413
    @bertnijhof5413 5 ปีที่แล้ว +8

    ZFS has the same problem as BTRFS, so I use a SWAP partition too.
    Default swappiness is 60 in Linux. I leave it like that, also in my 16 GB desktop running 3 or more VMs. In the past I used to set it to 10, but I stopped with this illusion. It is preferable, that the system starts swapping out pieces of code not used for some time, if the memory gets more occupied.
    I prefer more free memory over more free swap space. When a VM is loaded and needs the memory space, it will already have been freed and the VM doesn't have to wait for Firefox to be swapped out.
    I don't know the algorithms used to swap code in or out of memory in Linux, so I do not expect to be smarter than the system designers, who wrote the code and did choose those defaults.

    • @GradyBroyles
      @GradyBroyles 5 ปีที่แล้ว

      I'm still too nervous to use btrfs or zfs

    • @bertnijhof5413
      @bertnijhof5413 5 ปีที่แล้ว +2

      @@GradyBroyles I'm nervous with BTRFS too. ZFS is rock solid and very reliable. You can start using it in one partition for data only and look how it feels. That partition can be created by the disk utility and should be empty without a selected filesystem. You could even use an USB disk.
      I often use Virtualbox, if I want to try out new stuff, there you could try it out in the configuration equal to your hardware, just keep the disks smaller. In October it will be more easy, since Ubuntu 19.10 plans to support ZFS in the installer.

    • @GradyBroyles
      @GradyBroyles 5 ปีที่แล้ว

      @@bertnijhof5413 wow. super-cool advice. I'm going to try it out in just that manner.

    • @AndersJackson
      @AndersJackson 5 ปีที่แล้ว

      @@GradyBroyles zfs is RAID and LVM2 on steroids. It is way cool. It uses lots of RAM though.
      @Bert Nijhof. I do think that KVM/VirtualBox locks the RAM used by those virtual machines into the host machines RAM. So you can't swap virtual machines memory out on the hosts swap area.
      It is needed for the host software, if those virtual machines take up to large part of the host RAM. Then the host need to swap.

    • @alex.username
      @alex.username 4 ปีที่แล้ว

      What about when you only had a SSD? What would be your approach to SWAPP? Would you be worried about wearing it out from constantly writing to it by swapping?

  • @MrHRScrc
    @MrHRScrc 5 ปีที่แล้ว

    Thank you Chris.

  • @mmcv1987
    @mmcv1987 5 ปีที่แล้ว

    good explaination, Only example where a swap partition has an edge over a swapfile is when you have more then a single disk installed in an system with swappiness for all partitions, and also important to check the priority, if all those values are identical you basically are operating a stripped configuration and depending on your interface this could speed up you swap, I used to do this back in 2006-2009. I stopped this practice when memory became cheaper. (swapfile in such case would agravate the disk caching mechanism which utilizes most free memory (as it should) and FS overhead which is neglectable today but has been a thing in the past.)

  • @MotownBatman
    @MotownBatman 5 ปีที่แล้ว

    Question...
    In the past I keep a SWAP partition thats around 4Gig, In the past any larger of a parititon seem to screw up the memory at times. Whenever I run a monitor it never seems to use it, This Laptop Im on is a i3 4core with 8 gig

  • @bredsj
    @bredsj 5 ปีที่แล้ว

    Dear Chris, I recently subscribed to your channel and I find it amazing! Thanks a lot. I have an i7 with 32 Gb of memory, I see I have a 2 Gb SwapFile, do not see a swap partition. I am using Ubuntu 18.04 Desktop. I do scientific work, no gaming. I have now installed 1 Tb SSD (WD Black) and I do not want to do a new install, I've got licensed software that I still need to use for another few months. Shall I disconnect the swap file? Or make it bigger? I'll appreciate some advice. I plan to clone the current installing to SSD. Thanks again.

  • @hewfrebie2597
    @hewfrebie2597 5 ปีที่แล้ว +14

    6:46 *Chris is processing to figure the problem*
    (while a few moments)
    *FATAL ERROR*
    XD

  • @ahmedbouali7000
    @ahmedbouali7000 4 ปีที่แล้ว +1

    I'm new to linux, are VIM swap files automatically deleted or do I need to remove them?

  • @Spiritualitydefined
    @Spiritualitydefined 2 ปีที่แล้ว

    Hi Chris do wee need swap file for games in linux and will it help in game freezing, or is that just the game? or proton

  • @GradyBroyles
    @GradyBroyles 5 ปีที่แล้ว +4

    protip: you dont need gparted. command line command: lsblk will list all the block storage and partitions swap and everything. additionally you can use fdisk -l. It's a littel simpler especially if you're doing stuff in the terminal anyway

    • @alex.username
      @alex.username 4 ปีที่แล้ว

      Do you really think he doesn't know about lsblk?

    • @starfoxdelta
      @starfoxdelta ปีที่แล้ว +1

      ​@@alex.username The pro tip was for users like me who did not know this

  • @Sierra410
    @Sierra410 5 ปีที่แล้ว +5

    *"F STAB"*
    Sounds sharp :D

  • @PutraEka
    @PutraEka 5 ปีที่แล้ว

    Love your wallpaper

  • @daemakun
    @daemakun 5 ปีที่แล้ว +5

    Your title and description gave me the impression you'd also include SSD-saving ZRAM and running it symbiotically with file/partition swaps. A somewhat recent kernel addition was a very fast default de/compression algorithm for ZRAM and I thought you would have encountered that in your current research. It effectively gives users memory expansion through realtime, transparent, in-RAM compression. It's keeping Android smartphones and tablets with limited RAM from wearing out their fixed flash storage too soon. With a properly set up hierarchy via priority levels, whatever spills out of 1st level ZRAM can overflow into a swap file/partition on an SSD. Then when there is still memory page pressure (in a VM container beast, for eg.), a third level HDD swap file/partition as a last resort. I was looking forward to seeing an example of the real possibilities available to Linux users/admins. I really wanted to upvote this video. :(

  • @jefferson_santana
    @jefferson_santana 5 ปีที่แล้ว +2

    Bom vídeo. :)

  • @Canadian789119
    @Canadian789119 5 ปีที่แล้ว

    what if you don't have sysctl?
    My swap is always inactive, My laptop probably needs it with only 4gbs though.

  • @Bonez0r
    @Bonez0r 25 นาทีที่ผ่านมา

    New linux user here. Help me understand this. At 5:58, isn't the second command (dd) redundant after using fallocate? My understanding is that both of these commands create a swapfile with the specified name and size. The man page of fallocate even says (note the last part):
    "fallocate is used to manipulate the allocated disk space for a file, either to deallocate or preallocate it. For filesystems which support the fallocate system call, preallocation is done quickly by allocating blocks and marking them as uninitialized, requiring no IO to the data blocks. *This is much faster than creating a file by filling it with zeroes."*
    Also in other videos I've seen about creating a swap file, they don't use the fallocate command, but only the dd command. If it is true that only one of the two is needed, fallocate looks to be the preferred method because it's much faster and shorter. For example, creating a 12GiB swapfile with dd took 55 seconds, while creating a 12GiB swapfile with fallocate was instant.
    Btw I noticed something strange. That 55 seconds for a 12GB swap seems very slow to me, I tried multiple times and I get the same speed (~230 MB/s), but when I make an 8GiB swapfile it only takes 16 seconds consistently (~520 MB/s). No idea why.
    Btw2, this old laptop has 8GB of RAM and I gave it a 12GB swapfile. Htop shows I have 19.6GB of swap, but shouldn't it just show 12GB instead of adding up 8 + 12?

  • @rmjohnson144
    @rmjohnson144 3 ปีที่แล้ว

    I am in dire need to create a ginormous swapfile for my Cities: Skylines game. In 6-years woth of Expansion DLC for the game, it can get over 20GB of memory, plus another 8-16 GB of workshop mods and assets.
    Well, My linux Mint Cinnamon 20.1, with 16 GB RAM is choking on the game. I tried making the swapfile bigger as I only have 2GB created by default install.
    Can you go further into this, I think the swap partition is maybe the way to go, but I just can't find a way. Or maybe I can set it during linux install with a flag?
    Any help would be awesome. And thanks again for your videos. I find them very helpful.

  • @jauleris
    @jauleris 5 ปีที่แล้ว +1

    I feel like one point of swap files/partitions was missed out.
    Swaping out rarely used memory pages does free up memory for other purposes e.g. filesystem caching. So under some (quite rare) circumstances running without swap might actually be slower.

  • @acif58
    @acif58 4 ปีที่แล้ว

    Hi chris, can u please help me solving this problem? My linux laptop wont shutdown automatically.. i have to press down power button every time.

  • @jordicoma
    @jordicoma 4 ปีที่แล้ว

    Linux is great, you can create a swapfile on tmpfs (ramdisk) in order to use swap in ram when you have no ram left. Great explanation, I only knew how to create a swap partition, not a swapfile

    • @tourdesource
      @tourdesource 11 หลายเดือนก่อน

      Why would you create a swapfile in RAM when the point of swap is to take things out of RAM?

  • @albertopajuelomontes2066
    @albertopajuelomontes2066 5 ปีที่แล้ว +2

    I user a swap file with a btrfs filesystem on my laptopr and its working fine, you just have to make sure to be on the latest kernel and disable cow for that particular file.

    • @terry.chootiyaa
      @terry.chootiyaa 5 ปีที่แล้ว +1

      *explain more please and how you actually did this via video or blog..thanks*

    • @albertopajuelomontes2066
      @albertopajuelomontes2066 5 ปีที่แล้ว

      @@terry.chootiyaa it's perfectly explained on the arch wiki wiki.archlinux.org/index.php/Swap#Swap_file

  • @dinod7687
    @dinod7687 4 ปีที่แล้ว

    Hi Chris can u guide me on how to miracast on manjaro. I tried miraclecast but I'm unable to install it n cast on my tv. I use manjaro kde

  • @avmazzola
    @avmazzola 5 ปีที่แล้ว +2

    What is the best type of drive for the swap file(I.E SSD, Mech. Hard Drive or NVME)

    • @ChrisTitusTech
      @ChrisTitusTech  5 ปีที่แล้ว +5

      nvme of course

    • @GradyBroyles
      @GradyBroyles 5 ปีที่แล้ว +2

      @@ChrisTitusTech that's almost weird conceptually... overflow for your memory... in a different piece of memory. (sort of) lol

    • @AndersJackson
      @AndersJackson 5 ปีที่แล้ว +2

      Best is when you don't need swap at all.
      But then, it doesn't matter as the different discs are fast enough (maybe with the exception of SD disks, you might write to much on it). You should not use it that much, it should only swap part of memory (part of process/programs memory) that you don't use that often to the swap area, and writing it should not stop other programs from running. And reading should only be on demand, when your program need access to that memory again.
      So actually, not SD, no RAID and not net file systems I would say is what you should try to avoid. All other storage types are fast enough.

  • @leucome
    @leucome 5 ปีที่แล้ว

    I almost never need a swap but when I need one it needs to be huge. So I ended up using systemd-swap to manage swap-file, It can expand and contract the swap files on demand. So it resolved my issue for memory intensive workload. I configured it to generate a new 6GB files every time one get 20% full. To prepare at least one empty file in advance.
    By default it generate a new file when almost full. The default setting was too slow and it ran out of swap before the new files was ready.

  • @originalnick473
    @originalnick473 3 ปีที่แล้ว

    The first time I was setting up linux, I set swap mem to 200GB. IDK what happened, but the system didnt lauch and swap wasnt detected at all at the end

  • @JagHiroshi
    @JagHiroshi หลายเดือนก่อน

    Chris, I've always wanted to ask, have you ever tried Tiger Bread?

  • @cuttlefishn.w.2705
    @cuttlefishn.w.2705 4 ปีที่แล้ว

    If you're not running vms, and still want to control swappiness, does that still work because swap is a sort of "virtual RAM?"
    I'm running an 8-year-old laptop with 6GB of memory, and noticed my system would crash if I ran it longer than 2 days, hibernating twice. After seeing this, I immediately changed my swap partition from 2GB to 10GB (didn't have to resize in separate environment because I left 32GB free for future dual-booting plans), tested my memory by opening up several tabs in firefox until I saw swap being used in htop, and noticed that swap still wasn't being used.
    Great video, but I'll look elsewhere for more information on how swap is supposed to work.

  • @ShawnBuckingham
    @ShawnBuckingham 5 ปีที่แล้ว

    So, I have a Lenovo X1 Carbon 5th gen running popos with the default LVM settings.
    Occasionally, when I turn it on, it wouldn't boot. Pressing CTRL + Alt and 2 would show me a terminal process, where it would hang on "waiting on /dev/mapper/cryptswap"
    I got pissed off with this, so I turned swap off completely, and the problem has gone. I haven't encrypted my harddrive either.
    Being a laptop user, I'll probably jump back to this video specifically, and follow your guide - this video was very useful, so thanks.

  • @mohammadjuma4757
    @mohammadjuma4757 5 ปีที่แล้ว +3

    I have 16 GB memory, but when I turn off the SWAP and aggressively using the system and ran out of memory the system will simply stuck!!! I think turning off the SWAP isn't very wise thing. At least make a small SWAP partition and set the swappiness very low.

    • @nikiforossarantoglou5917
      @nikiforossarantoglou5917 4 ปีที่แล้ว

      I think he mentions that he turns it off if he isn't planning on using VMs. So I don't think there is any chance of maxing 16GB of RAM during normal/daily use. Yes of course, aggressively maxing out 16GB will crush it, but is there ANY chance you will actually max them nowadays without going for it?

  • @soa0086
    @soa0086 ปีที่แล้ว

    Hello , if anyone knows a have an issue. I recently changed swap partition to swap file. After that boot takes over 2 minutes. I made sure to comment out uuid. Any help ?

  • @rwbimbie5854
    @rwbimbie5854 5 ปีที่แล้ว +4

    *_If you have a system with 64gb ram, and your system is using... 7gb of it_*
    *_maybe slowing some of that down with Swap is a bad plan._* Same goes with using 7gb of 32 or 16 physical ram.
    I've been running years with 16gb ram Swap Off. Havent had the system cry or crash due to Out Of Memory

  • @DollopussD
    @DollopussD 3 ปีที่แล้ว

    Help I'm a Noob! Would a bigger swap file make playing media (DVD, Blu Ray etc.) easier?

  • @oogioboogie
    @oogioboogie 5 ปีที่แล้ว +4

    You can even get away with using zram as swap devices if you have a fast CPU. It basically dynamically allocate some portion of ram as compressed swap devices. You can also set the usage priority between multiple swap devices.

    • @GradyBroyles
      @GradyBroyles 5 ปีที่แล้ว +1

      that sounds completely bananas. I love it.

    • @dingokidneys
      @dingokidneys 5 ปีที่แล้ว +1

      You'd have to be hunting for every last tiny bit of memory and disk space would have to be at a premium for that to be a thing. Back in the day - 1990's - we used to fine tune swap and use tricks like this to eek out a little bit more but these days when memory and hard disk space is relatively cheap, just stick more memory in and, meh, why not, set up a swap partition.

    • @oogioboogie
      @oogioboogie 5 ปีที่แล้ว +2

      When you don't have any writeable disk, or in a diskless situation such as a netboot, this is a good temporary solution.

    • @dingokidneys
      @dingokidneys 5 ปีที่แล้ว +1

      @@oogioboogie Good usage case! And a neat solution.

    • @leucome
      @leucome 5 ปีที่แล้ว +1

      There is also zswap . This one is similar but use swap files, when it's full the data can be dumped on the drive. So it's more like a swap cache in the ram.

  • @lucasteganox9049
    @lucasteganox9049 3 ปีที่แล้ว

    Hey guys do you know a way to make a program/process unable to use swap memory?

  • @davidvantongerloo1907
    @davidvantongerloo1907 5 ปีที่แล้ว +6

    happy weekend chris....

  • @gopinathnath6747
    @gopinathnath6747 4 ปีที่แล้ว

    sudo dd if=/dev/zero of=/swapfile bs=1024 count=1048576
    Will this command differ for different GB?

  • @tromino2598
    @tromino2598 5 ปีที่แล้ว +2

    If you want to disable your swap partition, just know that if you don't delete the partition completely, there are some situations where systemd will automatically try to locate and swapon the partition on boot, even if it's removed completely from your fstab. I remember spending some time just sitting there confused until I found an ArchWiki page that told me to mask the device. :p
    Also, it would be cool to see a video on zram and zswap! I've been using either of them for a while. If you don't care about hibernation, then just having all your swap on a single zram block can be good enough (setting its size to twice the size of your RAM seems good for how much it could ever realistically hold). You can even use zram as a compressed RAM disk if you want to (filesystems with discard support are good for this).

    • @GradyBroyles
      @GradyBroyles 5 ปีที่แล้ว +2

      swapon....
      swapoff...
      literally how I remembered that

    • @AndersJackson
      @AndersJackson 5 ปีที่แล้ว +2

      Well, you got to love systemd, or not...

    • @GradyBroyles
      @GradyBroyles 5 ปีที่แล้ว +1

      @@AndersJackson I only love it because I don't know how to do linux init stuff w/o it. It's like an abusive relationship.

    • @AndersJackson
      @AndersJackson 5 ปีที่แล้ว

      @@GradyBroyles I know BSD, SYS V and systemd...

  • @analogidc1394
    @analogidc1394 5 ปีที่แล้ว +1

    One of the best explanations of swap. Thanks Chris.

    • @GradyBroyles
      @GradyBroyles 5 ปีที่แล้ว

      IKR. It needs to go on someone's "Learning Linux" youtube playlist

  • @tomaszgasior772
    @tomaszgasior772 5 ปีที่แล้ว +1

    4:13 You can disable/enable swap graphically, using GParted or GNOME Disks. Just right click on proper partition.

    • @champ784
      @champ784 3 ปีที่แล้ว

      It's still good to know how to do it via terminal, just in case. But yes, you're right, that's how I normally do it

  • @jwspiker
    @jwspiker 4 ปีที่แล้ว

    been trying to see if you go into the different partitions/file systems linux has ex2/ex4/ect or boot loaders linux has, as a windows guy that's dabbled with linux its one of the barriers i've struggled with or not been sure what to use.

  • @hewfrebie2597
    @hewfrebie2597 5 ปีที่แล้ว +1

    I got a 64GB RAM installed in my computer with a swap partition of approximately of 15.72 GiB with a 1TB of SSD. Is it a good setup? I also use it for hypervisor tasks such as creating software for experimental reasons although I'm still a student but I still use it. Especially that alien start menu icon lol. I wonder if people are actually going to area 51 even if it is 100 or 1000 or more it is still alot.

    • @ChrisTitusTech
      @ChrisTitusTech  5 ปีที่แล้ว +4

      64GB of ram doesn't need a swap. That is crazy amount of RAM.

    • @hewfrebie2597
      @hewfrebie2597 5 ปีที่แล้ว

      Oh also one thing I use this game development incase you're wondering.
      Edit: and pentesting as well.

    • @GradyBroyles
      @GradyBroyles 5 ปีที่แล้ว +2

      @@ChrisTitusTech that was my gut reaction.

    • @GradyBroyles
      @GradyBroyles 5 ปีที่แล้ว +1

      I can't imagine a case where you would ever need SWAP for general purpose computing if you have *that* much RAM.
      Re; USAF installation at the Groom Lake Proving Grounds (aka Area 51) They will chase you down in trucks and scare the shit out of you with machine guns. If that doesn't work, they'll kill you with the machine guns. Go have a nice alien themed desert rave. Gawds know I love a good rave in the desert (It's Burning Man week right now) but don't be dumb and try and cross the perimeter of the facility.
      There hasn't been anything interesting at Groom Lake for decades. People who pay attention to that stuff generally say that most (not all) of the stuff from GLPG is in Colorado somewhere and any number of equally as forbidden government facilities... whole spots of Colorado are blurred out of Google Earth and lots of people think some of those are the facilities in question. Who really knows, though

    • @AndersJackson
      @AndersJackson 5 ปีที่แล้ว

      @@ChrisTitusTech my only use case for that amount of memory is lots of virtual machines. :-)

  • @Vercinaigh
    @Vercinaigh 5 ปีที่แล้ว +2

    Good vid bud but you should cover the ability to have a SWAP file that grows or shrinks on demand as you need it, too.

    • @DaveAxiom
      @DaveAxiom 5 ปีที่แล้ว

      That's available?

    • @Vercinaigh
      @Vercinaigh 5 ปีที่แล้ว +1

      @@DaveAxiom yes it is, not fiddled with it yet

  • @nicholaspiacsek5415
    @nicholaspiacsek5415 5 ปีที่แล้ว +7

    Kernel 5.0 introduced btrfs swapfile support.

    • @GradyBroyles
      @GradyBroyles 5 ปีที่แล้ว

      but y tho? (not why is it in the kernel), but rather what's the use case for SWAP in a btrfs or zfs-like file system? I'm genuinely curious. I'm sitting here trying to imagine where that would be desirable in a practical setting.

    • @nicholaspiacsek5415
      @nicholaspiacsek5415 5 ปีที่แล้ว +2

      @@GradyBroyles I keep a swapfile around as a failsafe, in the unlikely event that I need more memory than what my 16G RAM provides. Also hibernation (though I don't personally fuss with that). There must not have been much demand for the feature, else I imagine it would have been implemented sooner. So, I guess I use it because it is trivial to implement and doesn't require a partition. But these use cases would apply equally to any file system. Also genuinely curious (and maybe naive): why would one view btrfs differently in this aspect?

    • @GradyBroyles
      @GradyBroyles 5 ปีที่แล้ว

      @@nicholaspiacsek5415 not sure. I'm kind of curious.

    • @ishanagarwal475
      @ishanagarwal475 4 ปีที่แล้ว

      U need to have separate subvolume for swapfile in btrfs otherwise snapshots won't work

  • @nielsvanaert4746
    @nielsvanaert4746 5 ปีที่แล้ว +2

    I have a 6GB swap partition and 32GB of RAM, but my system never uses the swap, and since I never use suspend / hibernate (never seen it stable on either Microsoft Windows or Linux), so it's kind of pointless, but have it just in case my system runs out.

    • @dingokidneys
      @dingokidneys 5 ปีที่แล้ว

      It's a resource cheap insurance policy. Disk space is not expensive these days.

  • @AndrewErwin73
    @AndrewErwin73 5 ปีที่แล้ว

    You only need 1.5x your physical memory of swap (if you have 4G of memory and using more than 6G of swap, you are either doing something wrong, or you are doing something of which your system simply is not capable) until you get to beyond 8G of memory. There are very few use cases (that I can think of, anyway) where a 16G system needs any swap at all. I have heard that there are software packages out there that take advantage of swap regardless of your actual system memory; if that is the case, it is probably a good idea to have SOME.

  • @buddyshearer4170
    @buddyshearer4170 5 ปีที่แล้ว +1

    Great job. Suggestion...Ram disks...Advantages & Disadvantages. What kinds of apps could benefit from having one.

    • @GradyBroyles
      @GradyBroyles 5 ปีที่แล้ว +2

      depends on what kind of ram you're talking about. If its volatile, then you have you re-apportion and use it with each boot. Not very useful. It wouold seem to me that nvme is literally a physical "ram disk" limiting further the uses for a ram disk on regular ole ram. There was a time when one would install something on a ram disk if the seek/access/read/write speed of the physical disk limited the performance of the software in some way. if the program is INSTALLED into ram, you can imagine how in 1996 this could be beneficial

    • @yvrelna
      @yvrelna 5 ปีที่แล้ว +4

      Ram disk is great when you need to work with sensitive files. Decrypt or download the sensitive file into the ramdisk, work with it like you do normal files, then reencrypt the file or upload the file somewhere else, then remove the ramdisk. The sensitive file never touches the persistent storage.
      As for performance, if your machine had enough RAM space, ramdisk is unlikely to be beneficial, as your files should already be in disk cache anyway.
      That's pretty much the only valid use case for ramdisk. The following other use cases are kinda questionable, but your milage may vary.
      If your machine is so under powered that you don't have enough RAM to keep everything in memory, ramdisk can be used to force a certain set of files to remain on RAM. However, this is unlikely to improve overall system performance, as the disk cache algorithm is generally much better at figuring out what files or should and shouldn't be kept in the disk cache to optimise system performance.
      Finally, if an application calls fsync frequently but you don't actually care about losing data for this particular application, then ramdisk may be beneficial as it avoids the forced roundtrips to the disk. In most cases, it's better to fix the application or configure it to avoid doing so much unnecessary fsync, but ramdisk can be a decent workaround.

    • @buddyshearer4170
      @buddyshearer4170 5 ปีที่แล้ว +2

      @@GradyBroyles Yeah, I'm an old dog from those early days in the 1980s when PC were getting started. We used to use them for slow starting applications when hard drives were slower. I was reading a recent article about someone using a ram disk for executing an incredibly large and long script so it got me thinking about ram disk vs SSDs so your comment resonated with me. The previous commenters comment about sensitive files was interest too. I always thought it was good getting other opinions just to have as options in the ole toolbox. Thanks!

    • @GradyBroyles
      @GradyBroyles 5 ปีที่แล้ว +1

      @@buddyshearer4170 I knew a dude who, just for the fun of it.. installed photoshop into a ram disk back when you could set any size one you wanted (w/in limits obvie) ..it was crazy, but it worked.

  • @kjn5991
    @kjn5991 5 ปีที่แล้ว +4

    I always change swappiness to 10 from 60 (default)

  • @user-jp7tw3sd3x
    @user-jp7tw3sd3x 5 ปีที่แล้ว +5

    My experience with linux swap is horrible. Using just Firefox I got the system to trash heavily while the swap usage a low as 1/4GB. What I'm trying to say is that if you get to use more than 1GB of swap, you are going to have a serious trashing that makes the system completely unresponsive. If you use hibernate then make RAM+1GB of swap partition.
    If you are running out of RAM memory, I would recommend you to first disable THP (Transparent Huge Pages). THP allows using 4MB memory pages, however sometimes they are not broken to 4KB when userspace frees parts of them, thus still holding significant portions of physical memory that could be re-used. Swap also has/had some issues with THP support.
    To be honest, even hibernate is not really that nice. I do prefer to close Firefox before hibernate, because it is faster to start it anew, than to wait for the system to bring it page per page from the swap after resume. (`htop` can also show page faults, so I've watched the process in real time.)
    Using NoCOW on btrfs should not be an issue. It just means the file would be overwritten every time and this i what you want. They actually did a lot of changes to make possible the use of swap file, so ... yeh, swapfile is a little bit experimental still.
    Actually NoCOW is recommended for virtual machine images too...

  • @CarinoGamingStudio
    @CarinoGamingStudio 5 ปีที่แล้ว +2

    i dont know if my system use the swap partition or not. thats why i click your vid quickly.

    • @GradyBroyles
      @GradyBroyles 5 ปีที่แล้ว +2

      if you're not using a COW fs, you might as well make a partition, turn it to SWAP with mkswap and activate with swapon. It may never get used, but then again, if you run a job on all your cores (like GCC or LLVM compiling) then it's nice to have *just in case*

  • @ManaaHraib
    @ManaaHraib 5 ปีที่แล้ว

    Please talk about *tasksel* tool , it's useful tool to install other ubuntu flavours at once

  • @vitiok78
    @vitiok78 5 ปีที่แล้ว

    Always make a little bit of swap. My Manjaro with 16Gb or RAM crashed when I was building an app from source without any swap

  • @zabilmaooz7780
    @zabilmaooz7780 3 ปีที่แล้ว

    What happens if swap also get full?

  • @joseph-danielprevost6812
    @joseph-danielprevost6812 5 ปีที่แล้ว

    I use ext4 and never had a problem. I use 10 gigs of swap I have 12 gig ram et it's working fine.

  • @stas.iegorov
    @stas.iegorov 5 ปีที่แล้ว +2

    By the way, you should also lower swappiness value if you have your system running on an SSD. This will save the SSD from excessive write cycles

    • @leucome
      @leucome 5 ปีที่แล้ว +1

      I guess it's mostly an urban legend. It was kinda true for the first small SSD with basic controller. And by that I talk about 1990 and early 2000 drive. By 2010 most SSD of over 100GB became resilient enough to write non stop 24h/24 for many years. Sure by writhing we shorten their expected life but some SSD have theoretical expected life of 25+ years even more than 100 years of non stop writhing for some model. Basically it's going to die of old age first anyway. Lowering the writhing to make them last more than 25 to 100 years kinda make no sense, I think.
      I used a 256GB SSD as a hard drive cache and swap for 10 years already and it still working fine. And I still do excessive writhing on it, who know maybe it's really going to work for 100 years.

    • @stas.iegorov
      @stas.iegorov 5 ปีที่แล้ว

      Eric Jacques fair enough and long live your SSD :) However, I bet that 10-year-old drive is built on MLC (if not SLC though) data cells which are quite more robust that todays TLC or even QLC. Both TLC and QLC have far less endurance comparing to the MLC drives. I’m not arguing that modern SSD drive has hefty life expectance, however it’s not quite uncommon for cheap drives to die silently within the first 1-1,5 years for no reason. But anyway, everybody just makes the choice depending on their knowledge, beliefs and confidence:)

    • @leucome
      @leucome 5 ปีที่แล้ว

      @@stas.iegorov Yeah your are right. It's a 256GB MLC. A new 512GB to 2TB TLC is more likely to have similar expected life than my old drive. To give an idea the worst expected life for a 256GB TLC that write at 1.5GB/sec 24 hours a day non stop is about 5 years. Sata drive are too slow to even care about doing the math.
      Still your are also right there are plenty of SSD that fail quick. Even in the first day. But the thing is as far as I know the theoretical expected cycle are true and have been verified by third party. So if a SSD that die quick from a common use. It was already defective from day one. It just took a while to notice that the drive was already broken.
      If you follow my logic it may be better to write a lot on a new SSD to find if something is wrong as soon as possible.
      I can be right or I can be wrong who know. But i'm telling that SSD die the first day or last forever and I do excessive writhing the first day. Is it causation or correlation or coincidence I do not know.

  • @menschjanvv2500
    @menschjanvv2500 5 ปีที่แล้ว

    Gentoo is a standard installation too :)

  • @WR3ND
    @WR3ND 5 ปีที่แล้ว

    Having had 64GB of RAM on my main PC for several years now, SWAP and page files are a bit of a chore booting to various media and OSs.

  • @wotblitz4071
    @wotblitz4071 5 ปีที่แล้ว +1

    If I have 32G RAM, should I go with 33G swap partition?

    • @GradyBroyles
      @GradyBroyles 5 ปีที่แล้ว +1

      no. the likelihood that you will ever need SWAP with that much physical ram is very low.

    • @utebruggenfompel5764
      @utebruggenfompel5764 5 ปีที่แล้ว +1

      @@GradyBroyles But if he has somehow completely filled his DRAM and puts his PC into hibernation?

  • @b747xx
    @b747xx 5 ปีที่แล้ว +1

    How I use it
    giga zram tmpfs (128GB)
    swap full size (128GB) in this ramdrive.
    I adjusted the swapiness so it start swapping early "compressing the ram"
    It's not rare that I use more than 100 GB on my 64GB system. and it's fast I mean, allocate 8 thread for the compression then voilà! The swapiness to start to compress early is so you don't hit a wall and block the system while it compress.

  • @danieljohnston3708
    @danieljohnston3708 4 ปีที่แล้ว

    Isn't the default swappiness on Ubuntu set at 60?

  • @PS_Tube
    @PS_Tube 5 ปีที่แล้ว

    I specifically made swap partition same as the size of my RAM (currently I just use 4 gigs).

  • @gregzeng
    @gregzeng 5 ปีที่แล้ว

    GKRELL shows swap in real time as a GUI history graph. That's how I discovered my 16 GB DDR3 meant not swap file use at all.

  • @danielfm123
    @danielfm123 5 ปีที่แล้ว +1

    could have explained zram and zswap,its very usefull for me

  • @nashaut7635
    @nashaut7635 5 ปีที่แล้ว

    s/swap file/swap space/g - FTFY ;-)
    Joke apart, IIRC it's pointless to have a swap space more than 3 times the amount of memory due to how memory pages are organized/managed by the kernel (or something similar) - i.e. 3 swap pages for one RAM page. Can you confirm?

  • @mauwiks
    @mauwiks 2 ปีที่แล้ว

    How about hosting over 20 WordPress sites/accounts?

  • @klightspeed
    @klightspeed 5 ปีที่แล้ว

    Not using `conv=notrunc` to dd will cause it to truncate then re-allocate the file.

  • @praetorxyn
    @praetorxyn 5 ปีที่แล้ว +3

    IMO everyone should be using LVM, so for GPT you'd have (I use LUKS encryption for my LVM partition so I need an u encrypted boot partition) :
    EFI System Partition - > /boot/efi
    Boot partition - > /boot
    LVM partition
    LVM partition has a volume group (I use vg_) with an LVM scheme like this:
    lv_root - > /
    lv_swap
    lv_home - > /home

    • @GradyBroyles
      @GradyBroyles 5 ปีที่แล้ว +1

      good advice

    • @AndersJackson
      @AndersJackson 5 ปีที่แล้ว +1

      I do use /boot on LVM2 too.
      And yes, doing LVM2 on top of RAID is great, use it a lot on servers. If you only want a bunch of disks (JBOD), you don't need RAID, just LVM2. But I would never run a serious system like that. The risk of loosing data is doubled when running JBOD compared to just run one disk.
      With LVM2 it is easy to add or remove disks (physicals or RAID) while running the machine too. I have migrated over a couple of machines from one hard drive to a new, larger while running the machine. Then I only needed to remove the disk physically when I rebooted the machine, after the transfer was done.
      But, XFS and BTRFS is better, as they behaves like LVM2 on top of RAID systems, and are even easier to manage.

    • @praetorxyn
      @praetorxyn 5 ปีที่แล้ว

      @@AndersJackson I don't even use RAID anymore, if I was going to setup a server I'd probably use FreeNAS and ZFS.
      I haven't tried out btrfs yet but it seems like it's stable enough I ought to try next time I setup a machine.
      For my personal machines, I use the setup above with the LVM partition LUKS encrypted. Hell, I did an overkill setup once where /boot and the LUKS header, as well as an 8192 KB LUKS encrypted key file, we're on an external USB. Without the USB, it would boot Windows. With it, on trying to boot Linux, it would prompt for the LUKS password, use it to decrypt the key file, and use the key file to decrypt the partition. Two factor Auth with plausible deniability. With an external LUKS header, there's no way to prove it's encrypted data in the first place.

    • @AndersJackson
      @AndersJackson 5 ปีที่แล้ว

      ​@@praetorxyn if you uses ZFS, you don't need to use BTRFS.
      Well, for a desktop I wouldn't use RAID either, just LVM2 on a disk partition. All other, including /boot on the LVM2.
      Sounds like a very interesting set up. I would love to see a more detail description. Tried LUKS one time, to store some crypt keys on a USB. I have forgotten the password now. :-)

    • @praetorxyn
      @praetorxyn 5 ปีที่แล้ว +1

      Anders Jackson I know that, I was saying try out btrfs instead of ext4 on a desktop.
      The setup isn't all that complex really, you generated a 8192 KB key file out of urandom or random, encrypt it with LUKS, then do a luksOpen and use the decrypted file to encrypt your partition, specifying args to store the header on the USB, I think it's just --header.
      The hard part is teaching the OS how to decrypt it at boot. You have to pass the LUKS kernel parameters in your bootloader (I used rEFInd - I prefer it over grub, especially when you theme it), but I was using Arch so the way I got it to work was by making a copy of the encrypt hook and modifying it so it'd decrypt the key file and then use the key file to decrypt.
      I think I still have the shell script somewhere (I failed to decrypt at boot so many times I wrote a script that I would just modify every time I needed to try something else to save time).

  • @LtMewS
    @LtMewS 5 ปีที่แล้ว

    Maybe a noob question but what is a swap file or what does it do

    • @corey8704
      @corey8704 5 ปีที่แล้ว +4

      It's "slow ram" in a way. Instead of hogging ram space the PC can stash lesser used items on the hard drive/SSD. Not as efficient but gives it extra memory. Similar to windows PageFile.

  • @nietzschescodes
    @nietzschescodes ปีที่แล้ว

    why on Debian or Ubuntu the default is 60?

  • @Red_man1
    @Red_man1 ปีที่แล้ว

    What if I need to increase from 1.5 gb to 2 gb

  • @ajinkyakandalkar9643
    @ajinkyakandalkar9643 5 ปีที่แล้ว

    A very good video.
    All doubts cleared.

  • @user-ol3tf1qi6c
    @user-ol3tf1qi6c 5 ปีที่แล้ว +1

    Actually, if you have 16 GBs of RAM or less, it's better to have a SWAP partition just in case for if your system maxes out your RAM usage, it doesn't lock up, but instead begins to swap more aggressively.

  • @DaveAxiom
    @DaveAxiom 5 ปีที่แล้ว +1

    I'm puzzled why a swap file is being recommended. The file must be used through the file system.

    • @StringerNews1
      @StringerNews1 5 ปีที่แล้ว +1

      Good point! I always found a way to make a swap partition for Linux with MBR partitions, and with GPT that limitation is lifted, so I don't see what the hangup is. Yes, one big advantage of using swap partitions is that there's no need to mount filesystems or go through an abstraction layer to read & write. Some people used to share Linux & Windows paging files when dual booting, but this caused problems with Windows seeing a corrupted pagefile, so I never did that. Besides, at the rate that HDD space grows, there's usually enough to spare.

  • @rwbimbie5854
    @rwbimbie5854 5 ปีที่แล้ว +1

    Swap Conundrum: 512mb ram Pi Plank.. sdcard or usb2 for drives
    Its obvious the swap will be in constant use.. so it will kill a highspeed sdcard (or ssd),
    and usb2 for swap on spinny drive is beyond Bottle Neck.. more like Syringe Neck

  • @SlideRSB
    @SlideRSB 5 ปีที่แล้ว +4

    This video was effective at only one thing. Educating us that btrfs and swap files don't mix. Obviously, that was a learning exercise for you as well. Unless you planned on redoing the video, I'd have changed the title and description to reflect this. Otherwise, I'd call this video a failure.

  • @s0litaire2k
    @s0litaire2k 5 ปีที่แล้ว

    ahh... The good old days when floppy drives were still used and RAM was measured in Mb's, the rule of thumb i was tought was your swap partition should be at least 2.5% of your ram. (programs in linux and windows routinely gobbled up massive chunks of memory so 4Mb -8Mb of ram got filled very quickly without swap.)
    Still used that till a few years ago when memory prices and sizes became less of an issue..
    Been running my box with 20Gb of ram for a couple of months and I totally forgot to set up swap, never noticed it wasn't running till i watched this. :D

    • @GradyBroyles
      @GradyBroyles 5 ปีที่แล้ว

      Remember using "ram disks" on 1st generation Macs?

    • @s0litaire2k
      @s0litaire2k 5 ปีที่แล้ว +1

      @@GradyBroyles I did use ram disk on windows and linux systems, never used macs ;)

    • @GradyBroyles
      @GradyBroyles 5 ปีที่แล้ว

      @@s0litaire2k they weren't well implemented on Macs. It was like the feature existed but was about as useful as a human appendix.

    • @AndersJackson
      @AndersJackson 5 ปีที่แล้ว

      Oh, and Emacs was considered a huge RAM hugging program.
      "Eight Megabytes And Constantly Swapping" :-)

  • @carlhenning
    @carlhenning 5 ปีที่แล้ว +1

    BTRFS does support swapfile, however with some limitations. Read more (Arch WIki): wiki.archlinux.org/index.php/Btrfs#Swap_file

  • @trmavirtual
    @trmavirtual 3 ปีที่แล้ว

    can you make a video about how to use raspberry pi as a router?

  • @utebruggenfompel5764
    @utebruggenfompel5764 5 ปีที่แล้ว

    What happens when both my dram and my swap are full? I use Linux to resurrect old PCs/Laptops so that's not an unlikely scenario.

    • @AndersJackson
      @AndersJackson 5 ปีที่แล้ว +1

      When you hibernate, you write the contents of the RAM to Swap, and then turn of the power, and loosing whatever was stored in your RAM. Notice that you must have space for what was previous in the swap area AND the contents of the RAM.
      When you later boot from hibernate state, the contents of the RAM is swapped in from Swap file again, as that area are persistent over power loss.
      If you run out of RAM and Swap area, Linux start killing of processes randomly. So if you are low of RAM, you really need Swap area. You can look how much Swap are used by run top(1) or htop(1) commands.

    • @utebruggenfompel5764
      @utebruggenfompel5764 5 ปีที่แล้ว +1

      @@AndersJackson Oh, thx, I didn't know about the killing of random processes. Good thing that I'm only running DEs that are easy on my DRAM :)

    • @AndersJackson
      @AndersJackson 5 ปีที่แล้ว +1

      @@utebruggenfompel5764 you will see some entries in the log for that. Don't remember how the log entry looks like, buy you will recognize it when you see it. :-)

  • @skashax777x
    @skashax777x 5 ปีที่แล้ว +1

    I have just installed manjaro on my old pc for my mother to use, that pc has 24 gb of ram and the swap partition is nearly 25 gb XD the ssd is 1tb so plenty of room to play with,
    I figured the pc don't need a swap but just in case it gets put in to hibernation its better to cover the ram capacity even though 24 gb of ram will never be utilised by my mother XD

    • @igorthelight
      @igorthelight 5 ปีที่แล้ว +1

      Set swapiness to 5 or 10

    • @skashax777x
      @skashax777x 5 ปีที่แล้ว

      @@igorthelight I've basically matched the swap to the ram purely for ease of hibernation, as I have no idea what my mother is capable of XD
      I also plan to turn it in to a home server so I can access my media remotely ;)

    • @igorthelight
      @igorthelight 5 ปีที่แล้ว

      @@skashax777x :-)

  • @Repligon
    @Repligon 4 ปีที่แล้ว

    Actually, you would usually need swap size of about a half of your RAM to do hibernation.

  • @johnh6524
    @johnh6524 5 ปีที่แล้ว

    Why not make a btrfs video - I'm using one on my server mirrored over 4 hard drives, my experience is largely positive I'm also using snapper. I found it all a bit of a learning curve. However, the snapshots are great, I had a massive problem with Seagate hard drives sleeping and corrupting the mirroring, nevertheless scrubbing worked perfectly and I lost no data (I am now running some decent WD hard drives).

  • @realmwatters2977
    @realmwatters2977 5 ปีที่แล้ว +1

    Swap? Use or not use SSD Hard drive?

    • @TigerPaw193
      @TigerPaw193 5 ปีที่แล้ว

      SSDs: To swap or not to swap, that is the question. Or in today's parlance, inquiring minds want to know.

    • @arnorobinwerkman
      @arnorobinwerkman 4 ปีที่แล้ว

      I have 32 gb ram, and a swap file of 16gb on main ssd.
      Never i had that my system used more than a few mb of swap.
      Like 25 to 150mb of swap is the most i ever used.

  • @michaelheimbrand5424
    @michaelheimbrand5424 5 ปีที่แล้ว +2

    PopOS thinks that 4GB of swap is a good idea on my 32GB Thinkpad. What´s the logic there?

    • @godnyx117
      @godnyx117 5 ปีที่แล้ว

      😂😂😂😂😂

    • @AndersJackson
      @AndersJackson 5 ปีที่แล้ว

      Ask PopOS? I don't know. Maybe that they think it is good to have when it eventually get crowded in the RAM?
      If you do hibernate, you need more persistent swap memory, at least that was the case when I last looked at it.

    • @dingokidneys
      @dingokidneys 5 ปีที่แล้ว +1

      Resource cheap insurance policy. If you ever do bump your head against the ceiling the system has something to work with, and is it vital that you have that 4Gb for working files or can you afford it?

  • @TheRangeControl
    @TheRangeControl 4 ปีที่แล้ว

    IF you are ANYTHING like me, and had "NO CLUE" what a "swapfile" even is, here is a link to a basic explanation. Though, I will tell you that it's basically hard drive over flow buffering which is written to, when the RAM is full (if I now understand it correctly):
    th-cam.com/video/0mgefj9ibRE/w-d-xo.html

  • @tenand11
    @tenand11 5 ปีที่แล้ว +1

    btrfs vs ext4 which is better?

    • @AndersJackson
      @AndersJackson 5 ปีที่แล้ว

      Depend on what you want to use it for.
      BTRFS is like having RAID in the bottom and then LVM2 on top of that and then make partitions with some other file system in that, like ext4 or xfs or jfs.
      So many of the benefits of BTRFS you can get with the set up I wrote, but a bit more complicated to manage. BTRFS take more memory though, I believe. But that might have changed now.

    • @dingokidneys
      @dingokidneys 5 ปีที่แล้ว +2

      Apparently the maintainer of ext4 is now saying that it's just a stop-gap until BtrFS takes over as the default file system.
      That was enough to push me into looking closely at BtrFS - i.e. setting up an old laptop with it and starting to experiment.

    • @DaveAxiom
      @DaveAxiom 5 ปีที่แล้ว

      BTRFS is still in development. I'd like to hear why Chris Titan uses BTRFS when no one recommends using it!

    • @dingokidneys
      @dingokidneys 5 ปีที่แล้ว

      @@DaveAxiom BtrFS has been in the Linux kernel for 10 years. It is used by Oracle Linux and SUSE Enterprise Linux as well as Synology on it's NAS devices.
      You want to try Linux Mint with EXT4 and take snapshots with Timeshift, then switch to Linux Mint with BtrFS and take Timshift snapshots. BtrFS is so much faster and so easy to use which makes for a more reliable system in my book.

    • @AndersJackson
      @AndersJackson 5 ปีที่แล้ว

      @@dingokidneys you can take snapshots with LVM2, can't you?

  • @ZsomborZsombibi
    @ZsomborZsombibi 5 ปีที่แล้ว +1

    My swapfile, kept on a ramdisk, is extremely fast.
    *grin*

  • @informativecontent4778
    @informativecontent4778 หลายเดือนก่อน

    now brtfs supports swap file

  • @JRK_RIDES
    @JRK_RIDES 5 ปีที่แล้ว

    I'm still so confused so don't we turn on swap again and uncomment the part we commented(using #)