# ansible module to partition and format disk

**URL:** <https://forum.ansible.com/t/ansible-module-to-partition-and-format-disk/17310>\
**Category:** Ansible Project\
**Created:** [January 19, 2015, 11:02am UTC](https://forum.ansible.com/t/ansible-module-to-partition-and-format-disk/17310 "2015-01-19T11:02:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hce](https://avatars.discourse-cdn.com/v4/letter/h/c0e974/32.png) [@hce](https://forum.ansible.com/u/hce)\
**Post date:** [January 19, 2015, 11:02am UTC](https://forum.ansible.com/t/ansible-module-to-partition-and-format-disk/17310/1 "2015-01-19T11:02:47Z")

</div>

Hi,

What are the ansible modules to partition and format (mkfs.ext4) disks?

Thank you.

- j

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 19, 2015, 3:43pm UTC](https://forum.ansible.com/t/ansible-module-to-partition-and-format-disk/17310/2 "2015-01-19T15:43:37Z")

</div>

i think you want the filesystem module

[http://docs.ansible.com/filesystem\_module.html](http://docs.ansible.com/filesystem_module.html)

---

<div class="post-metadata">

**Author:** ![hce](https://avatars.discourse-cdn.com/v4/letter/h/c0e974/32.png) [@hce](https://forum.ansible.com/u/hce)\
**Post date:** [January 19, 2015, 11:40pm UTC](https://forum.ansible.com/t/ansible-module-to-partition-and-format-disk/17310/3 "2015-01-19T23:40:44Z")

</div>

Thanks Brian, but I also want to partition the disk, the filesystem\_module doesn’t seem able to do the partition, collect me if I am wrong.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [January 19, 2015, 11:57pm UTC](https://forum.ansible.com/t/ansible-module-to-partition-and-format-disk/17310/4 "2015-01-19T23:57:20Z")

</div>

no, it can just create filesystems. There are modules for lvm but  
nothing for creating partitions from scratch (yet).

---

<div class="post-metadata">

**Author:** ![Fabrizio\_Colonna](https://avatars.discourse-cdn.com/v4/letter/f/aca169/32.png) [@Fabrizio\_Colonna](https://forum.ansible.com/u/Fabrizio_Colonna)\
**Post date:** [November 14, 2016, 1:28pm UTC](https://forum.ansible.com/t/ansible-module-to-partition-and-format-disk/17310/5 "2016-11-14T13:28:02Z")

</div>

For you if you still need it and for new people that will land here, there is this parted module for Ansible awaiting pull request that does what you need: [https://github.com/ansible/ansible-modules-extras/pull/2971](https://github.com/ansible/ansible-modules-extras/pull/2971)
