You are not logged in.

#1 2012-10-28 17:31:37

goodboy
Member
Registered: 2007-02-23
Posts: 21

[SOLVED] How do I increase the size of an existing GPT ext4 partition?

I found some advice here
http://ubuntuforums.org/showthread.php?t=1389429

but I'm not sure whether the information is correct

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
7 Check the filesystem: sudo e2fsck -f /dev/sdXX
8 Resize filesystem: sudo resize2fs /dev/sdXX

I'd like to increase partition #2 from 200 Gig to 300 Gig using gnu parted.

(parted) p                                                               
Modell: ATA WDC WD15EARX-00Z (scsi)
Festplatte  /dev/sda:  1500GB
Sektorgröße (logisch/physisch): 512B/4096B
Partitionstabelle: gpt
Disk Flags:

Nummer  Anfang     Ende        Größe       Dateisystem  Name              Flags
1      2048s      25167871s   25165824s   ext4         Linux filesystem
2      25167872s  444598271s  419430400s  ext4

or with unit set to GiB:

Nummer  Anfang   Ende     Größe    Dateisystem  Name              Flags
1      0,00GiB  12,0GiB  12,0GiB  ext4         Linux filesystem
2      12,0GiB  212GiB   200GiB   ext4


What is the correct way for doing this?

Last edited by goodboy (2012-10-28 18:33:43)

Offline

#2 2012-10-28 17:40:50

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [SOLVED] How do I increase the size of an existing GPT ext4 partition?

https://wiki.archlinux.org/index.php/Fo … s_and_Code

Please prepend LC_ALL=C to posted commands so that the output will be in English.


Just drag the sliders around in gparted.

# pacman -S gparted
# gparted

And don't forget to mark the topic as solved (by editing the first post) so that other people (including yourself sometimes) may find useful.


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#3 2012-10-28 17:47:47

goodboy
Member
Registered: 2007-02-23
Posts: 21

Re: [SOLVED] How do I increase the size of an existing GPT ext4 partition?

GNU Parted 3.1

Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
Model: ATA WDC WD15EARX-00Z (scsi)
Disk /dev/sda: 1500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name              Flags
 1      1049kB  12.9GB  12.9GB  ext4         Linux filesystem
 2      12.9GB  228GB   215GB   ext4

done!

No, I'm not using gparted but "gnu parted", the command line tool, as I already mentioned above. From what I understood so far, gparted doesn't handle GPT** disks at all.

**What I meant and should have said: resizing of ext4 partitions:

Last edited by goodboy (2012-10-28 18:11:19)

Offline

#4 2012-10-28 18:05:25

2ManyDogs
Member
Registered: 2012-01-15
Posts: 1,635

Re: [SOLVED] How do I increase the size of an existing GPT ext4 partition?

goodboy wrote:

No, I'm not using gparted but "gnu parted", the command line tool, as I already mentioned above. From what I understood so far, gparted doesn't handle GPT** disks at all.

From the wiki gparted topic:

GParted is a GTK+ frontend to GNU Parted and the official GNOME Partition Editor application.

I think gparted can do anything gnu parted can do. The warning about ext4 in the topic you linked is from 2009, and recommends using gparted with a version higher than 0.6.2-2. Gparted 0.14.0-1 is currently in the Arch repo, so I think it's probably safe.

Last edited by 2ManyDogs (2012-10-28 18:29:03)

Offline

#5 2012-10-28 18:30:48

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,423
Website

Re: [SOLVED] How do I increase the size of an existing GPT ext4 partition?

If you have the space, I recommend that you back up the data (`rsync -avxP /path/to/target/ /path/to/backup_spot/`), manually nuke the partition(s) to be combined, and finally manually repartition the disk.  Gparted/parted is nice, but sometimes, the resize operation can take a LONG time.  You do NOT want to experience a power loss during it either.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#6 2012-10-28 18:33:02

goodboy
Member
Registered: 2007-02-23
Posts: 21

Re: [SOLVED] How do I increase the size of an existing GPT ext4 partition?

Yep, works flawlessly. I've been worrying to much about partition alignment and stuff. Thanks.

Offline

Board footer

Powered by FluxBB