이미지 파일을 마운트할 수 없습니다.

이미지 파일을 마운트할 수 없습니다.

image_file_name.img여러 파티션이 있는 디렉토리를 마운트하려고 하지만 성공하지 못했습니다.

파티션 세부정보:

sfdisk -l -uS image_file_name.img 
Disk image_file_name.img: cannot get geometry

Disk image_file_name.img: 11 cylinders, 255 heads, 63 sectors/track
Warning: The partition table looks like it was made
  for C/H/S=*/4/63 (instead of 11/255/63).
For this listing I'll assume that geometry.
Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
image_file_name.img1           252       503        252  83  Linux
image_file_name.img2           504    177407     176904  83  Linux
image_file_name.img3             0         -          0   0  Empty
image_file_name.img4             0         -          0   0  Empty


다음 mount명령을 실행하고 있습니다.

mount -o offset=$((252*512)) image_file_name.img /tmp/abc/

에러 메시지:

mount: mounting /dev/loop0 on /tmp/abc/ failed: Invalid argument

해당 오류는 다음과 dmesg같습니다.

[106359.764567] NTFS-fs error (device loop0): parse_options(): Unrecognized mount option offset.

이는 kpartx.

도움을 주시면 감사하겠습니다.

답변1

에 표시되는 오류를 고려하면 옵션 으로 건너 뛰고 대신 사용 dmesg하겠습니다 .offsetmountlosetup

util-linux'를 사용하면 losetup파티션 처리를 사용할 수 있습니다.

losetup -P -f --show image_file_name.img

사용된 루프 장치의 이름이 표시됩니다. 이를 사용하여 마운트하고

mount /dev/loop0p1 /tmp/abc

하지만 대체 loop0(~ 아니다 p1) 적절한. 다른 파티션은 p2등을 사용하여 액세스할 수 있습니다.

busybox's 를 사용하면 losetup오프셋을 직접 지정해야 합니다.

losetup -o $((252*512)) -f image_file_name.img

그런 다음 루프 장치를 직접 마운트하고,예를 들어

mount /dev/loop0 /tmp/abc

파일 시스템을 마운트 해제하는 경우 를 사용하여 루프 장치도 확보해야 합니다 losetup -d.

관련 정보