Select Your Language

Infrastructure and Management

Cloud Computing

Storage

Runtimes

Integration and Automation

  • Comments
  • Issues Growing Root Disk

    Posted on

    I'd generated a standard RHEL 6 AMI for use by my organization (our IA requirements mean that LVM on AWS/EBS is mandatory). I've had a couple of customers who complained "the root disk's partitioning is too small and when we allocate extra disk space to it in the cloud console, the extra space goes unused". Wasn't a use-case I was anticipating, but figured "I'll take a stab at sorting it out." I ended up updating the

    initramfs
    scripts that handle doing the resizing of the partition hosting
    /
    . The hacked
    initramfs
    pre-mount script sorta works -
    sfdisk
    sees the extended partition:

    # sfdisk -l -uM /dev/xvda 
    
        Disk /dev/xvda: 3263 cylinders, 255 heads, 63 sectors/track
        Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0
    
           Device Boot Start   End    MiB    #blocks   Id  System
        /dev/xvda1         1    476    476     487424   83  Linux
        /dev/xvda2       477  25595- 25119-  25721599+  8e  Linux LVM
        /dev/xvda3         0      -      0          0    0  Empty
        /dev/xvda4         0      -      0          0    0  Empty
    

    However, the sizes seen by

    lsblk
    (and, apparently by extension,
    pvresize
    ), still shows the old size-value for /dev/xvda2:

        NAME                            MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
        xvda                            202:0    0   25G  0 disk
        ├─xvda1                         202:1    0  476M  0 part /boot
        └─xvda2                         202:2    0 19.5G  0 part
          ├─VolGroup00-rootVol (dm-0)   253:0    0    4G  0 lvm  /
          ├─VolGroup00-swapVol (dm-1)   253:1    0    2G  0 lvm
          ├─VolGroup00-homeVol (dm-12)  253:12   0    1G  0 lvm  /home
          ├─VolGroup00-varVol (dm-13)   253:13   0    2G  0 lvm  /var
          ├─VolGroup00-logVol (dm-14)   253:14   0    2G  0 lvm  /var/log
          └─VolGroup00-auditVol (dm-15) 253:15   0  8.5G  0 lvm  /var/log/audit
    

    Any ideas on how I get the run-time OS's higher-level storage tools to see the extra space that

    sfdisk
    /
    fdisk
    see?

    by

    points

    Responses

    Red Hat LinkedIn YouTube Facebook X, formerly Twitter

    Quick Links

    Help

    Site Info

    Related Sites

    © 2026 Red Hat