How to migrate/convert a file system to btrfs subvolumes?
Linux - GeneralThis 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.
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.
How to migrate/convert a file system to btrfs subvolumes?
Debian lets you format the HD as btrfs at the installation stage, but of course it then creates the entire posix tree as directories, not subvolumes. The Debian installer does not offer any option to create btrfs subvolumes.
Assuming I already have a system running on btrfs, is it possible to migrate the whole thing to subvolumes, including /etc, /usr, /tmp etc?
What about the very top of the tree, so I can have snapshots of the entire tree? Is that possible?
The usual way is to create what you need on another distro and then try to install over with other distro.
"The DebianInstaller can format and install to single-disk Btrfs volumes, but does not yet support multi-disk btrfs volumes nor subvolume creation (Bug #686097). Daniel Pocock has a good article on how to Install Debian wheezy and jessie directly with btrfs RAID1; however, strictly speaking it showcases Btrfs' integrated multi-device flexibility. eg: Install to a single disk, add a second disk to the volume, rebalance while converting all data and metadata to raid1 profile. "
You are trading a fully supported ext4 filesystem for an almost fully supported filesystem. I'd say one ought to consider using the default filesystem at least for the basic distro install and then use things like zfs,btrfs and such for data.
I'd say one ought to consider using the default filesystem at least for the basic distro install and then use things like zfs,btrfs and such for data.
Sorry for the tangent, but arguably your data is valuable, whereas the operating system can be recreated quickly. Thus my opinion is the opposite: Put root on BTRFS, and keep your data on a robust, well-tested filesystem. That's how OpenSUSE does it, too. It has the additional advantage that you can use subvolume snapshots to quickly go back to a previous operating system version after a failed update.
Sorry for the tangent, but arguably your data is valuable, whereas the operating system can be recreated quickly.
I agree on that wholeheartedly. However, BTRFS is stable enough. I've been using it for two and a half years without a hitch, in spite of prolonged abuse. I had to use for months an application that caused my system to freeze and forced me to hard reset the machine many times. Never lost a file. I lost a few files on two occasions of hard reset with ext3 about 10 years ago. I'd rather rely on backups than on file system stability, and the snapshot feature is useful.
I've been using it for well over twice as long. Almost exclusively for my photos - and I couldn't work without snapshot. For general system usage I still think the promise is better than the reality. Look at the contortions snapper (and hence opensuse) goes to - boot roll-backs after an (system) update certainly has appeal.
As for moving to all subvolumes, see the opensuse or Arch doco - not sure how it will co-operate with the Debian mindset tho'.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.