BTRFS : Subvolumes, mount options

Hello,
I took a look at btrfs, read the wiki, some guides and I have a few questions :
1) In every guide I read, even on the official wiki, the root and home subvolumes are created separately. I don't understand why since the two are "linked" it would make more sense to create the home subvolume inside the root subvolume. From what I understand it wouldn't make the snapshots harder because the subvolume children are ignored when snapshotting. Moreover since subvolume children are automatically mounted we can mount the all system in one command only, so only one line in fstab to mount everything. So why not create the subvolumes directly in the root subvolume ? The only drawback I can see is that you can't set different mounting options for the children.
2) Same goes for autodefrag option, wherever I read about btrfs and SSDs the autodefrag option is always there. I understand defragmentation for a spinning device but fail to see the usefulness on SSDs. Moreover defragmentation is really bad for SSDs as it shortens their lifespan. So the way I see it defragmentation and autodefrag only has drawbacks for SSDs. What am I missing ?
3) For the same SSD lifespan concerns I plan to not use inode_cache and space_cache by using the nospace_cache option. So my options would be :
rw,noatime,compress=lzo,ssd,discard,nospace_cache
Does that seem optimal ?
Thanks in advance,
Nolhian
Last edited by Nolhian (2014-04-29 16:36:37)

If /home is nested it may lead to confusion if you later want to mount home-snapshot-1 to /home. Keeping things separate, while not required, is still a good idea.
My mount options for my ssd-based root subvolume are: "defaults,noatime,discard,ssd,subvolid=0". I don't know where you've seen autodefrag as a standard ssd option, like you say, it doesn't make much sense for ssds.
Can't comment on the caches.  There's a few threads on the mailing list that may be of interest to you though (not read them myself).
http://www.mail-archive.com/linux-btrfs … 24827.html
http://www.mail-archive.com/linux-btrfs … 30739.html
http://www.mail-archive.com/linux-btrfs … 07498.html
There's a lot more.

