resize gpt ext4 partitions

Dmitrijs Ledkovs dmitrij.ledkov at ubuntu.com
Wed May 1 23:54:16 UTC 2013


On 30 April 2013 23:34, DimanNe <dimanne at ya.ru> wrote:
> Is there any technique to resize gpt ext4 partition?
>
>
> The only one I found is something like this:
>
> 1 Run parted on your device: parted /dev/sdX
> 2 Change display unit to sectors: unit s
> 3 Print current partition table and note the start sector for your partition: p
> 4 Delete your partition (won't delete the data or filesystem): rm <number>
> 5 Recreate the partition with the starting sector from above: mkpart primary <start> <end>
> 6 Exit parted: quit
>
>
> Is it really exclusive way to accomplish it?
>

All resizing is done in essentially the same way:
* when shrinking, inside one first
* when enlarging, outside one first

So for a simple gpt partition with ext4 do one of the following:
* shrink ext4 fs with resizefs, then shrink the partition
* enlarge the partition, then enlarge the ext4 fs

parted is one of many tools to do the job, but make sure you don't end
up with fs beyond the block-device/partition end.

Regards,

Dmitrijs.




More information about the Ubuntu-devel-discuss mailing list