You are not logged in.

#1 2010-04-11 07:20:25

venky80
Member
Registered: 2007-05-13
Posts: 1,002

anyone using brtfs with 2.6.33

I am wondering if anyone has used / tested brtfs with the new kernel.
Also if yes have you tested the rollback feature?


Acer Aspire V5-573P Antergos KDE

Offline

#2 2010-04-11 08:22:18

mikesd
Member
From: Australia
Registered: 2008-02-01
Posts: 788
Website

Re: anyone using brtfs with 2.6.33

I am using btrfs on a backup drive. Backup ran fine last night. I haven't looked at the rollback feature though. Not even sure what it is. smile

Offline

#3 2010-04-11 10:28:52

Dieter@be
Forum Fellow
From: Belgium
Registered: 2006-11-05
Posts: 2,002
Website

Re: anyone using brtfs with 2.6.33

isn't btrfs still in a too early phase to use in production?


< Daenyth> and he works prolifically
4 8 15 16 23 42

Offline

#4 2010-04-11 11:52:08

nbvcxz
Member
From: Poland
Registered: 2007-12-29
Posts: 202

Re: anyone using brtfs with 2.6.33

I use btrfs for / for few months and so far there are no problems (btw - working on zen-kernel)


Lenovo G50 | LXQT-git | compton | conky

Offline

#5 2010-04-11 12:28:25

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: anyone using brtfs with 2.6.33

@mikesd
Backup drive? Like an offsite backup? IIRC you can make snapshots of your system and files in case you accidentally delete sth you need, but to use it as a yet another fs for your backup drive is not exactly what it's meant to do. btrfs doesn't work w/ drives and partitions, it pools them all and you can divide and conquer as you wish, it has / is a volume manager.
I may be misunderestimating what you're trying to say.

> isn't btrfs still in a too early phase to use in production?
+0.5
And using it as a fs for your *backup* ...


Now back to the OP :-)
I didn't test it, what do you need it for? I use pacman to downgrade if things go wrong (know problems w/ old Intel cards, looks like a wontfix sad ). I also do normal backups. I have only a 40GB drive w/ the default partitioning so I don't need a volume manager.
If you're running a bigger and more complicated setup, btrfs might be useful though.
Let us know how things went if you decide to try it.

Offline

#6 2010-04-11 12:57:57

mikesd
Member
From: Australia
Registered: 2008-02-01
Posts: 788
Website

Re: anyone using brtfs with 2.6.33

Dieter@be wrote:

isn't btrfs still in a too early phase to use in production?

Definitely. I wouldn't use it on business/mission critical systems just yet. smile

The BTRFS devs are not planning any on disk format changes unless they hit a real show stopper. The BTRFS mailing list is fairly active with posts by early adopters though you still see quite a few bugs popping up. I think Fedora is planning on having a BTRFS root fs as an option in Fedora 13.

I only use it on a backup drive and the snapshot feature is very handy in this case. It has been running without issue for a month so far. I use two backup drives in rotation and the second uses XFS and hardlinks to give similar functionality to the BTRFS snapshots.

One thing I liked about ZFS was that the snapshots were read only and while BTRFS will have read only snapshots through settable block quotas the functionality isn't there yet.

Offline

#7 2010-04-12 06:31:16

venky80
Member
Registered: 2007-05-13
Posts: 1,002

Re: anyone using brtfs with 2.6.33

karol wrote:

@mikesd
Backup drive? Like an offsite backup? IIRC you can make snapshots of your system and files in case you accidentally delete sth you need, but to use it as a yet another fs for your backup drive is not exactly what it's meant to do. btrfs doesn't work w/ drives and partitions, it pools them all and you can divide and conquer as you wish, it has / is a volume manager.
I may be misunderestimating what you're trying to say.

> isn't btrfs still in a too early phase to use in production?
+0.5
And using it as a fs for your *backup* ...


Now back to the OP :-)
I didn't test it, what do you need it for? I use pacman to downgrade if things go wrong (know problems w/ old Intel cards, looks like a wontfix sad ). I also do normal backups. I have only a 40GB drive w/ the default partitioning so I don't need a volume manager.
If you're running a bigger and more complicated setup, btrfs might be useful though.
Let us know how things went if you decide to try it.

Well I wanted a clean way to go back to different system states.  Downgrade does leave some system files behind, I was wondering if I can go back to clean install.


Acer Aspire V5-573P Antergos KDE

Offline

#8 2010-04-13 14:46:56

cngn
Member
Registered: 2010-03-20
Posts: 65

Re: anyone using brtfs with 2.6.33

venky80 wrote:

Well I wanted a clean way to go back to different system states.  Downgrade does leave some system files behind, I was wondering if I can go back to clean install.

lvm2 has a full featured rollback system, it's stable and safe, you can even boot directly to the snapshot and use it separately from the original setup

