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
lsblkのtypeフィールドのしくみ
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Satoru Takeuchi
PRO
October 03, 2023
Technology
730
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
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
75
Machine Check Exception
sat
PRO
2
72
バイナリダンプの模様を読む
sat
PRO
0
120
cpコマンドはディスク上でデータを コピーしないことがある
sat
PRO
3
110
114-ファイルのshallow_copy.pdf
sat
PRO
2
63
113-Btrfsのスナップショット.pdf
sat
PRO
0
48
Other Decks in Technology
See All in Technology
Active Record Connection Adaptersにおける長年の課題に再び取り組む
yahonda
0
410
LLM-as-a-Judgeは本当に信頼できるのか――評価器を評価する話
taka_aki
3
1k
スプシの手作業からの解脱 ~更新はClaude Codeに、見せ方と使い方はGASアプリに任せる~
kentarofujii
0
190
Codex を使った障害対応机上演習の実際
orgachem
PRO
0
290
日本語に強いオープンな大規模言語モデル「LLM-jp」
odashi
5
1.2k
小規模OSSモデルは サイバーセキュリティ業務に どこまで使えるか
bbrbbq
0
190
『SAR衛星データ解析入門』のご紹介とその応用
syuchimu
0
140
Kiro Crewで「みのるん式」仕事術やってみた
minorun365
PRO
3
1k
FinOps Agentが生んだ技術負債:コスト自動調査の落とし穴と解消までの道のり
oasis1994liveforever
3
250
古い指輪から広がった JAVA コミュニティ とのつながり
yamad
0
140
Conditional PED-ANOVA: Hyperparameter Importance in Hierarchical & Dynamic Search Spaces
pfn
PRO
0
150
sue445's proposals 2026
sue445
0
130
Featured
See All Featured
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
640
Context Engineering - Making Every Token Count
addyosmani
9
1.2k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
Docker and Python
trallard
47
4.2k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
2.2k
Building a Scalable Design System with Sketch
lauravandoore
464
34k
Deep Space Network (abreviated)
tonyrice
0
380
Product Roadmaps are Hard
iamctodd
55
13k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
360
Art, The Web, and Tiny UX
lynnandtonic
304
22k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
330
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