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
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
74
Linuxカーネルの インタフェースは変わりうる?
sat
PRO
1
100
あなたの知らないバージョン命名規則
sat
PRO
3
910
Rook: Intro and Deep Dive with Ceph
sat
PRO
1
67
Machine Check Exception
sat
PRO
2
68
バイナリダンプの模様を読む
sat
PRO
0
110
cpコマンドはディスク上でデータを コピーしないことがある
sat
PRO
3
100
114-ファイルのshallow_copy.pdf
sat
PRO
2
59
113-Btrfsのスナップショット.pdf
sat
PRO
0
42
Other Decks in Technology
See All in Technology
あなたの知らないAmazon VPC Route Server/Amazon VPC Route Server you don't know about
masakiokuda
2
210
検証フェーズはAIの回答を判断するための学習機会
toru_kubota
2
380
DAMOS - The Smart Cruise Control for RAM
ennael
PRO
1
110
生成AIと進める探索的データ分析(2026.10.03 第122回Tokyo.R勉強会)
tatamiya
2
1.3k
データ品質を壊しながらSnowflakeのAIに分析させてみた
kawanago
0
410
1万名の社員が使う認証基盤で どう信頼性を担保するか?
kairim0
0
180
1人アドミンな私はAWSアカウント申請をSlackで完結したい!
ysuzuki
0
110
spanner-autoscalerに学ぶ CRD設計パターン 〜自動化と緊急時対応を両立する Kubernetesコントローラーの作り方〜
tkuchiki
0
220
組み立てて楽しむ AWS Blocks 入門
kmiya84377
0
150
Claude Designがめちゃくちゃ便利なので使ってほしい
diggymo
0
230
おそらく日本で唯一のDevRelインターン生として
husengs7
0
110
覗いてみよう 関数型ビジュアル言語×2Dグラフィックスの世界
yohyamasaki
0
170
Featured
See All Featured
Skip the Path - Find Your Career Trail
mkilby
1
240
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
960
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Fireside Chat
paigeccino
43
4k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
We Are The Robots
honzajavorek
0
380
YesSQL, Process and Tooling at Scale
rocio
174
15k
Amusing Abliteration
ianozsvald
1
320
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
380
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
420
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