# Expnanding HD by 100GB

**URL:** <https://forums.rockylinux.org/t/expnanding-hd-by-100gb/12138>\
**Category:** Rocky Linux Help & Support\
**Tags:** rocky-linux-8\
**Created:** [December 12, 2023, 11:17pm UTC](https://forums.rockylinux.org/t/expnanding-hd-by-100gb/12138 "2023-12-12T23:17:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![userman76](https://avatars.discourse-cdn.com/v4/letter/u/e0b2c6/32.png) [@userman76](https://forums.rockylinux.org/u/userman76)\
**Post date:** [December 12, 2023, 11:17pm UTC](https://forums.rockylinux.org/t/expnanding-hd-by-100gb/12138/1 "2023-12-12T23:17:51Z")

</div>

I recently expanded my HD by +200GB instead of +100GB by accident. I booted up my machine, and went to use parted to expand by 100GB with `resize`, but it failed:  
`(parted) resize 2 100GB Error: The resize command has been removed in parted 3.0`  
I see there is growpart, but I don’t want to use the full 200GB, only an extra 100GB. How can I do this?  
fdisk -l:

```auto
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 2099199 2097152 1G 83 Linux
/dev/sda2 2099200 419430399 417331200 199G 8e Linux LVM

```

---

<div class="post-metadata">

**Author:** ![iwalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/iwalker/32/2599_2.png) [@iwalker](https://forums.rockylinux.org/u/iwalker)\
**Post date:** [December 13, 2023, 8:31am UTC](https://forums.rockylinux.org/t/expnanding-hd-by-100gb/12138/2 "2023-12-13T08:31:32Z")

</div>

Using, eg:

```auto
growpart -h

```

an example is given of:

```auto
    - growpart --free-percent=10 /dev/sda 1
      Resize partition 1 on /dev/sda so that 10% of the disk is unallocated

```

if you have 200GB free and want to use 100GB, then your free percentage would be 50. So:

```auto
growpart --free-percent=50 /dev/sda 2

```

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [December 13, 2023, 11:26am UTC](https://forums.rockylinux.org/t/expnanding-hd-by-100gb/12138/3 "2023-12-13T11:26:24Z")

</div>

The `lsblk` shows data in useful way too.

You have two partitions and the second is a LVM PV. There are more than one way to proceed.

- One could add a third partition, initialize it as PV, add to the VG, and expand LV(s) as necessary
- One could remove partition 2 and create it again (same start and type, correct size). Then pvresize and expand LV(s)
- One could use that growpart. Then expand LV(s)
- One could add a third partition, initialize filesystem to it, and mount it where needed
- One could “shrink the HDD” by 100GB and then growpart?

What is growpart?

```plaintext
$ dnf provides *bin/growpart
cloud-utils-growpart-0.33-1.el9.x86_64 : Script for growing a partition
Repo : appstream
Matched from:
Other : *bin/growpart

$ dnf info cloud-utils-growpart | grep -A5 Description
Description : This package provides the growpart script for growing a partition. It is
             : primarily used in cloud images in conjunction with the dracut-modules-growroot
             : package to grow the root partition on first boot.

```

Apparently a script that calls sfdisk or sgdisk (and pvresize) to manipulate partition table (and PV).

```auto
        if [-n "${free_percent}"]; then
                free_percent_sectors=$((sector_num/100*free_percent))
                ...

```

If the disk is now 400GB, then free\_percent should be `25` in order to leave 100GB free?

---

<div class="post-metadata">

**Author:** ![userman76](https://avatars.discourse-cdn.com/v4/letter/u/e0b2c6/32.png) [@userman76](https://forums.rockylinux.org/u/userman76)\
**Post date:** [December 13, 2023, 12:53pm UTC](https://forums.rockylinux.org/t/expnanding-hd-by-100gb/12138/4 "2023-12-13T12:53:03Z")

</div>

I get this error message:  
`NOCHANGE: partition 2 could not be grown while leaving 50% (419430400 sectors) free on device `

---

<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 11, 2024, 12:53pm UTC](https://forums.rockylinux.org/t/expnanding-hd-by-100gb/12138/5 "2024-02-11T12:53:47Z")

</div>

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