Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
lsblkのtypeフィールドのしくみ
Search
Satoru Takeuchi
PRO
October 03, 2023
Technology
690
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
lsblkのtypeフィールドのしくみ
以下動画のテキストです。
https://youtu.be/x_QSV1tM3qY
Satoru Takeuchi
PRO
October 03, 2023
More Decks by Satoru Takeuchi
See All by Satoru Takeuchi
cpコマンドはディスク上でデータを コピーしないことがある
sat
PRO
3
44
114-ファイルのshallow_copy.pdf
sat
PRO
2
24
113-Btrfsのスナップショット.pdf
sat
PRO
0
8
システム強制終了時にファイルシステムの整合性を保つ~ コピーオンライト編 ~
sat
PRO
0
54
システム強制終了時に ファイルシステムの整合性を保つ ~ ジャーナリング編 ~
sat
PRO
2
60
ファイルシステムの整合性を回復するfsck
sat
PRO
1
62
小学校5,6年生向けキャリア教育 大人になるまでの道
sat
PRO
8
5k
ファイルシステムの不整合
sat
PRO
2
150
書籍執筆での生成AIの活用
sat
PRO
2
520
Other Decks in Technology
See All in Technology
[AWS Summit Japan 2026]迷っているあなたへ_小さな一歩が、やがて自分を助けてくれる
sh_fk2
1
160
SONiCのLinuxベースを活かしたZabbix監視
sonic
0
230
Bucharest Tech Week 2026 - Reinventing testing practices in the AI era
edeandrea
PRO
1
170
2026TECHFRESH畢業分享會 - Lightning Talk - 資料也要 CI/CD? 用 Airbyte 自動化資料同步
line_developers_tw
PRO
0
1.3k
LayerXにおけるセキュリティ管理の現在地と次の一手
tosho
0
240
2026年6月23日 Syncable Tech + Start Python Club にて
hamukazu
0
140
徹底討論!ECS vs EKS!
daitak
0
230
ロボティクスの技術 / Robotics Technology
ks91
PRO
0
110
あなたの知らないPDFのアクセシビリティ
lycorptech_jp
PRO
0
220
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
6
2k
手塩にかけりゃいいってもんじゃない
ming_ayami
0
610
ぼっちではじめた登壇が「51名」「241件」の発信に化けた
subroh0508
1
240
Featured
See All Featured
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.7k
We Have a Design System, Now What?
morganepeng
55
8.2k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
260
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.5k
The Pragmatic Product Professional
lauravandoore
37
7.3k
Music & Morning Musume
bryan
47
7.2k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
1.7k
Odyssey Design
rkendrick25
PRO
2
700
Measuring & Analyzing Core Web Vitals
bluesmoon
9
870
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.3k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Transcript
lsblkのtypeフィールドのしくみ Oct. 4th, 2023 Satoru Takeuchi twitter: satoru_takeuchi, EnSatoru 1
今回話すこと • lsblkというブロックデバイス一覧表示するコマンド • とくにtypeフィールドの値を決める方法 2
lsblkとは • ブロックデバイスについての色々な情報を得るためのコマンド 3
typeフィールド • ブロックデバイスの種類を表示 • 📝 過去動画「Linuxの色々なブロックデバイス」 4
ブロックデバイスの構成 5 sda (disk) sdb (disk) sdc (disk) sda1 (part)
sda2 part FAT32 filesystem ext4 filesystem testvg dm-0 (lvm) dm-1 (crypt) test.img loop0 (loop)
lsblkのソース • util-linuxの中にある • githubだとgithub.com/util-linux/util-linux • typeを判定しているのはmisc_utils/lsblk.c#get_type() 6
判定方法 • 基本は/sys/block以下のファイルを見る 7
kpartxコマンド • ディスクイメージなどの中のパーティションをブロックデバイスとして見えるようにす る • isoイメージの中のパーティションに作ったファイルシステムのmount時などによく使 う ◦ kpartx -a
test.img ◦ mount /dev/loop0p1 ◦ kpartx -d test.img 8
まとめ • ブロックデバイスの一覧を出すlsblkというコマンドがある • 出力の中のtypeフィールドはブロックデバイスの種類を示す • /sys/block以下の情報をもとに種類を識別している 9