Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Btrfsの構造

naota
October 19, 2013

 Btrfsの構造

naota

October 19, 2013
Tweet

More Decks by naota

Other Decks in Programming

Transcript

  1. Btrfs ͷػೳɾಛ௃ . . Quota QGroup ͱݺ͹ΕΔಛघͳ quota εφοϓγϣ οτ͕͋ΔͷͰʮڞ༗σʔλʯ͕ଘࡏ͢Δ

    ʮશମͷαΠζʯͱʮڞ༗͞Ε͍ͯͳ͍αΠζʯʹΑΔ੍ݶ͕Ͱ͖Δ ڈ೥ͷ Software Design10 ݄߸ʹࡌͬͯ·͢ 2013-06-14 12 / 51
  2. Btrfs ͷػೳɾಛ௃ . . ͦͷଞ 16EiB ·Ͱ࢖͑Δ (XFS ͷ 2

    ഒ!) checksum ͕͋Δ͔ΒϒϩοΫͷ੔߹ੑνΣ οΫ OK! ಁաతѹॖͰ༰ྔઅ໿! RAID Ͱ৴པੑ޲্! send/receive Ͱޮ཰తͳόοΫΞοϓ! Hot add/remove ͰΒ͘Β͘σΟεΫަ׵! dedup Ͱॏෳഉআ! SSD ༻࠷దԽ΋͋ΔΑ! 2013-06-14 14 / 51
  3. Btrfs ͷػೳɾಛ௃ . . কདྷతʹ ॻ͖͜Έͱಉ࣌ʹࣗಈ dedup hot data tracking

    ͰΑ͘ΞΫηε͢ΔϑΝΠϧΛ SSD ʹΩϟ ογϡ! fsck? 2013-06-14 15 / 51
  4. B ໦ . . B ໦ Btrfs ͷ΄ͱΜͲ͍ͨΔͱ͜ΖͰ࢖ΘΕΔσʔλߏ଄ ͜Ε͕Θ͔Βͳ͍ͱ Btrfs

    ͕Θ͔Βͳ͍ ͳΜͱ͍ͬͯ΋ “BtrFS” = “B-Tree File System” Ͱ͔͢Βͳ! 2013-06-14 17 / 51
  5. Btrfs ͷ໦ . . Btrfs ͷ B ໦ Key ΦϒδΣΫτ

    ID λΠϓ Φϑηοτ ϊʔυͱϦʔϑ Ұ൪Լ͕Ϧʔϑɺ࢒Γ͕Λϊʔυ ϦʔϑʹΩʔʹରԠ͢Δσʔλ͕อ؅͞ΕΔ 2013-06-14 29 / 51
  6. Btrfs ͷ໦ . . ༷ʑͳ໦ Root tree FS tree extent

    tree chunk tree device tree CSum tree 2013-06-14 31 / 51
  7. Btrfs ͷ໦ . . Root Tree جຊͷ໦! ଞͷ໦ͷ root Λอ࣋

    αϒϘϦϡʔϜߏ଄ͷऔಘ 2013-06-14 32 / 51
  8. Btrfs ͷ໦ . . FS Tree αϒϘϦϡʔϜɾεφοϓγϣ οτ͝ͱʹ FS tree

    ͷ root ͕͋Δ σΟϨΫτϦߏ଄ i-node ৘ใ ϑΝΠϧσʔλҐஔ (extent address) 2013-06-14 33 / 51
  9. Btrfs ͷ໦ . . device treeɾCSum tree device tree Btrfs

    ʹొ࿥͞Ε͍ͯΔσόΠεͷ؅ཧ CSum tree 4KB ͝ͱͷ checksum 2013-06-14 35 / 51
  10. bootstrap Btrfs ͷ tree ΋ϑΝΠϧ΋શͯ extent address(࿦ཧΞυϨε) ͰΞΫ ηε Root

    tree ΋ extent address ͰΞΫηε͞ΕΔ chunk tree ࣗ਎΋ Ͳ͏΍ͬͯ࠷ॳͷ extent address Λ෺ཧΞυϨεʹϚοϐϯά͢ Δͷ? 2013-06-14 37 / 51
  11. bootstrap . . superblock btrfs Ͱ།Ұ෺ཧతʹΞυϨε͕ܾ·͍ͬͯΔ ύʔςΟγϣϯ ઌ಄͔Β 6410KiB, 6410MiB,

    25610GiB, 1PiB root ͷ extent address root tree chunk tree system chunk ͷ chunk ৘ใ chunk tree ͷϊʔυ, Ϧʔϑ͸ system chunk ͔ΒׂΓ౰ͯΒΕΔ 2013-06-14 38 / 51
  12. ࠷ۙͷ͜ͱ . . dump [42604.796633] BTRFS assertion failed: !memcmp_extent_buffer( b,

    &disk_key, offsetof(struct btrfs_leaf, items[0].key), sizeof(disk_key)), file: fs/btrfs/ctree.c, line: 2444 2013-06-14 42 / 51
  13. ࠷ۙͷ͜ͱ . . tree mod log B-tree ͷมߋ࣌ʹมߋલʹͲ͏͍͏஋͕ೖ͍͔ͬͯͨΛه࿥ transaction ͝ͱʹϦηοτ͞ΕΔ

    ϝϞϦ্͚ͩͰσΟεΫʹ͸ॻ͔Εͳ͍ ͜ΕͰʮੲͷ B-treeʯΛͱΓ͕ͩͦ͢Ε͕όάͬͯΔ? 2013-06-14 46 / 51
  14. ϦϯΫ . . ը૾ http://www.flickr.com/photos/artofphotography-ramsner/9592744354 http://www.flickr.com/photos/surferbill/2506950772/ http://www.flickr.com/photos/rore/1304728223/ http://ja.wikipedia.org/wiki/ %E3%83%95%E3%82%A1%E3%82%A4%E3%83%AB: Binary_search_tree.svg

    http://www.flickr.com/photos/protohiro/85504626/ http://www.flickr.com/photos/rubyji/74176893/ http://www.flickr.com/photos/rore/1304728223/ http://www.flickr.com/photos/dolfiedream/5060030894/ 2013-06-14 51 / 51