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

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

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나는 그것을 옵션 offset으로 건너뛰고 mount그것에 의존할 것입니다 losetup.

util-linuxs를 사용하면 losetup파티셔닝을 사용할 수 있습니다.

losetup -P -f --show image_file_name.img

설치에 사용된 루프 장치의 이름이 표시됩니다.

mount /dev/loop0p1 /tmp/abc

그러나 교체 loop0(아니요 p1) 적절한. 다른 파티션은 p2등을 사용하여 액세스 할 수 있습니다.

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

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

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

mount /dev/loop0 /tmp/abc

파일 시스템이 마운트 해제된 경우 릴리스 루프 장치도 사용해야 합니다 losetup -d.

관련 정보