syslinux가 디스크 이미지에 예상치 못한 파티션을 생성합니다.

syslinux가 디스크 이미지에 예상치 못한 파티션을 생성합니다.

디스크 이미지에 부트로더를 설치하려고 할 때 이상한 동작이 발생합니다. 내가 따라온 과정은 다음과 같습니다.

$ dd if=/dev/zero of=test.img status=progress bs=200M count=1
1+0 records in
1+0 records out
209715200 bytes (210 MB, 200 MiB) copied, 0.190117 s, 1.1 GB/s

$ mkfs.ext2 test.img
mke2fs 1.47.0 (5-Feb-2023)
Discarding device blocks: done
Creating filesystem with 204800 1k blocks and 51200 inodes
Filesystem UUID: f6442813-7b8c-4636-b69e-334696e0840b
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729

Allocating group tables: done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done

$ sudo mount test.img mount-point/ -o loop

$ fdisk -l test.img
Disk test.img: 200 MiB, 209715200 bytes, 409600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

$ sudo extlinux -i mount-point/
mount-point/ is device /dev/loop0
Warning: unable to obtain device geometry (defaulting to 64 heads, 32 sectors)
         (on hard disks, this is usually harmless.)

$ fdisk -l test.img
Disk test.img: 200 MiB, 209715200 bytes, 409600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x20ac7dda

Device     Boot      Start        End    Sectors   Size Id Type
test.img1       3224498923 3657370039  432871117 206.4G  7 HPFS/NTFS/exFAT
test.img2       3272020941 5225480974 1953460034 931.5G 16 Hidden FAT16
test.img3                0          0          0     0B 6f unknown
test.img4         50200576  974536369  924335794 440.8G  0 Empty

Partition table entries are not in disk order.

extlinux -i명령이 디스크 이미지에 새 파티션을 생성하는 이유를 이해할 수 없습니다 . 일부 파일 시스템 메타데이터를 수정하는 것일 수도 있지만 자세한 내용을 설명해 주시면 감사하겠습니다. 또한 파티션되지 않은 디스크 이미지에 Syslinux를 설치할 수 있습니까?

답변1

MBR 파티션 테이블은 디스크의 첫 번째 512바이트 블록 끝에 있는 매우 간단한 구조입니다. 여기에는 체크섬, 해시 또는 기타 오류 방지 기능이 포함되어 있지 않습니다.

생성한 파일 시스템/파티션 이미지에 대해 실행하면 fdisk -l첫 번째 블록(파티션 부트 레코드, 줄여서 PBR)을 MBR로 잘못 해석하게 됩니다. 시연한 것처럼 이로 인해 무의미한 출력이 발생합니다.

내 기억이 맞다면 에서 만든 PBR에는 다음이 extlinux포함됩니다.부팅 코드MBR의 실제 파티션 테이블이 차지하는 위치. PBR 부팅 코드 fdisk의 일부를 읽고 extlinux이를 MBR 콘텐츠로 표시하려고 시도하는 경우도 마찬가지입니다 . 출력이 의미가 없는 것은 당연합니다!

관련 정보