부팅 볼륨 확인

부팅 볼륨 확인

프로그래밍 방식으로 lun 노드가 부팅 볼륨인지 확인하는 방법(lun 노드는 /dev/RHEL, Ubuntu 또는 기타 Linux 버전과 같은 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

*부팅 가능한 모든 항목은 출력의 두 번째 열에 나타납니다. 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 카드와 같은 다른 유형의 미디어에도 적용됩니다.

관련 정보