Originally posted by GreyGeek
View Post
Announcement
Collapse
No announcement yet.
Comparison of Ext4 and Btrfs
Collapse
This topic is closed.
X
X
-
Comparison of Ext4 and Btrfs
After reading this thread I, coincidentally, began copying critical files from my /home account to my new Btrfs sdb drive. Both drives are 750GB. Sda1 had 597GB free and sdb1 had 690GB free. I also used send & receive to move over my @ and @home backup snapshots. When I finished I noticed that sdb1 was left with 554GB, 43GB less than sda1, but sda1 has everything on it including the two bkup snapshots! Both drives use default compression.
Sent from my iPhone using TapatalkLast edited by GreyGeek; Apr 12, 2017, 09:32 AM.
- Top
- Bottom
Leave a comment:
-
That explains why I never observed the swap file being used when it was available in my previous installation. Also, in the back of my mind, was a recollection that Btrfs didn't use swap, but given the condition of my memory it's not something I trust these days.Originally posted by oshunluvr View PostHowever, btrfs currently cannot properly handle swapfiles so although it's created, it's not being used.
Sent from my iPhone using Tapatalk
- Top
- Bottom
Leave a comment:
-
OK, did a test and some research. If you choose manual partitioning and btrfs, the system does indeed create a swapfile. However, btrfs currently cannot properly handle swapfiles so although it's created, it's not being used.
btrfs basically ignores it:
There was a bug filed during alpha testing (I think) regarding this.Code:[FONT=monospace][COLOR=#54FF54][B]stuart@zestyVM[/B][/COLOR][COLOR=#000000]:[/COLOR][COLOR=#5454FF][B]~[/B][/COLOR][COLOR=#000000]$ free -m[/COLOR] total used free shared buff/cache available Mem: 1997 782 118 4 1096 1050 Swap: 0 0 0 [/FONT]
So currently; If you're proficient enough to want use btrfs, you either do it by manually partitioning and creating a swap partition, or use a different non-btrfs partition to hold the swap file, or don't use swap.
- Top
- Bottom
Leave a comment:
-
Thought you'd find this interesting, GG - had a discussion on Reddit not long ago about whether or not to use swap. Some very interesting points were made - someone asked how much swap to use for a desktop machine with 64GB of RAM.Originally posted by GreyGeek View PostI used an 8GB swap partition before, when I added Neon to Kubuntu 16.04. It was never used. When I installed the Neon Users Edition on this new HD I didn't create a swap partition and haven't noticed any negative consequences.
Where we ended up? Glad you asked
Kernel expects to be able to page some stuff out; as an example, memory used to start an application that is not required for the application to run; better to have a few more disk buffers than stale data in memory.
I'd really never looked at it that way - where we ended up with the question was 30GB if he intended to hibernate (kernels compress hibernation images - target size is 2/5 of installed RAM) or 2GB without hibernation.
Anyway, got a couple links for you to play with - kernel documentation on swap management:
https://www.kernel.org/doc/gorman/ht...rstand014.html
This kinda turned around my thinking on swap. Actually, Mel Gorman's whole book is online here -There are two principle reasons that the existence of swap space is desirable. First, it expands the amount of memory a process may use. Virtual memory and swap space allows a large process to run even if the process is only partially resident. As “old” pages may be swapped out, the amount of memory addressed may easily exceed RAM as demand paging will ensure the pages are reloaded if necessary.
The casual reader may think that with a sufficient amount of memory, swap is unnecessary but this brings us to the second reason. A significant number of the pages referenced by a process early in its life may only be used for initialisation and then never used again. It is better to swap out those pages and create more disk buffers than leave them resident and unused.
Understanding the Linux Virtual Memory Manager
Anyway, not disagreeing with not having swap, but thought you would find this stuff kinda interesting
cheers -
- Top
- Bottom
Leave a comment:
-
My recollection is that in the manual mode for disc setup, with Ext4 partitions and no specifications of a swap file, the installation complains and you need to define the swap file. When I used Btrfs without a swap file there was no problem. On a re-install, I decided to define the swap file and used a modest value of 1.5 GiB to be on the safe side.
- Top
- Bottom
Leave a comment:
-
I used an 8GB swap partition before, when I added Neon to Kubuntu 16.04. It was never used. When I installed the Neon Users Edition on this new HD I didn't create a swap partition and haven't noticed any negative consequences.
- Top
- Bottom
Leave a comment:
-
I wasn't thinking: The default install uses ext4, not btrfs, so it wouldn't matter. You have to choose manual to get btrfs, so I make a swap partition if I need one. I'm doing a new install without building a swap partition first. Let's see what it does.Originally posted by oshunluvr View PostOK, that's new. I'll try a VM install using btrfs and report back.
- Top
- Bottom
Leave a comment:
-
BTRFS guys say use noatime. I've been using relatime until recently when I read that. I can't say I've seen any difference and you might not most of the time. It seems to mostly effect snapshots (causing them to artificially expand) so if you don't keep a lot of them around or keep them for long, you might not even notice.Originally posted by vinnywright View Postshould I add a :noatime: option to this (from my fstab)
VINNYCode:#TB-drive /dev/sdb1 /mnt/btrfs btrfs rw,relatime,space_cache,compress=lzo 0 0
- Top
- Bottom
Leave a comment:
-
should I add a :noatime: option to this (from my fstab)
VINNYCode:#TB-drive /dev/sdb1 /mnt/btrfs btrfs rw,relatime,space_cache,compress=lzo 0 0
- Top
- Bottom
Leave a comment:
-
The default behavior for 17.04 in ext4 is to create a swap file.Originally posted by oshunluvr View PostAFAIK, all versions of Kubuntu use a swap partition, not a file. If you really need to use a swap file for some reason, you would have to use nodatacow on the file system it resided on. Not the most optimal set up to say the least.
Sent from my ZTE A2017U using Tapatalk
- Top
- Bottom
Leave a comment:
-
AFAIK, all versions of Kubuntu use a swap partition, not a file. If you really need to use a swap file for some reason, you would have to use nodatacow on the file system it resided on. Not the most optimal set up to say the least.Originally posted by mr_raider View PostWhere does zesty place teh swap file on brtfs setups?
- Top
- Bottom
Leave a comment:
-
Re. noatime: Going a step further this article https://lwn.net/Articles/499293/ explains that atime can actually significantly increase space usage and drastically increase drive activity because a simple "read" operation of a snapshot will generate a file change from BTRFSs point of view, so all the snapshot-ed files will be duplicated from a simple read operation. Not good.
nodatacow is probably not a good idea. Not only does it turn off compression, it also turns off datachecksum. It's only sensible during random writes to large database files. The other potential use is when using virtual drives (like with VirtualBox). My preference was to create an ext4 partition and host my VBox drives there instead. Seemed safer and more reasonable.
- Top
- Bottom
Leave a comment:
Users Viewing This Topic
Collapse
There are 0 users viewing this topic.
Leave a comment: