Mailinglist Archive: opensuse (1620 mails)

< Previous Next >
Re: [opensuse] When not to use Btrfs for /home?
On 11/18/2014 05:20 AM, Stanislav Baiduzhyi wrote:
On Saturday 15 November 2014 13:37:46 Anton Aylward wrote:

I can't see why not to trust LVM. Its got a good heritage before it was
imported into Linux. I've been using it for nearly a decade and its
never given me any problems. Its at least as reliable as the extN file
systems and the ReiserFS. I've not used XFS so I can't comment.

I say "NOT!" becuase a subvolume of a BtrFS partition is not really a
new partition, its and administrative & management aspects. In many
ways it behaves like a subdirectory in that it uses space on the
'parent'. You are NOT, repeats NOT mounting a new piece of storage.

The manual page says quite explicitly

A subvolume in btrfs is not like an LVM logical volume, which is quite
independent from each other, a btrfs subvolume has its hierarchy and
relations between other subvolumes.

I cannot understand your point... Yes subvolume is not LVM, but my goal is to
have some files (or all files in subfolder) to have 'nodatacow' by default,
is not a synonym of LVM. I'm not convincing you to abandon LVM, I just don't
trust it. Showstoper for me will be if btrfs cannot mount subvolume with
'nodatacow', but my test on VirtualBox guest went fine, so I will try the
on my laptop when I'll be upgrading from 13.1 to 13.2.

Let try that in parts.
Can we leave LVM out of it. The BtrFS people only mentioned LVM
because, like LVM, BtrFS can be set up to cover many spindles.

A subvolume is not a separate container.

That means its not a separate partition, it is part of the main FS and
-- this is the important part -- share all the characteristics of the
main part, the block size etc etc.

It is part of the hierarchy, in that it is functionally like a
subdirectory. You can set up a relation -- that is a HARD LINK --
between a file in the subvolume and elsewhere on the FS, possibly in
another subvolume. You can't do that if the mount is really of a
separate container with different characteristics. You would have to
use symlinks.

LVM is just a way of managing disk space that is very flexible. LVM is
not a file system. The result of using LVM is that you can create new
partitions -- logical volumes -- dynamically (and resize them) without
using the traditional partition tools such as fdisk. One would then
have to create a file system on the Logical Volume; this can be ANY file
system, ext2/3/4, resiserfs, xfs or even btrfs! The mount just as if it
were a partition created with fdisk. Such a volume is mounted in the
traditional way but is a separate file system.

By contrast a BtrFS subvolume is part of the original file system.

If I were to remove the entry for the subvolume from /etc/fstab it would
make no difference to the running system. The subvolume would still be
there. I know this, I've done it. Similarly you can create a
subvolume and not add it to /etc/fstab. I've done that too.

As it happens, I manage my complete disk with LVM except for the boot
partition. The machine I'm working at now only has the one disk so I'm
not making use of LVM's ability to span many spindles, to do mirroring
or striping. It is because of these facilities that people draw an
analogy with BtrFS, but I think it is unfair. LVM is a disk space
management tool that lives _underneath_ the file system. BtrFS is a
file system that can extend across many containers.

One of my LVM Logical volumes has my ROOT on it.

# mount
/dev/mapper/vgmain-vROOT on / type btrfs (rw,relatime,space_cache)

# lvdisplay /dev/mapper/vgmain-vROOT
--- Logical volume ---
LV Path /dev/vgmain/vROOT
VG Name vgmain
LV UUID 7j4Cuf-GIJ0-5B5L-qPJQ-YB2T-MsRK-9Tj2hP
LV Write Access read/write
LV Creation host, time linux, 2014-03-26 14:16:11 -0400
LV Status available
# open 1
LV Size 20.00 GiB
Current LE 5120
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:10

When I installed, that LV was just 10G and the system fit on it!
But as time went by I installed more things and had more kernels in /lib
so I grew both the LV and then the file system. I had to grow the
container - the LV first.

LVM is a tool for managing the disk space, quite independently of the
file system you choose to implement in any of the containers -- Logical
Volumes -- you create.

LVM is NOT a file system.

You could, and it might possibly be quite optimal in terms of
deduplication, to create a single BtrFS that spanned all of the disk,
all of the disks on the system. Use fdisk to create a single partition.
have all of ROOT, /boot, /home, /srv, /usr, /opt, /local ... All on the
one FS. They might be subvolumes, if that makes management such as
doing backups easier, but that is optional.

The important point is that a subvolume is more like a subdirectory than
it is like mounting another FS. If anything it is more like a bind
mount. After mounting a subvolume it is the same file system
underneath. As far as programs that access anything under that point,
it makes no difference whether or not the mount has been done.

A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting frowned upon?

To unsubscribe, e-mail: opensuse+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups