[SOLVED] wimappend Error updating WIM header flags: Permission denied

Comments, questions, bug reports, etc.
Post Reply
m.radtke
Posts: 5
Joined: Fri Mar 11, 2016 8:34 am

[SOLVED] wimappend Error updating WIM header flags: Permission denied

Post by m.radtke »

Hi

I am currently tinkering a bit with wimapply and wimappend.

What I do is the following:
I boot up an ubunut based bootimage (20.04) with wimlib 1.13.1.
Then I mount an SMB share. Current options are

Code: Select all

rw,relatime,vers=3.1.1,cache=strict,username=USERNAME,domain=DOMAIN,uid=0,noforceuid,gid=0,noforcegid,addr=IP,file_mode=0755,dir_mode=0755,iocharset=utf8,soft,nounix,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1
At first I started applying an install.wim form this share to a preformatted disk with wimapply.
This works.

So then I wanted to capture the same disk with wimcapture/wimappend.
I can run wimcapture of disk /dev/sda2 on this SMB share to let's say install2.wim
Hoever I cannot run wimappend of the disk to the existing install.wim on this share.

Code: Select all

[ERROR] Error updating WIM header flags: Permission denied
ERROR: Exiting with error code 72:
       Failed to write data to a file.
the WIM_HDR_FLAG_READONLY is not set

Code: Select all

Flags                       = 0x40082
    WIM_HDR_FLAG_COMPRESSION is set
    WIM_HDR_FLAG_RP_FIX is set
    WIM_HDR_FLAG_COMPRESS_LZX is set
Chunk Size                  = 32768
On the SMB share these are the file permissions currently

Code: Select all

-rwxrwxrwx    1 USER GROUP 4,6G Nov  5 09:31 install.wim
What can I do to successfully run wimappend?

Regards
Last edited by m.radtke on Tue Mar 12, 2024 2:34 pm, edited 1 time in total.
synchronicity
Site Admin
Posts: 472
Joined: Sun Aug 02, 2015 10:31 pm

Re: wimappend Error updating WIM header flags: Permission denied

Post by synchronicity »

Well, you need write access to the file. I'm not sure why it isn't working for you given that you've made the file mode 0777, but this isn't wimlib-imagex's problem. Can you check the options you are using for the file share, and test whether you can write to other files?
m.radtke
Posts: 5
Joined: Fri Mar 11, 2016 8:34 am

Re: wimappend Error updating WIM header flags: Permission denied

Post by m.radtke »

Hi

I can write a new wim file on this share without a problem with wimcapture. wimappend fails with the given error when I try to append an image. Even an append in the newly created wim with wimcapture fails with the same error.

Regards
mtniehaus
Posts: 2
Joined: Fri Jun 09, 2023 1:20 am

Re: wimappend Error updating WIM header flags: Permission denied

Post by mtniehaus »

I can see the same thing capturing from Linux (Fedora 37 using 1.14.1) to a Windows SMB share. Best I can tell, it is specific to using an SMB destination.

Error updating WIM header flags: Permission denied
Exiting with error code 72: Failed to write data to a file.

The user has rights; it's the same user that created the file originally, now trying to append a new image to the existing file. Creating a new file always works.
mtniehaus
Posts: 2
Joined: Fri Jun 09, 2023 1:20 am

Re: wimappend Error updating WIM header flags: Permission denied

Post by mtniehaus »

Figured it out: It will work if you mount the CIFS share using "nobrl" (no byte range locks). With that added, I was able to append a second image to an existing WIM file on the CIFS (Windows) share.

My mount command (from a node.js script):

cmd = `mount -t cifs -o username="${user}",password='${settings.CapturePassword}',workgroup="${workgroup}",noperm,nobrl ${share} /mnt/cifs`;
m.radtke
Posts: 5
Joined: Fri Mar 11, 2016 8:34 am

Re: wimappend Error updating WIM header flags: Permission denied

Post by m.radtke »

Hi,

I can confirm this works with the wimappend command.
Thanks for finding this one out

Regards
Mathias
Post Reply