Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
113-Btrfsのスナップショット.pdf
Search
Satoru Takeuchi
PRO
May 25, 2026
48
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
113-Btrfsのスナップショット.pdf
Satoru Takeuchi
PRO
May 25, 2026
More Decks by Satoru Takeuchi
See All by Satoru Takeuchi
119-多機能ファイルシステムBtrfs_のコピー.pdf
sat
PRO
1
80
Linuxカーネルの インタフェースは変わりうる?
sat
PRO
1
110
あなたの知らないバージョン命名規則
sat
PRO
3
930
Rook: Intro and Deep Dive with Ceph
sat
PRO
1
74
Machine Check Exception
sat
PRO
2
72
バイナリダンプの模様を読む
sat
PRO
0
120
cpコマンドはディスク上でデータを コピーしないことがある
sat
PRO
3
110
114-ファイルのshallow_copy.pdf
sat
PRO
2
63
システム強制終了時にファイルシステムの整合性を保つ~ コピーオンライト編 ~
sat
PRO
0
80
Featured
See All Featured
Building AI with AI
inesmontani
PRO
1
1.3k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
1
280
A Soul's Torment
seathinner
8
3.8k
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.4k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.3k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
950
Agile that works and the tools we love
rasmusluckow
331
22k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
400
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
220
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.2k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
570
Transcript
Btrfsのスナップショット May. 25th, 2026 Satoru Takeuchi X: satoru_takeuchi 1
• Btrfsがサポートしているファイルシステムレベルでのスナップショット • CoW(Copy-on-Write)機能を利用して実現 ◦ 📝 過去動画: その112 システム強制終了時にファイルシステムの整合性を保つ ~
コピーオンライト 編 ~ • スナップショットそのものが何かについては過去動画を参照 ◦ 📝 過去動画: その29 スナップショット はなすこと 2
サブボリューム • Btrfsでsnapshotを作成する単位(ここでは/mntにbtrfsをmountしている) • ファイルシステム上はディレクトリに見える 3 # btrfs subvolume create
/mnt/foo # 作成 Create subvolume '/mnt/foo' # ls /mnt # ディレクトリに見える foo # ls /mnt/foo # 中でlsもできる #
snahshot • foo以下に適当にファイルを作る • fooのsnapshot作成 4 # echo bar >/mnt/foo/bar
# echo baz >/mnt/foo/baz # ls /mnt/foo/ bar baz # btrfs subvolume snapshot /mnt/foo /mnt/hoge Create a snapshot of '/mnt/foo' in '/mnt/hoge' # ls /mnt/hoge/ bar baz # cat /mnt/hoge/bar bar # cat /mnt/hoge/baz baz #
snahshot • foo以下に適当にファイルを作る • fooのsnapshot作成 5 # echo bar >/mnt/foo/bar
# echo baz >/mnt/foo/baz # ls /mnt/foo/ bar baz # btrfs subvolume snapshot /mnt/foo /mnt/hoge Create a snapshot of '/mnt/foo' in '/mnt/hoge' # ls /mnt/hoge/ bar baz # cat /mnt/hoge/bar bar # cat /mnt/hoge/baz baz # “cp -r /mnt/foo /mnt/hoge”との違い • foo以下に大量のデータがあっても短 時間(多くはほぼ一瞬)で終わる • 追加容量をほぼ必要としない
btrfsのsnapshot作成が高速な理由を説明 • 初期状態 ◦ サブボリュームfooの下にbar,bazというファイルが存在する ◦ bar,bazはものすごく大きいとする (例: 数TiB) /
foo bazのメタデータ barのメタデータ barのデータ bazのデータ
fooのsnapshotであるhogeを作成すると… • barとbazを参照するhogeを作る • fooとhogeを参照するrootを作る / foo bazのメタデータ barのメタデータ barのデータ
bazのデータ / hoge
最後にrootを差し替え • これで終わり • barとbazには一切触っていないので高速 • 後でbarやbazを更新するときはメタデータ/データをCoWする / foo bazのメタデータ
barのメタデータ barのデータ bazのデータ / hoge
まとめ • Btrfsはbtrfs subvolume createコマンドでsubvolumeを使える • btrfs subvolume snapshotコマンドでsubvolumeのsnapshotを作成できる •
snapshotの利点 ◦ コピーに比べて高速で完了するし容量もほとんど消費しない ◦ readonlyでsnapshotを作成して、そのデータをコピーによりバックアップを作成するといった使い方 ができる ◦ かっこいい • snapshotの注意点(過去動画と一部同じ) ◦ データは冗長化されず、あくまで参照をコピーするだけなので、 snapshotそのものはバックアップに はならない ◦ snapshotを読み書き可能状態で作成すると後から使用量が CoWで予測しづらい形で増える ▪ ファイルの新規作成やファイルサイズの拡張をしていないのに使用量が増える 9