Page 1 of 1

wimapply with raw disk file (file.img)

Posted: Wed May 04, 2022 7:11 pm
by AnErrupTion
It would be nice if I could use wimapply directly on a raw disk image, instead of mounting it (which is actually a pain).

For example:

Code: Select all

wimapply install.wim 1 file.img
Right now, it's displaying this error:

Code: Select all

[ERROR] Failed to mount "file.img" with NTFS-3G: Invalid argument
ERROR: Exiting with error code 46:
       NTFS-3G encountered an error (check errno).
ERROR: errno: Invalid argument
The raw disk image has already been partitioned and formatted with NTFS:

Code: Select all

parted file.img mklabel msdos
parted file.img mkpart primary ntfs 2048s 100%

Re: wimapply with raw disk file (file.img)

Posted: Thu May 05, 2022 6:21 am
by synchronicity
The NTFS-3G image application mode actually works *only* on raw partitions, not on mounted filesystems. The commands you gave only partitioned the disk, and didn't create an NTFS filesystem on it. Are you sure that you created an NTFS filesystem on it? That would require using the mkntfs program from ntfsprogs.

Re: wimapply with raw disk file (file.img)

Posted: Thu May 05, 2022 5:36 pm
by AnErrupTion
Yes, I know it created the file system because GRUB successfully installed on the raw disk image.

Re: wimapply with raw disk file (file.img)

Posted: Thu May 19, 2022 3:54 pm
by chungy
You might want to use

Code: Select all

losetup -fP file.img
so that wimcapture can actually capture the partition itself rather than the whole disk (which includes the partition label)