Similar Messages

  • Change default btrfs subvolume - GRUB problem

    grub-mkconfig  creates a grub.cfg with this kernel command line:
    linux /vmlinuz-linux root=UUID=88e4e9db-0d5d-4055-bb36-6c4bc3454cb3 rw rootflags=subvol=SB0 quiet video=hyperv_fb:1920x1080
    my problem lies in rootflags=subvol=SB0 where is named a specific btrfs subvolume.
    I would like no subvolume be specified in grub.cfg so that the default one will be mounted as root filesystem.
    The reason is I have arch installed into btrfs subvols and I would like to choose which arch variant to boot simply changing default subvol.
    (I've used the installation tips found at http://www.funtoo.org/BTRFS_Fun )
    This is btrfs root :
    ~/bin > mount /dev/sda2 -o subvolid=0 /mnt
    ~/bin > btrfs filesys show /mnt
    Label: none uuid: 88e4e9db-0d5d-4055-bb36-6c4bc3454cb3
    Total devices 1 FS bytes used 3.47GiB
    devid 1 size 126.81GiB used 6.04GiB path /dev/sda2
    btrfs-progs v3.19.1
    /etc/fstab :
    ~/bin > cat /etc/fstab
    # /etc/fstab: static file system information
    # <file system> <dir> <type> <options> <dump> <pass>
    # /dev/sda2
    UUID=88e4e9db-0d5d-4055-bb36-6c4bc3454cb3 / btrfs rw,relatime,space_cache 0 0
    # /dev/sda1
    UUID=df2d9bbc-ab0a-42a5-96ae-7c90f0c15a0e /boot ext3 rw,relatime,data=ordered 0 2
    These are the subvolumes:
    ~/bin > btrfs subvol list /mnt
    ID 260 gen 5129 top level 5 path SB0
    ID 264 gen 4975 top level 260 path SB0/var/lib/machines
    ID 265 gen 5092 top level 5 path SB1
    SB1 is a snapshot of SB0 and both contain an arch installation
    SB1 is default one:
    ~/bin > btrfs subvol get-default /mnt
    ID 265 gen 5092 top level 5 path SB1
    but if I run grub-mkconfig it picks up SB0, in my opinion the wrong one.
    Please note that SB0 is currently mounted as system root:
    ~/bin > findmnt -o SOURCE,TARGET,FSTYPE,FSROOT /
    SOURCE TARGET FSTYPE FSROOT
    /dev/sda2[/SB0] / btrfs /SB0
    Is it possible to tell to grub-mkconfig to not name any specific subvol ?
    If you look into: /etc/grub.d/10_linux
    and search for "btrfs"  it may give an hint, but I don't understand it.
    many thanks in advance
    Andrea
    EDIT: of course, if I change kernel command line by hand (:s/SB0/SB1) it works as expected, but it's not I'm looking for, being grub.cfg an automatically generated file.
    Last edited by Aklo (2015-04-28 11:11:56)

    I don't use GRUB anymore, but I don't recall it requiring a specified subvolume to boot, however if you've installed to a specific subvolume (SB0 in your case), then you will need to to tell GRUB where to look more specifically than just the device and partition (/dev/sda2).
    What might accomplish what you're asking for is to set up seaparate boot entries for the respective subvolumes / installation variants.  Basically manually add another "menuentry" in /boot/grub/grub.cfg and change the subvolume specified:
    /boot/grub/grub.cfg
    menuentry "Arch Linux - SB0" {
    linux /boot/vmlinuz-linux root=/dev/sda2 rootflags=subvol=SB0
    menuentry "Arch Linux - SB1" {
    linux /boot/vmlinuz-linux root=/dev/sda2 rootflags=subvol=SB1
    You'd need to fiddle with /etc/fstab a then since I'm pretty sure something would freak out if you tried to mount two subvolumes to / at the same time (e.g., duplicate entries with different subvolumes specified).  A much simpler solution would be separate root partitions with shared /boot and /home partitions.  Like so (subvolumes would even be optional):
    /dev/sda1 ext3 /boot
    /dev/sda2 btrfs / *"menuentry" in /boot/grub/grub.cfg > title "Arch Linux - SB0"
    /dev/sda3 btrfs / *"menuentry" in /boot/grub/grub.cfg > title "Arch Linux - SB1"
    /dev/sda4 btrfs /home
    Basically you have two separate installations, which is what it sounds like you're asking for that can be selected at boot time and share a /home partition.  The fstabs in each root would only differ at the / partition entry.

  • Using BTRFS subvolumes to host multiple linux distributions

    I'm planning to use BTRFS subvolumes to have an Archlinux and an Ubuntu system booting off the same partition. The goal is to to have them both using the same disk space, mostly because I dislike having to resize partitions to make room for  one or the other. Also my system has been way too stable lately and I have to break it.
    Has anyone tried something like this before? Any gotchas I should be aware of? AFAIK what I'll need to do is use debootstrap to setup ubuntu in a subvolume, copy the ubuntu kernel/initrd over to my /boot, and setup grub2 to boot the ubuntu subvolume (line after root= would be ro,subvol=altroot I think)
    If it works I'll be sure to post the success here.

    correnos wrote:
    I'm planning to use BTRFS subvolumes to have an Archlinux and an Ubuntu system booting off the same partition. The goal is to to have them both using the same disk space, mostly because I dislike having to resize partitions to make room for  one or the other. Also my system has been way too stable lately and I have to break it.
    Has anyone tried something like this before? Any gotchas I should be aware of? AFAIK what I'll need to do is use debootstrap to setup ubuntu in a subvolume, copy the ubuntu kernel/initrd over to my /boot, and setup grub2 to boot the ubuntu subvolume (line after root= would be ro,subvol=altroot I think)
    If it works I'll be sure to post the success here.
    it should be possible, though the subvol=XXX is not correct.  in the arch initramfs scripts:
    rootflags=subvol=XXX
    is used to add mount options to the root mount; "ro" is a special case and is handled explicitly.  i'm not sure how ubuntu handles this, but the kernel itself has nothing to do with it... is all initramfs, so you will have to look into that for ubuntu.
    beyond that, just make sure the kernels and initramfs names do not conflict.
    C Anthony

  • How to setup a btrfs subvolume and boot onto it

    I have backed up my previous laptops Arch install onto an external drive and now I have a new laptop with btrfs and I would like to rsync my previous Arch into a subvolume so I can boot into it separetely from the main current OS. Being new to btrfs, and not wanting to destroy my new installation, I was hoping someone could provide some generic step by step instructions on how to create a bootable btrfs subvolme (the rsync step is easy) and how to tweak grub to boot onto it?

    Its pretty simple actually.  You create a subvolume and you can mount the filesystem from that point.  So say I were to do:
    # btrfs subvolume create /rootfs
    I could then mount it with:
    # mount -o subvol=rootfs /dev/sda1 /mnt
    Thus, to make it so that you can mount that filesystem as the rootfs, you would need pass that mount option when the machine is booting.  This is typically done in the fstab.  But there is a small problem there since the initramfs will first mount the partition looking for /sbin/init, using the kernel command line to figure out what to do.  So you will have to modify your kernel command line in order to get it to mount the proper thing.  This can be done with the rootflags= option.
    Alternatively, you can specify /rootfs as the default subvolume.  This will make it so that if you pass no mount options to it, it will mount at subvol=rootfs.
    You should do some reading about btrfs on the btrfs wiki (the actual btrfs wiki).  Some basic knowledge about how to use things and the various tools that ship with the progs would take you a long way.  It might also keep you from unnecessarily doing various recovery things that might totally wreck the filesystem.  Remember that btrfs is still in very active development.  Make sure you have tested backups.

  • QFS mount options not getting noticed.

    Hi I have a small issue it seems that none of my QFS directives are getting noticed im not sure if this is true or not but this is what I have tried and i am unable to verify that these mount options are actually taking effect..
    This is QFS Version 4 revision 4.0.26FA
    in my /etc/opt/SUNWsamfs/samfs.cmd I have the following options
    fs = qfs1
    nosuid
    sync_meta = 0
    qwrite
    readahead = 4096
    writebehind = 1024
    after mounting my file system why are these options not listed in mnttab
    qfs1 /qfs1 samfs dev=1d80036 1048280993
    using dd/time to write data to this file system im getting the exact same performance no matter what options I set. another reason why I think these options are being ignored is the following
    if I set for example fs = qfs1 and high = 70 low = 30 when I check samu [m] option I dont see those values reflected in the m output so what im asking is there anyway to verifty that my mount options are being set occordinly ?
    Yes I did use mount -o nosuid,qwrite,etc.. /qfs1 still no difference and even placing the options in vfstab seems to not make any difference.
    last but not lease if i do a samtrace -V while mounting my /qfs1 filesystem I see the following
    00100000 readahead (1048576) <<--- still seems to use the default values 1024
    00080000 writebehind (524288) <<-- 512 look @ my samfs.cmd file this should but not the value.
    Any assistance would be nice.

    Hi There! Sorry, it took so long to get back to you. This should help:
    The samu N display shows all the mount options. You can also use the samfsinfo command to see file system build information. If the samfs.cmd options are not being picked up, make sure the file is formatted correctly (no odd characters) and is in the proper location, /etc/opt/SUNWsamfs/samfs.cmd . Then "pkill -HUP sam-fsd" to assure the daemon has picked up the file's contents, and then mount the file system.

  • WARNING:Expected NFS mount options: rsize =32768,wsize =32768,hard,

    While using "dbua" I encountered a problem on the screen saying "cannot open the specified control file" and I was directed to see the new alert log.
    The alert log has several lines with messages like:
    WARNING:NFS mount of file <PATH>control01.ctl on filesystem <FS_NAME> done with incorrect options
    WARNING:Expected NFS mount options: rsize>=32768,wsize>=32768,hard,
    WARNING:NFS mount of file <PATH>control02.ctl on filesystem <FS_NAME> done with incorrect options
    WARNING:Expected NFS mount options: rsize>=32768,wsize>=32768,hard,
    WARNING:NFS mount of file <PATH>/control03.ctl on filesystem <FS_NAME> done with incorrect options
    WARNING:Expected NFS mount options: rsize>=32768,wsize>=32768,hard,
    ORA-00210: cannot open the specified control file
    ORA-00202: control file: '<PATH>/control03.ctl'
    ORA-27054: NFS file system where the file is created or resides is not mounted with correct options
    The file system is actually mounted with these options: "nfs - yes rsize=4096,wsize=4096,hard,intr,vers-3".
    Would someone please help to identify what is wrong ?
    Thanks

    Thanks for your reply.
    OS is Solaris on x86-64. and we use NetApps and NFS.
    I followed the instruction specified in Oracle Support DocID 781349.1 and as it turned out the order is significant.
    The document specifies these mount options using this order.
    rw,bg,rsize=32768,wsize=32768,hard,vers=3,nointr,timeo=600,proto=tcp,suid 0 0
    ** This fixed the problem
    FYI, we had these options (and order):
    rw,bg,hard,rsize=32768,wsize=32768,vers=3,nointr,timeo=600,proto=tcp,suid

  • Oracle VM Server 2.2.1 - Extra mount options for /OVS

    Hi,
    we would like to know how to add extra mount options (rw,hard,intr,tcp,rsize=32768,wsize=32768,timeo=600) to /OVS in Oracle VM 2.2.1.
    In version 2.1.5 and lower it was possible by adding those options together with the UUID in /etc/ovs/repositories.options
    How to manage mount options in Oracle VM 2.2.1? I've tried the same and no success.
    Best regards and thanks in advance,
    Marc Caubet

    Marc Caubet wrote:
    Since we have seen some I/O problems which causes high CPU Wait for some VM (those which contain postgres databases with high I/O activity) we finally decided to apply those NFS options to see if it solves the problem. If it doesn't work we will analize which options can improve the performance.Marc, why not just use the OVS' NFS mount for the system/root partition and mount an NFS volume from within the guest itself? That way, you can set all the parameters you need. Also, the netfront drivers (I'm told) are slightly more efficient that the blockfront drivers, so you could even see a performance improvement.

  • USB mount options in kde

    Is it possible to use custom mount options for removable (usb) drives in kde4?
    I'm mostly interested in -o flush option. So the actual write on the disk ocurs when copying, but not when I unmout the device.
    P.S. editing fstab is not a solution! May be there is a way to amoid hal and automount using udev?

    http://wiki.archlinux.org/index.php/Ude … SB_devices

  • Mount options for ZFS filesystem on Solaris 10

    Do you know some recomendation
    about mount options for SAP on Oracle
    with data on ZFS filesystem?
    Also recomended block size required.
    We assume that file system with datafiles has 8kb block size
    and offline redologs has default (128kB).
    But what about ONLINE REDOLOGS?
    Best regards
    Andy

    SUN Czech installed new production HW for one Czech customer with ZFS filesystem on data-, redo- and archivelog files.
    Now we have performance problem and currently there is no SAP recomendation
    for ZFS file system.
    The HW which are by benchmark about tvice power has worst responses than
    old hardware.
    a) There is bug in Solaris 10 - ZFS buffers once allocated are not released
        (generally we do not want to use buffering due to prevence of double
         buffering)
    b) ZFS buffers takes about 20GB (32GB total) of memory on DB server
    and we are not able to define huge shared pool and db cache. (it may be possible
    to set special parameter in /etc/system to reduce maximum size of ZFS buffers to e.g. 4GB )
    c) We are looking for proven mount option for ZFS to enable asynchronious/concurent io for database filesystems
    d) There is no proven clear answer for support of ZFS/SOLARIS/Oracle/SAP.
    SAP says It is Oracle problem, Oracle does not certify filesystems from Jan2007
    any more and says ask your OS provider and SUN looks happy, but performance
    goes down and it is not so funny for system with 1TG DB with over 30GB grow
    per month.
    Andy

  • Readonly filesystem mount options in fstab

    I am noticed when I try to use
    defaults,noatime,data=writeback,nouser_xattr
    as mount options in fstab for my ext4 os partition, it seems to be mounted as readonly, it works for my data partition tho so far. Why is that? I got that from a blog article somewhere on optimizing ext partitions

    Um, the "defaults" option includes "rw".
    https://wiki.archlinux.org/index.php/Fs … efinitions
    You NEED "ro" on the APPEND line in syslinux.conf (here's why), while GRUB2 adds it automatically when you re-generate the .cfg.
    https://wiki.archlinux.org/index.php/Sy … sic_Config
    Last edited by DSpider (2012-08-06 14:22:42)

  • How to make autofs to pick up new NFS mount option?

    Hi,
    I've added a new mount option to an existing map auto_*. I've tried:
    svcadm -v restart svc:/system/filesystem/autofs:default
    svcadm -v refresh svc:/system/filesystem/autofs:default
    but when checking via "mount," it still shows it's mounted before the service restart/refresh and the newly added option is not shown in the output. /etc/mnttab does not show either.
    Also this is within a non-global Solaris zone if it makes a difference.
    How do I make sure automount picks up the new mount options right away?
    Thanks,
    Edited by: ACORCL on Feb 12, 2013 4:52 PM

    Yes. I restarted/refresh autofs after making a change to auto_* file (adding "llock" option to an existing mount).
    I just ran "automount -v" and its output shows that mount point is remounted. However, "mount" output shows
    mount_point on NFS_share list_of_options_here on Tue Feb 12 08:47:32 2013 <== which is still 9 hours ago
    From where I cannot find the "llock" mount option I added in auto_* file in the "list_of_options_here" above.
    If you have any suggestions, please let me know.
    Thanks,

  • Mount options

    We have a filesystem mounted via NFS on 2 systems, both are automounted. When we run a bdf command de filesystem doesn’t appear, but if we try to access to the filesystem we can. We would like to know if there’s any recommendation about the mount options for filesystems.

    The directory is mounted by autmount when you access that directory.
    This is exact automount functionaility.
    This is why you cannot see in the output of "df" command when you are not using.
    The recommended NFS mount option could be ...
    if you use NetApp filer as NFS server,
    this techinical white paper could be helpful.
    http://www.netapp.com/us/library/technical-reports/tr_3442.html
    -<snip>-
    Correct NFS mount options are important to provide optimal performance and system stability.
    Linux®: rw,bg,hard,nointr,rsize=32768,wsize=32768,tcp,vers=3,suid,timeo=600
    Solaris™: rw,bg,hard,nointr,rsize=32768,wsize=32768,proto=tcp,vers=3,suid,[forcdirectio or llock]
    AIX, HP/UX rw,bg,hard,nointr,rsize=32768,wsize=32768,proto=tcp,vers=3,suid

  • [HAL] Mount options for removable devices

    I need my USB drives automounted with noatime mount options. Following the guidelines at http://wiki.archlinux.org/index.php/HAL, I created a file /usr/share/hal/fdi/policy/10osvendor/10-custom-mount-options.fdi with the following content:
    <?xml version="1.0" encoding="UTF-8"?>
    <deviceinfo version="0.2">
    <device>
    <match key="block.is_volume" bool="true">
    <match key="@block.storage_device:storage.hotpluggable" bool="true">
    <merge key="volume.policy.mount_option.noatime" type="bool">true</merge>
    </match>
    <match key="@block.storage_device:storage.removable" bool="true">
    <merge key="volume.policy.mount_option.noatime" type="bool">true</merge>
    </match>
    </match>
    </device>
    </deviceinfo>
    And then restarted HAL. Even tried reboot. But my drives still won't mount with noatime. Any help is much appreciated?

    [:bump:]

  • Best NFS mount options from Linux to Xsan?

    So we are adding Linux clients to our network and I'm looking to learn the best NFS mount options to put in the fstab file. Right now they are set "defaults 0 0" and we are having problems. I assume because they are hard mounting. This is from the /proc/mounts file for one of the clients connecting to the Xsan:
    10.X.X.X:/snet /snet nfs rw,relatime,vers=3,rsize=65536,wsize=65536,namlen=255,hard,proto=tcp,timeo=600, retrans=2,sec=sys,mountaddr=10.X.X.X,mountvers=3,mountport=706,mountproto=udp,ad dr=10.X.X.X 0 0
    Xsan 2.2, 2 MDCs running 10.6.4, Promise Array.

    So we have finally solved this. It turns out that the defaults work just fine. Our issues were solved by changing which MDC was hosting the export, dividing up the workload a bit, our primary was running out of RAM.
    Secondly, I added intr and soft to the NFS options, the smoothed things out further.

  • Effective NFS mount options

    My computer is running Mac OS X 10.7.5. I have a question regarding NFS mount options.
    The following mount options are defined in /etc/nfs.conf
    didymus:~ service$ cat /etc/nfs.conf
    nfs.client.mount.options = tcp,rw,nfc,intr,async,rdirplus,rsize=65536,wsize=65536
    nfs.client.allow_async=1
    If I run the mount command, I see the following:
    10.72.6.11:/ on /Volumes/10.72.6.11 (nfs, asynchronous, nodev, nosuid, mounted by service)
    How do I verify the other mount options specified, intr, rsize, wsize, etc. have taken affect? I presume there is some mechanism for validating this.

    Nevermind, appear to have located it: nfsstat -m appears to do the trick.

Maybe you are looking for

  • PhotoShop CS2 not loading image

    I've been working with CS2 for the past two years with no problem but as of last week, when I open my CS2 and try to open an image, the image does not display in my work area but it displays in my layers menu, nav menu, etc... Is there a setting that

  • Fundamental Confusion (about float and height) - please help

    hi. desired result is: a floated, fixed height and width div nested in another div with auto height and fixed width. but why does the mainbox div (see example) just collapse. am i missing a fundamental basic knowledge base here? <style type="text/css

  • Compatability between LaCie and other drives

    Greetings Kind MacAddicts! I have a 160GB LaCie (Triple Threat?) FW800 external drive and have had no problems. Now I want to expand and daisychain another external drive. Thinking of a Maxtor with FW800 (more bang for the buck) and wondering if ther

  • Trackpad click not as sensitive after service

    Hi there, just had the logic board replaced in my mid-2010 MBP, and I find now that the trackpad click is not as sensitive, it works about 90% of the time, but the 10% is quite frustrating. Even with the audible click, sometimes it doesn't register,

  • How to handle exceptions in constructor?

    Hello everyone, When exceptions occur in constructor so that the instance of the object can not be created, should we throw the exception to the invoker of the constructor or simply catch the exception (and not throw it again)? I think we should not