Your cart is currently empty!
How to Expand Ubuntu Disk After Hyper-V Virtual Disk Expansion
When you expand a Hyper-V virtual disk, Ubuntu doesn’t automatically use the new space. Here’s how to make Ubuntu recognize and use the additional storage.
Quick Overview
After expanding your Hyper-V virtual disk, you need to:
- Extend the partition
- Resize the LVM physical volume
- Extend the logical volume
- Resize the filesystem
Step-by-Step Process
1. Check Current Status
# Check current disk usage
df -h
# View partition layout
lsblk
2. Extend the Partition
# Use growpart to extend partition 3 (typically the main partition)
sudo growpart /dev/sda 3
3. Resize LVM Components
# Extend the physical volume
sudo pvresize /dev/sda3
# Extend the logical volume to use all free space
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv
# Resize the filesystem
sudo resize2fs /dev/ubuntu-vg/ubuntu-lv
4. Verify Success
# Check the new disk usage
df -h
What Each Command Does
growpart
: Expands the partition to use all available disk spacepvresize
: Makes LVM aware of the expanded partitionlvextend
: Extends the logical volume to use available spaceresize2fs
: Expands the ext4 filesystem to fill the logical volume
Important Notes
- All operations can be performed online (no reboot required)
- This process works with Ubuntu’s default LVM setup
- The filesystem expansion happens instantly with no data loss
- Always backup important data before disk operations
Result
Your Ubuntu system will now have access to all the additional storage space you allocated in Hyper-V, with the filesystem automatically expanded to use the new capacity.
by
Tags:
Leave a Reply