Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
06-27-2013, 03:19 AM
|
#1
|
Member
Registered: Jan 2013
Location: EU
Distribution: Debian
Posts: 269
Rep:
|
Setting up btrfs - questions
Greetings! I've heard a lot about the new btrfs, so I decided to give it a go. I'm trying to setup arch linux on a btrfs as the main file system. I've managed to get the system running, but I have some questions about btrfs. It seems so different from anything I've tried so far.
Subvolumes:
I am confused. With filesystems like ext4 you had to create a new partition on the HDD, format it with mkfs.ext4, and mount it by using appropriate entries in fstab. I would follow this path with btrfs (i.e. create a btrfs filesystem on each partition, and have it mounted), but I read somewhere this is inefficient, and that I should instead make one large partition with btrfs on it and mount subvolumes accordingly. Suppose a btrfs volume is mounted on /mnt. Creating subvolumes goes like this: "btrfs subvolume create <path>", and path can be like:
/mnt/home
/mnt/var
/mnt/var/log
But when subvolumes are created they seem to be already present in the VFS. There is no need to add fstab entries for subvolumes. This is confusing. What do I do, if I want to mount these subvolumes with custom mount options i.e. nodev,noexec,nosuid? What's the proper way? Should I use fstab? Can these mount options be specified per subvolume without using fstab?
Compression:
Does btrfs enable compression by default (without giving it any mount options)? If compression is enabled, does it also compress hard-to-compress files? if yes, is there a way to disable it? If no, is there a way to finetune it?
I've poked around a bit with compression, and I can't seem to get the compression to work the way I want. I enabled zlib compression for root subvolume, but I'd like to set the compression for subvolimes like /mnt/home and /mnt/var to lzo, and disable compression for /mnt/var/log. How do I do this? I tried using different mount options in fstab, but the filesystem does not seem to abide. Every subvolume seems to use the same compression as the root subvolume (zlib in this case).
Folders:
What's the deal with subvolumes and folders in btrfs? Why does it even use folders? Why not simply use subvolumes in place of folders? Every folder would get the benefits of a subvolume. Not sure what the drawbacks would be.
See ya!
|
|
|
06-27-2013, 03:16 PM
|
#2
|
Moderator
Registered: Mar 2008
Posts: 22,361
|
I can't answer them all but I am pretty sure about this.
"Does btrfs enable compression by default?" In everything that I have seen, no. You may have some distro's that allow it on install. Seems pretty easy to enable.
One note. I have been playing with it on OpenSuse with good success. It seems to do a great job of making it easy to save copies that will fill up your drive if you don't watch out.
I'd look at the btrf site for their current documentation and links to info. It's all new to us also.
|
|
|
06-28-2013, 10:56 AM
|
#3
|
Senior Member
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070
|
Quote:
Originally Posted by displace
I'm trying to setup arch linux on a btrfs as the main file system. I've managed to get the system running, but I have some questions about btrfs. It seems so different from anything I've tried so far. 
|
I wouldn't, at this point, be trying to set up BTRFS as the main file system - I've heard a couple of reports of systems having problems -performance, mainly- when BTRFS is used as an 'everything' file system, but less so when used as a dedicated 'storage' system. Maybe the latest BTRFS and kernel doesn't suffer from those problems; How is your experience, so far?
Quote:
Originally Posted by displace
It seems so different from anything I've tried so far. 
|
Do I take it that you haven't previously used ZFS? Or, maybe even LVM on say an Ext filesystem? Then you will find yourself in a different world.
Quote:
Originally Posted by displace
Compression:
Does btrfs enable compression by default (without giving it any mount options)? If compression is enabled, does it also compress hard-to-compress files? if yes, is there a way to disable it? If no, is there a way to finetune it?
I've poked around a bit with compression, and I can't seem to get the compression to work the way I want. I enabled zlib compression for root subvolume, but I'd like to set the compression for subvolimes like /mnt/home and /mnt/var to lzo, and disable compression for /mnt/var/log. How do I do this?
|
First of all, Why would you want to do this? It seems unnecessarily involved, and if you believe this, there is only one sensible option for compression (unless you conceptually include compression=no as one of the types of compression).
(There is also this, but it concerns earlier versions and is less comprehensive).
This, while a bit old (updated?) does have information on BTRFS. The clear information is there about what you have to in order to enable compression and it is an fstab option. Anything else would seem a bit weird, to be frank. Also this.
Hard to Compress data? well, the only sensible ways I can see this working would be - yes, it does whatever the compression method does with the data it has, so it does try, but if the compression ratio turns out top be less than worthwhile, then that's how well it gets compressed, in this case
- it compresses the data and then tests the compression ratio and if that turns out to be less than worthwhile it uses the uncompressed data; note that this still has the overhead of compressing the data
there are some marginal advantages in the second case if much of the data falls into the 'difficult to compress' class (and it may not be sensible to use compress at all in those cases), but I'd still expect the first to be what is done.
And this.
|
|
|
06-28-2013, 02:48 PM
|
#4
|
Member
Registered: Jan 2013
Location: EU
Distribution: Debian
Posts: 269
Original Poster
Rep:
|
Thank you for your responses.
Hmm, so you're saying I should go for EXT4/LVM instead of btrfs? To be honest I haven't extensively tested the existing setup yet. I'm still only trying it out to see whether it suits me.
I have used LVM, but I haven't used ZFS. What confuses me is the way that subvolumes are handled i.e. you don't have to mount them because they appear automatically in the VFS. Yet, if you want to use different mount options for a subvolume you have to specify a new fstab entry... and for what? To remount an already mounted/linked volume? Isn't there a way to do this without remounting? I guess shouldn't be mixing subvolumes and mount-points.
As for your last question, if you were refering to the second paragraph... I was merely asking whether it is possible. Personally I was unable to pull it off. I would use zlib compression on folders/subvolumes with lots of static data. LZO applies to data that is easy to compress, but needs faster response than zlib (i.e. /home), and no-compression can be used for data that often changes or is often read. This is how I imagine optimizing system performance vs disk space.
Regards!
|
|
|
06-28-2013, 03:37 PM
|
#5
|
Moderator
Registered: Mar 2008
Posts: 22,361
|
My guess is, there is almost nothing to know about ext4. Some of the things you know about ext2-4 may help you with the next level.
That can't be said about ZFS,BTRFS, or LVM. All of those are way more advanced. All have some very advanced features that are normally used for business.
No amount of compression will help the typical files that don't compress well. Btrfs (I forget what is uses) uses some common compression and as I recall, it can be selected like gz 0-9 sort of choice for speed versus size.
I have been around linux for a while and Solaris and still find zfs and btrfs something that I need to know more about. Maybe a new user won't find it any issue at all. Plenty of web pages that tell some simple task but when you get to the nuts and bolts you may have to go back and read the man pages.
I suspect that btrfs will be standard instead of ext4. Not sure why zfs has been so beat up by linux users.
|
|
|
06-29-2013, 04:00 AM
|
#6
|
Member
Registered: Jan 2013
Location: EU
Distribution: Debian
Posts: 269
Original Poster
Rep:
|
Is it possible to apply different mount options to subfolders of a single ext4 filesystem? Suppose I have a single partition with ext4 filesystem, that is mounted as root (/) with default mount options. Now I'd like to apply nosuid,nodev,noexec mount options to the /var folder of the existing filesystem. In btrfs you can do this by using subvolumes. Is there a way to do it in ext4 without having to use multiple partitions and/or filesystems?
|
|
|
All times are GMT -5. The time now is 01:54 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|