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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Satoru Takeuchi
PRO
October 03, 2023
Technology
2
650
lsblkのtypeフィールドのしくみ
以下動画のテキストです。
https://youtu.be/x_QSV1tM3qY
Satoru Takeuchi
PRO
October 03, 2023
Tweet
Share
More Decks by Satoru Takeuchi
See All by Satoru Takeuchi
書籍執筆での生成AIの活用
sat
PRO
1
290
ChatGPTに従って体調管理2026
sat
PRO
0
150
eBPF
sat
PRO
1
110
waruiBPF
sat
PRO
0
110
eBPFとwaruiBPF
sat
PRO
5
3.8k
Pythonのコードの気になる行でスタックトレースを出す
sat
PRO
1
100
ソースコードを読むときの思考プロセスの例 ~markdownのレンダリング方法を知りたかった2 markdownパッケージ~
sat
PRO
0
200
様々なファイルシステム
sat
PRO
0
340
ソースを読む時の思考プロセスの例-MkDocs
sat
PRO
1
430
Other Decks in Technology
See All in Technology
ファインディの横断SREがTakumi byGMOと取り組む、セキュリティと開発スピードの両立
rvirus0817
1
1.5k
22nd ACRi Webinar - NTT Kawahara-san's slide
nao_sumikawa
0
100
顧客との商談議事録をみんなで読んで顧客解像度を上げよう
shibayu36
0
260
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
68k
ClickHouseはどのように大規模データを活用したAIエージェントを全社展開しているのか
mikimatsumoto
0
260
Data Hubグループ 紹介資料
sansan33
PRO
0
2.7k
日本の85%が使う公共SaaSは、どう育ったのか
taketakekaho
1
230
セキュリティについて学ぶ会 / 2026 01 25 Takamatsu WordPress Meetup
rocketmartue
1
310
Oracle Cloud Observability and Management Platform - OCI 運用監視サービス概要 -
oracle4engineer
PRO
2
14k
AWS Network Firewall Proxyを触ってみた
nagisa53
1
240
配列に見る bash と zsh の違い
kazzpapa3
3
160
What happened to RubyGems and what can we learn?
mikemcquaid
0
310
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.2k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
Discover your Explorer Soul
emna__ayadi
2
1.1k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
180
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
140
The Cost Of JavaScript in 2023
addyosmani
55
9.5k
Site-Speed That Sticks
csswizardry
13
1.1k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
590
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
120
Test your architecture with Archunit
thirion
1
2.2k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.6k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
62
50k
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