Author
Politehnica University of
Bucharest
Automatic Control and Computers
Faculty
Computer Science
Department
Scientific Advisor
File System Freezing Solution Using Btrfs
Vladimir-Andrei [email protected]
Drd. Ing. Octavian PurdilăAs. Drd. Ing. Răzvan Deaconescu
Bachelor Presentation Session - July 2010
Contents• Goal• Why Btrfs?• Architecture• Features• Implementation• Modified Btrfs module• Logical subvolume cloning• Logical subvolume deletion• On-the-fly freezing / thawing• Viewing the subvolume tree• Future development
05.05.23 Bachelor Presentation Session - July 2010 2
Goal
• Freezing solution– Discarding changes to the FS
• RCS features
05.05.23 Bachelor Presentation Session - July 2010 3
Why Btrfs?
• Next default FS for most Linux distros?– Caveat: still unstable
• Subvolumes• Snapshots• COW• COW-friendly B-trees
05.05.23 Bachelor Presentation Session - July 2010 4
C D E F
A B
X Y
B’
F’
Architecture
frozen_butter
Btrfskernel space
user space
frozen_butter
frozen_ops frozen_tree
05.05.23 Bachelor Presentation Session - July 2010 5
Features
• Supported logical subvolume operations– Cloning, deleting, freezing, thawing– Optimizing for long-term use
• Tracking time of creation, freezing and thawing
• Tracking parent-child relationships
05.05.23 Bachelor Presentation Session - July 2010 6
Implementation
• Logical subvolume = 2 on-disk subvolumes– Base– Sandbox
• Manipulation when:– Mounting– Cloning / deleting / optimizing– Freezing / thawing
05.05.23 Bachelor Presentation Session - July 2010 7
Modified Btrfs module
• Superblock metadata• Numbered subvolumes• Mounting procedure• IOCTLs• Backwards compatible
Logical subvolume cloning
4157
263
1
26
3
4
57
time
3 4 6 7
2 5
1
05.05.23 Bachelor Presentation Session - July 2010 9
# frozen_butter /mnt /dev/sda1 –c <id> <name>
3 4 6
7
5
1
Logical subvolume deletion
4157
63
1
63
4
57
time
05.05.23 Bachelor Presentation Session - July 2010 10
# frozen_butter /mnt /dev/sda1 –d 2
On-the-fly freezing / thawing
remount
05.05.23 Bachelor Presentation Session - July 2010 11
# mount /dev/sda1 /mnt# frozen_butter /mnt /dev/sda1 –f 1# umount /mnt
# mount /dev/sda1 /mnt
# frozen_butter /mnt /dev/sda1 –t 1
Viewing the subvolume tree
# frozen_butter /mnt /dev/sda1 –p[1] INIT [2] name2 [3] name3 [4] name4 (frozen) [6] name6 [5] name5 [7] name7Currently mounted: 3After next mount: 2
Future development
• Kernel space– Offloading (almost) everything– Support for deleting nested subvolumes
• User space– Project-specific tools
05.05.23 Bachelor Presentation Session - July 2010 13
Thank you!
• Btrfs• Subvolume• Snapshot• Freezing• Thawing
?05.05.23 Bachelor Presentation Session - July 2010 14