Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Extend linux partition

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
banderas20
Posts: 111
Joined: 2016-11-10 15:30

Extend linux partition

#1 Post by banderas20 »

Hello all,

i have the following partitions and sizes:

Code: Select all

/dev/sda1 (20GB) Linux
/dev/sda2 (1GB) extended
/dev/sda5 (1GB) Swap
I have upgraded my virtual disk, so now /dev/sda has 30GB. The additional 10GB are unassigned and I want them to be an extension to /dev/sda1. The partitions are already one after another...

¿How can I achieve this?

Thanks!

arzgi
Posts: 1194
Joined: 2008-02-21 17:03
Location: Finland
Been thanked: 31 times

Re: Extend linux partition

#2 Post by arzgi »

parted/gparted

peer
Posts: 449
Joined: 2017-03-26 10:14
Has thanked: 8 times
Been thanked: 22 times

Re: Extend linux partition

#3 Post by peer »

You cannot change the size of a harddisk when you are using it
so use a live cd with gparted
https://gparted.org/

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Extend linux partition

#4 Post by p.H »

I do not think that the OP's request has anything to do with changing the size of a disk while in use. The disk has already been extended.

The OP has several options.

1) Use Gparted on a live system to move the extended partition and the swap and extend the root partition.

2) From the installed system, disable the swap with "swapoff -a" and use Gparted as above. An ext4 partition in use can be extended online.

3) From the installed system, disable the swap as above, and use your favourite partitioning tool to delete the swap partition and the extented partition, extend the root partition and its filesystem, create a new swap partition and format it with mkswap -U same-uuid-as-before-in-fstab.

Final note : the use of LVM instead of plain partitions would have made this much easier. No need to move logical volumes around to extend another volume.

Post Reply