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
デバイス名は変わりうる
Search
Satoru Takeuchi
PRO
June 13, 2020
Technology
950
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
デバイス名は変わりうる
以下動画のテキストです。
https://youtu.be/Wl5wSXRPnxE
Satoru Takeuchi
PRO
June 13, 2020
More Decks by Satoru Takeuchi
See All by Satoru Takeuchi
119-多機能ファイルシステムBtrfs_のコピー.pdf
sat
PRO
1
68
Linuxカーネルの インタフェースは変わりうる?
sat
PRO
1
93
あなたの知らないバージョン命名規則
sat
PRO
3
900
Rook: Intro and Deep Dive with Ceph
sat
PRO
1
64
Machine Check Exception
sat
PRO
2
66
バイナリダンプの模様を読む
sat
PRO
0
89
cpコマンドはディスク上でデータを コピーしないことがある
sat
PRO
3
88
114-ファイルのshallow_copy.pdf
sat
PRO
2
57
113-Btrfsのスナップショット.pdf
sat
PRO
0
40
Other Decks in Technology
See All in Technology
AIを活用するために決めた "やらないこと" - 価値に注目する / Not betting on AI
soudai
PRO
2
540
TinyGo 開発サイクルを高速化する:Go で作るエミュレータ入門
zozotech
PRO
1
740
事業課題から技術的負債に向き合う
sansantech
PRO
2
1.9k
作品が生態系になった ─ Mini Tokyo 3D から世界へ
nagix
0
190
aws-iot-platform-architecture-use-cases.pdf
ma2shita
0
250
品質と信頼性を地続きにする
grimoh
0
640
AI de Idea
kawaguti
PRO
2
120
その Lambda、8分で 管理者権限まで奪われます
k1nakayama
6
2.8k
Claude Codeを「使うほど育つ」AI秘書にするノウハウ
minorun365
PRO
31
26k
AIに任せた品質は、誰が見立てるのか - AI時代のテストマネジメント
nakanao
3
2k
Goodbye ShellScript, Hello File-based App
shunsock
0
140
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
12k
Featured
See All Featured
Between Models and Reality
mayunak
4
460
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
500
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
Technical Leadership for Architectural Decision Making
baasie
3
570
Chasing Engaging Ingredients in Design
codingconduct
0
310
HDC tutorial
michielstock
2
870
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
The Pragmatic Product Professional
lauravandoore
37
7.4k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
320
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
510
Transcript
デバイス名は変わりうる Jun 13th, 2020 Satoru Takeuchi Twitter: satoru_takeuchi 1
もくじ • 伝統的なデバイス名 • デバイス名は変わりうる • デバイス名の変化への対策 • まとめ 2
もくじ • 伝統的なデバイス名 • デバイス名は変わりうる • デバイス名の変化への対策 • まとめ 3
伝統的なデバイス名 • ブロックデバイスの伝統的な名前 ◦ HDD, SSD: /dev/sda, /dev/sdb… ◦ NVMe
SSD: /dev/nvm0n1, /dev/nvm0n2… ◦ VM上の準仮想化デバイス : /dev/vda, /dev/vdb... • TIPS ◦ ブロックデバイスの一覧表示 : lsblk ◦ ブロックデバイスの情報を得る : /sys/block/<名前>以下のファイルを見る • 主な用途: 起動時のマウント: /etc/fstab ◦ デバイス名ではなくUUIDというものを使っている。なぜ ? 4
もくじ • 伝統的なデバイス名 • デバイス名は変わりうる • デバイス名の変化への対策 • まとめ 5
デバイス名のつけかた • カーネルは起動時にデバイスの認識順に/dev/sda,/dev/sdb...と名前をつける 6 Disk A Disk B 最初に認識したから /dev/sda
Disk C 2番目に認識したから /dev/sdb 3番目に認識したから /dev/sdc
デバイス認識順が変わると… • デバイス名が変わってしまう ◦ この状態でdisk Cを初期化するつもりで dd if=/dev/zero of=/dev/sdcとすると死ぬ 7
Disk A Disk B 最初に認識したから /dev/sda Disk C 3番目に認識したから /dev/sdc 2番目に認識したから /dev/sdb
デバイス名が変わる典型例1: デバイスの故障 8 Disk A Disk B 最初に認識したから /dev/sda Disk
C 2番目に認識したから /dev/sdb 3番目に認識したから /dev/sdc Disk A Disk B 最初に認識したから /dev/sda Disk C 2番目に認識したから /dev/sdb 故障
演習 • やること: デバイス故障によってデバイス名が変更されることを確認 ◦ /dev/vda(ディスクA), /dev/vdb(ディスクB), /dev/vdc(ディスクC)がある仮想マシン環境を使う • 手順
1. 仮想マシン上で以下を確認 ▪ /dev/vdb(ディスクB)の先頭には”scratch1”という文字列データが入っている ▪ /dev/vdc(ディスクC)の先頭には”scratch2”という文字列データが入っている 2. 仮想マシンをシャットダウン 3. ディスクBを取り外す(故障のエミュレーション ) 4. 仮想マシンを再起動後 5. /dev/vdbの先頭に”scratch1”ではなく”scratch2”が入っていることを確認 9
もくじ 伝統的なデバイス名 デバイス名は変わりうる デバイス名の変化への対策 まとめ 10
代表的な対策 • Udevのpersistent device nameを使う ◦ Udevというサービスはデバイスを認識するごとに様々な別名をつけてくれる ▪ /dev/disk/by-uuid以下のファイル ▪
/dev/disk/by-label以下のファイル ▪ /dev/disk/by-path以下のファイル ◦ 詳細はarch wikiの”Persistent block device naming”のページなどを参照 • fstabには”UUID=”や”LABEL=”によるデバイス名指定もできる 11
もくじ 伝統的なデバイス名 デバイス名は変わりうる デバイス名の変化への対策 まとめ 12
まとめ • カーネルは起動時にディスク認識順に/dev/sda,/dev/sdbなどの名前をつける • 上記デバイス名は状況によって変わりうるのでfstabなどに指定するのは危険 • Udevのpersistent device nameなどをかわりに使う 13