# How to extract the mender artifact content

**URL:** <https://hub.mender.io/t/how-to-extract-the-mender-artifact-content/2678>\
**Category:** General Discussions\
**Created:** [October 15, 2020, 8:08pm UTC](https://hub.mender.io/t/how-to-extract-the-mender-artifact-content/2678 "2020-10-15T20:08:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rcernea](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@rcernea](https://hub.mender.io/u/rcernea)\
**Post date:** [October 15, 2020, 8:08pm UTC](https://hub.mender.io/t/how-to-extract-the-mender-artifact-content/2678/1 "2020-10-15T20:08:25Z")

</div>

I have a .mender file and I want to extract the content. I tried “mender-artifact dump artifact\_name.mender”, but nothing gets extracted. I also tried “mender-artifact cp” with no success. See blow some (slightly obfuscated) commands.

“mender-artifact read artifact\_name.mender” will display the content, as I expected. I am running mender-artifact version 3.3.0.

$ mender-artifact read image-board-20201013213940.mender  
Mender artifact:  
Name: mcg-01.00.001\_d  
Format: mender  
Version: 3  
Signature: no signature  
Compatible devices: ‘[board]’  
Provides group:  
Depends on one of artifact(s):   
Depends on one of group(s):   
State scripts:  
ArtifactCommit\_Leave\_80  
ArtifactFailure\_Leave\_80  
…

Updates:  
0:  
Type: rootfs-image  
Provides: Nothing  
Depends: Nothing  
Metadata: Nothing  
Files:  
name: image-board.ext4  
size: 5687476224  
modified: 2020-10-13 17:42:34 -0400 EDT  
checksum:

$ mender-artifact cp image-board-20201013213940.mender:image-board.ext4 file.ext4  
The file: image-board.ext4 does not exist in the image

Thank you for your help,  
Radu

---

<div class="post-metadata">

**Author:** ![dellgreen](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/dellgreen/32/85_2.png) [@dellgreen](https://hub.mender.io/u/dellgreen)\
**Post date:** [October 15, 2020, 8:53pm UTC](https://hub.mender.io/t/how-to-extract-the-mender-artifact-content/2678/2 "2020-10-15T20:53:42Z")

</div>

I believe the mender file is just a tar file if you just need to get at the contents

---

<div class="post-metadata">

**Author:** ![rcernea](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@rcernea](https://hub.mender.io/u/rcernea)\
**Post date:** [October 15, 2020, 9:10pm UTC](https://hub.mender.io/t/how-to-extract-the-mender-artifact-content/2678/3 "2020-10-15T21:10:52Z")

</div>

tar works!

---

<div class="post-metadata">

**Author:** ![mirzak](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/mirzak/32/2056_2.png) [@mirzak](https://hub.mender.io/u/mirzak)\
**Post date:** [October 16, 2020, 6:11am UTC](https://hub.mender.io/t/how-to-extract-the-mender-artifact-content/2678/4 "2020-10-16T06:11:51Z")

</div>

Yeah, `tar` should work.

But the `mender-artifact dump` command can also be useful, but you need to specify what you want to extract,

Example to extract payload files:

```auto
mkdir files
mender-artifact dump --files files *.mender

```

Check the `--help` for additional arguments,

```auto
$ mender-artifact dump --help
NAME:
   mender-artifact dump - Dump contents from Artifacts

USAGE:
   mender-artifact dump [command options] <Artifact>

DESCRIPTION:
   Dump various raw files from the Artifact. These can be used to create a new Artifact with the same components.

OPTIONS:
   --files value Dump all included files in the first payload into given folder
   --meta-data value Dump the contents of the meta-data field in the first payload into given folder
   --scripts value Dump all included state scripts into given folder
   --print-cmdline Print the command line that can recreate the same Artifact with the components being dumped. If all the components are being dumped, a nearly identical Artifact can be created. Note that timestamps will cause the checksum of the Artifact to be different, and signatures can not be recreated this way. The command line will only use long option names.

```
