# Raw-disk-image-shrink-rootfs failing on MacOs using docker

**URL:** <https://hub.mender.io/t/raw-disk-image-shrink-rootfs-failing-on-macos-using-docker/525>\
**Category:** General Discussions\
**Created:** [May 4, 2019, 11:25pm UTC](https://hub.mender.io/t/raw-disk-image-shrink-rootfs-failing-on-macos-using-docker/525 "2019-05-04T23:25:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chetferry](https://avatars.discourse-cdn.com/v4/letter/c/c2a13f/32.png) [@chetferry](https://hub.mender.io/u/chetferry)\
**Post date:** [May 4, 2019, 11:25pm UTC](https://hub.mender.io/t/raw-disk-image-shrink-rootfs-failing-on-macos-using-docker/525/1 "2019-05-04T23:25:32Z")

</div>

I am attempting to shrink the size of a golden .img file so it will fit on my beaglebone green wireless 4GB EMMc after using mender-convert. My OS is MacOs version 10.14.4. I am using Docker community edition version 2.0.0.3. I have pasted in the terminal session below. The .img file is the same size after it runs. I am assuming the warnings are telling me that the process if failing. Any help would be greatly appreciated.

sudo ./docker-mender-convert raw-disk-image-shrink-rootfs --raw-disk-image “golden-May4.img”  
Running mender-convert raw-disk-image-shrink-rootfs --raw-disk-image golden-May4.img  
\*\*\* Data partition size set to default value: 128MB \*\*\*  
\*\*\* Total storage size set to default value: 8GB \*\*\*  
1/1 Shrinking raw disk image root filesystem…  
dumpe2fs 1.44.1 (24-Mar-2018)  
resize2fs 1.44.1 (24-Mar-2018)  
Root filesystem size:  
minimal: 2274193408  
aligned: 2281701376  
sectors: 4456448  
Warning: Unable to open /dev/sr2 read-write (Read-only file system). /dev/sr2 has been opened read-only.  
Warning: Unable to open /dev/sr2 read-write (Read-only file system). /dev/sr2 has been opened read-only.  
Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only.  
Warning: Unable to open /dev/sr0 read-write (Read-only file system). /dev/sr0 has been opened read-only.  
Warning: Unable to open /dev/sr1 read-write (Read-only file system). /dev/sr1 has been opened read-only.  
Warning: Unable to open /dev/sr1 read-write (Read-only file system). /dev/sr1 has been opened read-only.  
Raw disk image new endsector: 4449975  
New root filesystem size (sectors): 4456448  
The rootfs partition in the raw disk image has been shrinked successfully!  
You can now convert the output raw disk image  
/mender-convert/golden-May4.img  
to a Mender disk image.

---

<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:** [May 6, 2019, 6:57am UTC](https://hub.mender.io/t/raw-disk-image-shrink-rootfs-failing-on-macos-using-docker/525/2 "2019-05-06T06:57:05Z")

</div>

hi @chetferry,

First of all we do not run much tests on this tool using MacOs, and there might be some gotchas.

But to shrink the image further you must also specific `--storage-total-size-mb 4096` along with the `raw-disk-image-shrink-rootfs` command, and essentially all your calls to `mender-convert` should have the `--storage-total-size-mb 4096` argument.

Please feel free to post output of `fdisk -l <path to disk>` before and after you attempt to shrink with the mentioned arguments.