i've tested it by formatting my current root partition and installing a different os on top of arch, going back wasn't any longer than doing a simple reboot (/boot can't be on lvm, so do not overwrite it if you would like to make similar test)

you could even make a script, that will take a snapshot of the root fs before 'pacman -Syu' and do both (snapshot and update) at once

Offline

#9 2010-04-15 19:41:23

extofme
Member
From: here + now
Registered: 2009-10-10
Posts: 174
Website

Re: anyone using brtfs with 2.6.33

i have been using btrfs for almost year now on all my machines.  i've made it thru lockups, hard resets, upgrades, etc. without any issues.  there are various things that you cannot do/are incomplete:

) dont put swap on a btrfs volume (using loopback + volume might work, else corruption will ensue)
) kernel, /boot must be on GRUB supported standard partition
) still does not handle all out-of-space conditions gracefully, and your kernel may oops out

systems feel responsive and quick.  i _believe_ you can boot directly into a subvolume by adding rootflags=<subvol> to kernel command line (subvol= is a mount flag.  there is a gotcha here... the subvolume must reside in / ... i.e. /<subvol> ... else it cannot currently be mounted directly)

subvolumes and snapshots can be mounted multiple times in different places: similar to bind mounts

when the time comes, LZMA/etc. on-disk compression with make for very speedy reads/writes (GZIP is too CPU heavy, but some report success; depends on use cases)

i wrote the mkinitcpio-btrfs hook:

http://aur.archlinux.org/packages.php?ID=33376

there were some kernel bugs i ran into while developing that (mainly automatic array repair/hot spare stuff that wouldn't affect most users), but i believe they have been addressed in 2.6.33, thus that hook should soon support automatic array repair from a "hot spare pool", and maybe ill add a way to "interrupt" and choose a new subvolume to boot to.

i snapshot my system before every upgrade; a snapshot in btrfs takes about 3 seconds, regardless of size.  although lvm2 is more mature, btrfs did say they were ready for early adopters in .32, and have been in the mainline kernel since .29... it's ready for more widespread use IMO.  i would recommend it over lvm for many reasons, the main ones being simplicity and performance, but i'll let you research the details.

https://btrfs.wiki.kernel.org/index.php … ce_Support
https://btrfs.wiki.kernel.org/index.php/Gotchas

Last edited by extofme (2010-04-15 19:44:31)


what am i but an extension of you?

Offline

#10 2010-04-18 18:53:03

venky80
Member
Registered: 2007-05-13
Posts: 1,002

Re: anyone using brtfs with 2.6.33

is there a how to in arch wiki. Thanks for the info extme


Acer Aspire V5-573P Antergos KDE

Offline

#11 2010-04-24 20:40:12

venky80
Member
Registered: 2007-05-13
Posts: 1,002

Re: anyone using brtfs with 2.6.33

Would pacman provide rollback support?
when will arch support all brtfs features?


Acer Aspire V5-573P Antergos KDE

Offline

#12 2010-04-25 21:37:14

extofme
Member
From: here + now
Registered: 2009-10-10
Posts: 174
Website

Re: anyone using brtfs with 2.6.33

"rollback" is not really a feature of BTRFS itself, it's more of an umbrella term for a couple of concepts working in tandem.  BTRFS provides a facility to snapshot your existing subvolumes (the default subvolume usually being your / ).  you can then boot into this snapshot by either setting a new default subvolume (via the new "btrfs subvolume set-default" command in btrfs-progs-git), or by setting the "subvol" mount parameter to an existing subvolume id at mount time.

i am actively working on providing these features in an updated version of the mkinitcpio-btrfs hook in AUR.  it will support choosing a new snapshot at boot time, setting a new default subvolume, and automatic repair of RAID arrays.  i expect this to be available within a week or so.

ultimately, "rollback" is really just this:

1) snapshot your / right before doing anything dangerous (i.e. pacman -Su)
unfortunately, pacman does not support any kind of "hook" mechanisms, so this would need to be done manually, via a pacman wrapper (easiest), or baked into pacman itself (unlikely).

2) oh @#$%!!! nothing works anymore after that upgrade! what now?
if you snapshot your / before upgrading, you still have a good version of your filesystem from the past.  reboot you computer and choose the old version via...

3) grub menu (very unlikely) or initcpio hook (upcoming) will provide a way for you to select your old snapshot and boot successfully.

as you see, it's a fairly simple process, but it requires some cooperation, and there are a couple gotchas:

1) the /boot partition currently CANNOT be BTRFS, therefore kernel upgrades cannot be rolled back completely, and would require a small amount of manual intervention until grub2 supports BTRFS
2) snapshots are deep/wide; if your /home is NOT on its own subvolume, then your home folder will also be rolled back to a previous state (the newer versions are NOT lost).  although, this can be alleviated simply by putting /home into its own subvolume (which you can then snapshot separately, pretty cool huh?)

good things are coming; full fledged "rollback" support by default in Arch is probably still a ways off, but the changes i am making to the mkinitcpio-btrfs hook will allow for rollback like features (providing you create/use a pacman wrapper too of course)


