
プログラム的に、LUN ノードがブート ボリュームであるかどうか (LUN ノードは/dev/
Linux システム (RHEL や Ubuntu などの他の Linux フレーバー) で作成されます) を確認するにはどうすればよいでしょうか。
dd
私の知る限りでは、、、hexdump
などのユーティリティを使用して確認する方法file
や、プログラムで最初の 512 バイトを読み取る方法など (LUN ノードから最初の 512 バイトを確認/読み取る) があります。
他に効率的な方法はありますか? よろしくお願いします。
答え1
パーティションが起動可能かどうかを判断するには、sfdisk
次の方法を使用できます。
$ sudo sfdisk -l
Disk /dev/sda: 60801 cylinders, 255 heads, 63 sectors/track
Units: cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/sda1 * 0+ 63- 64- 512000 83 Linux
/dev/sda2 63+ 60801- 60738- 487873536 8e Linux LVM
/dev/sda3 0 - 0 0 0 Empty
/dev/sda4 0 - 0 0 0 Empty
*
起動可能なデバイスの場合は、出力の 2 列目にが表示されます。LVM や SD カードなどの他の種類のデバイスの場合:
Disk /dev/mapper/fedora_greeneggs-swap: 997 cylinders, 255 heads, 63 sectors/track
Disk /dev/mapper/fedora_greeneggs-root: 6527 cylinders, 255 heads, 63 sectors/track
Disk /dev/mapper/fedora_greeneggs-home: 53212 cylinders, 255 heads, 63 sectors/track
Disk /dev/mmcblk0: 488672 cylinders, 4 heads, 16 sectors/track
sfdisk: Warning: The partition table looks like it was made
for C/H/S=*/255/63 (instead of 488672/4/16).
For this listing I'll assume that geometry.
Units: cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/mmcblk0p1 0+ 1946- 1947- 15633408 c W95 FAT32 (LBA)
/dev/mmcblk0p2 0 - 0 0 0 Empty
/dev/mmcblk0p3 0 - 0 0 0 Empty
/dev/mmcblk0p4 0 - 0 0 0 Empty
私の知る限り、LVM 論理ボリューム (LV) は起動できません。また、星印は*
SD カードなどの他の種類のメディアにも適用されます。