# Centos System Disk Partition help

**URL:** <https://forum.ansible.com/t/centos-system-disk-partition-help/36963>\
**Category:** Ansible Project\
**Tags:** azure\
**Created:** [August 8, 2022, 5:35pm UTC](https://forum.ansible.com/t/centos-system-disk-partition-help/36963 "2022-08-08T17:35:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nitrous](https://avatars.discourse-cdn.com/v4/letter/n/dfb087/32.png) [@Nitrous](https://forum.ansible.com/u/Nitrous)\
**Post date:** [August 8, 2022, 5:35pm UTC](https://forum.ansible.com/t/centos-system-disk-partition-help/36963/1 "2022-08-08T17:35:53Z")

</div>

Hey Guys, Ive just deployed a VM for Centos from Azure market place, but it seems like that the OS disk by default is 30GB, and I want to be able to use the whole partition.

This is what I am trying to achieve in ansible:

1: Delete the 30GB default partition  
2: Create a new partition with 100GB or more  
3: Extend the xfs

How can the above be achieved using ansible?

Thanks

---

<div class="post-metadata">

**Author:** ![Walter\_Rowe](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/walter_rowe/32/4506_2.png) [@Walter\_Rowe](https://forum.ansible.com/u/Walter_Rowe)\
**Post date:** [August 8, 2022, 7:31pm UTC](https://forum.ansible.com/t/centos-system-disk-partition-help/36963/2 "2022-08-08T19:31:41Z")

</div>

Some food for thought …

1. Why deploy CentOS? The Red Hat down stream product is end of existence in July 2024

2. Did you search for azure modules on the ansible website?

If you have code you want reviewed post it.

---

<div class="post-metadata">

**Author:** ![Nico\_Kadel-Garcia](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/nico_kadel-garcia/32/9998_2.png) [@Nico\_Kadel-Garcia](https://forum.ansible.com/u/Nico_Kadel-Garcia)\
**Post date:** [August 9, 2022, 5:42am UTC](https://forum.ansible.com/t/centos-system-disk-partition-help/36963/3 "2022-08-09T05:42:59Z")

</div>

> Some food for thought ...
> 
> Why deploy CentOS? The Red Hat down stream product is end of existence in July 2024
> 
> See [https://www.centos.org/centos-linux-eol/](https://www.centos.org/centos-linux-eol/)  
> See [https://blog.centos.org/2020/12/future-is-centos-stream/](https://blog.centos.org/2020/12/future-is-centos-stream/)

This is misleading. CentOS 8 Stream will continue to exist. CentOs 8  
Stream is not as reliable for \*anything\* s because it declines to  
publish point releases, the same stunt Red Hat pulled with Red Hat 9  
nearly 20 years ago, and reverted within a few years with RHEL 2.6 or  
so releases. It also uses the CentOS community as beta testers for new  
RHEL code, before it's been published in RHEL. This is a bit of a  
betrayal of CentOS original goals but was decided without input from  
the CentOS community, behind closed doors at Red Hat.

Kind of like the labeling of the ansible-core/ansible\_collections  
split, it's created a lot of unnecessary confusion and caused people  
to have to do various things backwards from the vendor published  
guideline. It's also lead to Karanbir Singh resigning from his  
leadership of CentOS, and the advent of AlmaLinux and RockyLinux to  
take CentOS's place as a reliable downstream rebuild of RHEL. It's not  
the first time, I remember Whitebox and Scientific Linux being similar  
rebulds. We'll see what happens in a few years.

> Did you search for azure modules on the ansible website?
> 
> [https://docs.ansible.com/ansible/2.9/modules/azure\_rm\_manageddisk\_module.html#azure-rm-manageddisk-module](https://docs.ansible.com/ansible/2.9/modules/azure_rm_manageddisk_module.html#azure-rm-manageddisk-module)  
> [https://docs.ansible.com/ansible/2.9/modules/azure\_rm\_virtualmachine\_module.html#azure-rm-virtualmachine-module](https://docs.ansible.com/ansible/2.9/modules/azure_rm_virtualmachine_module.html#azure-rm-virtualmachine-module)
> 
> If you have code you want reviewed post it.
> 
> > Hey Guys, Ive just deployed a VM for Centos from Azure market place, but it seems like that the OS disk by default is 30GB, and I want to be able to use the whole partition.

VM images don't contain disks. They contain partition tables, and file  
systems. Most Azure VMs come with more built-in disk, the partitions  
and filesystems merely need to be expanded to fill the remaining  
space.

> > This is what I am trying to achieve in ansible:
> > 
> > 1: Delete the 30GB default partition

That has the OS on it, live. Not likely to work witthout serious  
connivance. Try "expand partitions to occupy remaining space.

> > 2: Create a new partition with 100GB or more

Expand any LVM based physical volumes to use remaining space.  
Then expand any relevant LVM logical volumes to use that allocated  
physical volume.

> > 3: Extend the xfs

Yup, that's still needed.

> > How can the above be achieved using ansible?

Even if there's not a specific ansible module, it can be shell  
scripted to your particular needs.

---

<div class="post-metadata">

**Author:** ![Walter\_Rowe](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/walter_rowe/32/4506_2.png) [@Walter\_Rowe](https://forum.ansible.com/u/Walter_Rowe)\
**Post date:** [August 9, 2022, 11:54am UTC](https://forum.ansible.com/t/centos-system-disk-partition-help/36963/4 "2022-08-09T11:54:50Z")

</div>

CentOS as a downstream feed from Red Hat is dead.  
CentOS Stream is an upstream feed that sits between Fedora and Red Hat, and as such is not stable.  
AlmaLinux and Rocky Linux both want to be replacements for CentOS. The marketplace will choose.

For US Government installations, it none of this matters. FIPS validated encryption (with a FIPS certificate issued to the vendor) is a requirement (SSH, HTTPS, AD, SLDAP, etc). Only Red Hat and Ubuntu Pro provide that.