what am i but an extension of you?

Offline

#13 2010-04-26 03:42:33

relgueta
Member
Registered: 2010-04-26
Posts: 31

Re: anyone using brtfs with 2.6.33

@extofme

to rollback, the place where you store the snapchot must be a btrfs?

Offline

#14 2010-04-26 08:31:00

polymetr
Member
Registered: 2009-12-04
Posts: 40

Re: anyone using brtfs with 2.6.33

@extofme
Is it possible to do a rollback on fly? Without reboot?

Offline

#15 2010-04-26 19:46:41

extofme
Member
From: here + now
Registered: 2009-10-10
Posts: 174
Website

Re: anyone using brtfs with 2.6.33

relgueta wrote:

to rollback, the place where you store the snapchot must be a btrfs?

the initial snapshot will be on a btrfs subvolume, but there is no reason why (AFIAK, untested) you couldn't mount the snapshot immediately after taking it and tarball it up on the fly to another partition/drive with a different filesystem (say ext3/4).  when you wanted to use it (rollback) you would either:

a) use the original snapshot that still exists in the btrfs filesystem, mount it directly
b) create an empty subvolume, deflate your tarball into it, and mount the subvolume
c) deflate the tarball to alternate FS (say ext3/4 again) and boot that

b and c seem paranoid to me, kind of misses the point of btrfs (as you could have done those before), but possible if you needed peace of mind?

in case its not clear, snapshot/subvolume are synonyms:
snapshot=clone of an existing subvolume to a new location/id
subvolume=new/empty "sub-filesystem" within the btrfs device pool

as mentioned, subvolumes (and snapshots) are like independent filesystems.  they can be mounted and manipulated immediately after creation.

polymetr wrote:

Is it possible to do a rollback on fly? Without reboot?

hmmm, OOTB i'd probably say no.  you have applications running with open files, and what your requesting requires a remount of / with a new mount option.

having said that, it's an idea i have thought about, and also think would be pretty cool.  it might be possible to use LXC (linux containers) + BTRFS to accomplish this... one of the goals of LXC is to enable pausing (freezing), checkpointing, and restarting (restoring) of containers.  could look something like this:

"save"
1) freeze container
2) checkpoint container (save to FS?)
2) snapshot the FS

"rollback"
3) freeze container (checkpoint current state?)
4) remount / with subvol=<snapshot_from_earlier>
5) restore LXC checkpoint (from FS?)
6) unfreeze container

LXC + BTRFS is a pretty cool combo and i think will produce some interesting applications.  i used them both for a VPS type solution i was working on before moving primarily to google apps:

http://bbs.archlinux.org/viewtopic.php?id=90902

i could create fully independent containers in seconds, without (initially) consuming any additional disk space.

----------

on a side note, i believe fedora by default (if btrfs is chosen) puts swap + btrfs in an lvm volumegroup.  good idea probably.  btrfs can enslave entire disks, partitions, or files mounted on loopback... it's going to be/is a game changer.


what am i but an extension of you?

Offline

#16 2010-04-26 22:35:17

extofme
Member
From: here + now
Registered: 2009-10-10
Posts: 174
Website

Re: anyone using brtfs with 2.6.33

looks like the features i want to add won't be usable unless your running a 2.6.34 kernel.  i will make the mkinitcpio-btrfs hook account for this.  see here:

http://www.mail-archive.com/linux-btrfs … 04763.html

for more information.


what am i but an extension of you?

Offline

#17 2010-04-28 07:41:48

extofme
Member
From: here + now
Registered: 2009-10-10
Posts: 174
Website

Re: anyone using brtfs with 2.6.33

just a note here since there is some interest....

i have completely rewritten the btrfs hook to provide rollback support:

http://aur.archlinux.org/packages.php?ID=33376

it works pretty good; i will document further tomm/next day when i can, but it's usable now.  will be adding auto repair support soon.  there are a couple gotchas that i will document soon (nothing like data loss or anything like that)

QUICK:
1) install the hook
2) create a snapshot:

$ sudo rollback_snapshot

3) do some crazy dangerous stuff smile
4) reboot
5) press a key when it says "PRESS ANY KEY TO ROLLBACK..."
6) choose a snapshot
7) enjoy...

NOTE: until 2.6.34, rollbacks are VOLATILE (unless someone rewrites it).  this means that when you're in "rollback" mode, anything you do/save/create/whatever may/will potentially be lost.  a copy is made (snapshot of a snapshot) of your chosen rollback point, and you are booted into that, NOT the actual snapshot you chose.  this protects your snapshots from harm.  it's meant to give you a working environment so you can mount your real system and fix it (chroot into it/whatever).  once 2.6.34 rolls around this can be changed (we need the ability to list subvolumes and set a new default, and we need to discuss the right way to implement this permanently)

Last edited by extofme (2010-04-28 07:47:57)


what am i but an extension of you?

Offline

Board footer

Powered by FluxBB