如果我執行lsblk -p
命令,則輸出如下:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
/dev/loop0 7:0 0 99,4M 1 loop /snap/core/11606
/dev/loop1 7:1 0 4K 1 loop /snap/bare/5
/dev/loop2 7:2 0 55,5M 1 loop /snap/core18/1988
/dev/loop3 7:3 0 219M 1 loop /snap/gnome-3-34-1804/66
/dev/loop4 7:4 0 219M 1 loop /snap/gnome-3-34-1804/72
/dev/loop5 7:5 0 99,3M 1 loop /snap/core/11743
/dev/loop6 7:6 0 55,4M 1 loop /snap/core18/2128
/dev/loop7 7:7 0 131,6M 1 loop /snap/docker/796
/dev/loop8 7:8 0 242,4M 1 loop /snap/gnome-3-38-2004/76
/dev/loop9 7:9 0 51M 1 loop /snap/snap-store/547
/dev/loop10 7:10 0 32,3M 1 loop /snap/snapd/13170
/dev/loop11 7:11 0 165M 1 loop /snap/postman/144
/dev/loop12 7:12 0 32,3M 1 loop /snap/snapd/12883
/dev/loop13 7:13 0 65,1M 1 loop /snap/gtk-common-themes/1515
/dev/loop14 7:14 0 88,1M 1 loop /snap/remmina/5028
/dev/loop15 7:15 0 102,3M 1 loop /snap/remmina/5070
/dev/loop16 7:16 0 51M 1 loop /snap/snap-store/518
/dev/loop17 7:17 0 65,2M 1 loop /snap/gtk-common-themes/1519
/dev/loop18 7:18 0 10,9M 1 loop /snap/ncspot/141
/dev/loop19 7:19 0 168,1M 1 loop /snap/postman/147
/dev/loop20 7:20 0 61,8M 1 loop /snap/core20/1081
/dev/loop21 7:21 0 4,5M 1 loop /snap/spt/275
/dev/nvme0n1 259:0 0 477G 0 disk
├─/dev/nvme0n1p1 259:1 0 300M 0 part /boot/efi
├─/dev/nvme0n1p2 259:2 0 128M 0 part
├─/dev/nvme0n1p3 259:3 0 312,1G 0 part
├─/dev/nvme0n1p4 259:4 0 900M 0 part
├─/dev/nvme0n1p5 259:5 0 17G 0 part
├─/dev/nvme0n1p6 259:6 0 9,6G 0 part /home
├─/dev/nvme0n1p7 259:7 0 3,8G 0 part [SWAP]
└─/dev/nvme0n1p8 259:8 0 111,8G 0 part /
這文章提到列中的數字MAJ:MIN
是核心用於內部識別設備的數字,第一個數字指定設備類型(例如 8,用於 SCSI 磁碟)。也,這個問題的答案之一 unix stack exchange提到這個參考顯示兩列,左邊一列(即 1 個區塊、2 個字元、2 個區塊等),右邊一列顯示描述(即記憶體裝置、RAM 磁碟等)。
從lsblk -p
上面的輸出來看,我的主設備號碼是 7 和 259。我從中找到的唯一數字259和7文件只有這段文字:
259 block Block Extended Major
Used dynamically to hold additional partition minor
numbers and allow large numbers of partitions per device
7 char Virtual console capture devices
0 = /dev/vcs Current vc text (glyph) contents
1 = /dev/vcs1 tty1 text (glyph) contents
...
63 = /dev/vcs63 tty63 text (glyph) contents
64 = /dev/vcsu Current vc text (unicode) contents
65 = /dev/vcsu1 tty1 text (unicode) contents
...
127 = /dev/vcsu63 tty63 text (unicode) contents
128 = /dev/vcsa Current vc text/attribute (glyph) contents
129 = /dev/vcsa1 tty1 text/attribute (glyph) contents
...
191 = /dev/vcsa63 tty63 text/attribute (glyph) contents
NOTE: These devices permit both read and write access.