Solved Fedora Block Device Full How - Extend Partition
-
Ok asking the experts here, I have a VM that an long-gone intern setup with a tiny partition, only 49GB, and I need to extend it.
Here is what I have.
How can I extend /dev/fedora/root to take all of /dev/xvda ?
-
I see you are using LVM (that's good!), so…
- First, create a new block device in the free space;
- PVadd the new block device to your VG (fedora, I think);
- lvextend your root LV;
- xfs_growfs your root FS, and you'll be done ;).
-
Of course, you can incrementally add multiple virtual disks to the VM, adding it as PV to your VG etc…
-
@Francesco-Provino OK give me a moment, working to create the block device.
-
pvcreate /dev/newpartition vgextend fedora /dev/newpartition lvextend -l 100%FREE /dev/fedora/root /dev/newpartition
I don't know the command to expand an ext4 file system off the top of my head
-
-
Is /dev/xvda2 mounted somewhere?
-
@DustinB3403 If you're sure that /dev/xvda2 is not being used by something else, try the pvcreate with -ff. It should force the command to complete.
-
@travisdh1 said in Fedora Block Device Full How - Extend Partition:
pvcreate /dev/newpartition vgextend fedora /dev/newpartition lvextend -l 100%FREE /dev/fedora/root /dev/newpartition
I don't know the command to expand an ext4 file system off the top of my head
His root is XFS, so xfs_grows should do the trick.
-
The system is saying that xvda2 is mounted.
Yet I have no idea how it's mounted.
-
@DustinB3403 said in Fedora Block Device Full How - Extend Partition:
The system is saying that xvda2 is mounted.
Yet I have no idea how it's mounted.
df -h
-
@DustinB3403 said in Fedora Block Device Full How - Extend Partition:
The system is saying that xvda2 is mounted.
Yet I have no idea how it's mounted.
So, just grep /etc/mtab for xvda2.
-
-
@DustinB3403 said in Fedora Block Device Full How - Extend Partition:
So, I think you can safely force the pvcreate.
-
@Francesco-Provino when I try for force pvcreate using
pvcreate /dev/xdva2 -ff
it results in -
Oh, xvda2 is your root filesystem. What's the output of
fdisk -l
? It looks like it should be xvda3xvda1 is the boot partition.
-
-
Did you create a partition for the free space? You need to use fdisk to make a third primary partition.
-
@stacksofplates ok, following this here.
-
Dumb question, would it be easier for me to simply add a separate drive, and then extend the root drive into the new drive?