# Installation do not use whole of disk

**URL:** <https://forums.rockylinux.org/t/installation-do-not-use-whole-of-disk/16732>\
**Category:** Rocky Linux Help & Support\
**Created:** [December 4, 2024, 10:52am UTC](https://forums.rockylinux.org/t/installation-do-not-use-whole-of-disk/16732 "2024-12-04T10:52:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mostafa](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@mostafa](https://forums.rockylinux.org/u/mostafa)\
**Post date:** [December 4, 2024, 10:52am UTC](https://forums.rockylinux.org/t/installation-do-not-use-whole-of-disk/16732/1 "2024-12-04T10:52:17Z")

</div>

from one of the cloud provider I by cloud server, during create this cloud server I choose rocky linux 9.3 as OS, for size of SSD disk I choose 240 GB and 32GB RAM and 16 Core CPU, after creation, I login to this server and run df -h and see

```auto
 df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 4.0M 0 4.0M 0% /dev
tmpfs 16G 0 16G 0% /dev/shm
tmpfs 6.3G 17M 6.3G 1% /run
efivarfs 256K 28K 223K 12% /sys/firmware/efi/efivars
/dev/mapper/rl-root 13G 1.9G 11G 15% /
/dev/sda2 960M 273M 688M 29% /boot
/dev/sda1 599M 7.1M 592M 2% /boot/efi
tmpfs 3.2G 0 3.2G 0% /run/user/0
tmpfs 3.2G 0 3.2G 0% /run/user/1000

```

and I see whole of disk does not use  
when I run this commnad

```auto
sudo fdisk -l

```

I see

```auto

 sudo fdisk -l
[sudo] password for admin: 
GPT PMBR size mismatch (33554431 != 503316480) will be corrected by write.
Disk /dev/sda: 240 GiB, 257698038272 bytes, 503316481 sectors
Disk model: Virtual disk    
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: B133D9B5-CF8F-4786-BE67-B0734B59F71D

Device Start End Sectors Size Type
/dev/sda1 2048 1230847 1228800 600M EFI System
/dev/sda2 1230848 3327999 2097152 1G Linux filesystem
/dev/sda3 3328000 33552383 30224384 14.4G Linux LVM

Disk /dev/mapper/rl-root: 12.81 GiB, 13753122816 bytes, 26861568 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mapper/rl-swap: 1.6 GiB, 1719664640 bytes, 3358720 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

```

and I see

```auto
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 240G 0 disk 
├─sda1 8:1 0 600M 0 part /boot/efi
├─sda2 8:2 0 1G 0 part /boot
└─sda3 8:3 0 14.4G 0 part 
  ├─rl-root 253:0 0 12.8G 0 lvm /
  └─rl-swap 253:1 0 1.6G 0 lvm [SWAP]
sr0 11:0 1 1024M 0 rom  

```

How I can resize the disk and use whole of disk?

---

<div class="post-metadata">

**Author:** ![hs303](https://avatars.discourse-cdn.com/v4/letter/h/e47774/32.png) [@hs303](https://forums.rockylinux.org/u/hs303)\
**Post date:** [December 4, 2024, 4:54pm UTC](https://forums.rockylinux.org/t/installation-do-not-use-whole-of-disk/16732/2 "2024-12-04T16:54:07Z")

</div>

Basically you can expand it with those three commands (adjust the size with the `-L` argument):

1. `growpart /dev/sda 3`
2. `lvextend -L +60G /dev/mapper/rl-root`
3. `xfs_growfs /`

You can check out this topic for more info and context:

> [@Azure vm image disk size issues](https://forums.rockylinux.org/t/azure-vm-image-disk-size-issues/15803):
>
> Using the latest rockylinux-x86\_64 9-lvm image from the Azure marketplace spun up a vm with the OS disk size at 8.9 GB. It seems most of the space is residing on another disk though the Azure vm only has one 128 GB disk. How can I extend the /dev/rocky/root logical volume to use this space in the root mountpoint? Here’s what I’m looking at: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS sda 8:0 0 128G 0 disk ├─sda1 8:1 0 99M 0 part /boot/efi ├─sda2 …

Expanding the disk always comes with little risk, so the best practice is to make a backup before expanding.  
You can also consider expanding the root by only the amount you need for it. `LVM` gives you the possibility to create more partitions and expand every partion independently. `xfs` cannot be shrunk, so if you take all the space for `/` now, you won’t be able to create another partition at some point in the future.

---

<div class="post-metadata">

**Author:** ![mostafa](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@mostafa](https://forums.rockylinux.org/u/mostafa)\
**Post date:** [December 5, 2024, 8:07am UTC](https://forums.rockylinux.org/t/installation-do-not-use-whole-of-disk/16732/3 "2024-12-05T08:07:24Z")

</div>

Thank you save my life.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/1X/91b7219eec10e30013422e4df76c1d898711a5d5.svg) [@system](https://forums.rockylinux.org/u/system)\
**Post date:** [February 3, 2025, 8:08am UTC](https://forums.rockylinux.org/t/installation-do-not-use-whole-of-disk/16732/4 "2025-02-03T08:08:10Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
