Modify Your Partitions With GParted Without Losing Data

Version 1.0
Author: Falko Timme

This article shows how you can modify the partitioning of your Linux system with GParted (Gnome Partition Editor) without losing data. This includes resizing partitions (enlarging and shrinking), moving partitions on the hard drive, creating and deleting partitions, and even modifying filesystem types. GParted is a free partition editor available as a desktop program and also as a Live-CD. It supports the following filesystems: ext2, ext3, fat16, fat32, hfs, hfs+, jfs, linux-swap, reiserfs, reiser4, ufs, xfs, and even ntfs (Windows).

A full list of supported operations is available here: http://gparted.sourceforge.net/features.php

I do not issue any guarantee that this will work for you!

 

1 Preliminary Note

As partitions must be unmounted in order to be modified, I think it's a good idea to use the GParted Live-CD instead of using the desktop application. Therefore I have downloaded the latest GParted Live-CD (0.3.3 at the time of this writing) from here: http://sourceforge.net/project/showfiles.php?group_id=115843&package_id=173828 and burnt it onto a CD.

Obviously this method doesn't work for remote systems to which you don't have physical access, but for such a case this tutorial might be interesting for you: How To Resize ext3 Partitions Without Losing Data

It is very important that you back up all your data before you modify your partitions with GParted. If all goes well, no data should be lost, but you can never know!

In the following I will perform some operations just to show you how GParted works and what it can do. I don't say that all these operations make sense on a production system, but for demonstration purposes they are ok.

 

2 Working With GParted

Shut down your Linux system and make it boot from the GParted Live-CD. Hit ENTER at the boot prompt and choose your language and keymap later on in the boot process. It will also ask you for your preferred screen resolution. Afterwards the GParted desktop should come up:

The GParted application will start automatically and show you the current partitions (including their filesystem types) on the hard disk(s):

In the next step I want to shrink /dev/hda1, so I mark it and click on Resize/Move. The following window pops up:

Click on the right black arrow and drag it until the partition has its new (desired) size, then click on the Resize/Move button:

As you see, /dev/hda1 has been shrinked, and the new, free space is unallocated:

To create a new partition on the unallocated space, mark it and click on New:

Specify the size of the new partition (either by dragging the black arrows or by typing it into the input boxes) and select the filesystem. I choose ntfs here. Then click on Add:

The result is as follows:

Now I decided that ntfs is not the right filesystem for my new partition and that I'd like to use reiser4 instead. So I right-click the new partition and select reiser4 as filesystem. The result looks like this:

Share this page:

Suggested articles

12 Comment(s)

Add comment

Comments

By: sadanand

hi, I was following above process to shrink my ntfs drive using gparted, but  I see that 'Rsize/Move' option is not active so cant proceed further.please help.

By: kaligula

Hello, did you try first to unmount it, and then rsize/move?

By: tommy styhlz

Thank for this! Very helpful... Had to resize my root partition. No data lost!

By: Don Smith

Will not let me resize the partition. partition is not mounted

By: Rodney Jackson

Absolutely fantastic, even a mug like me followed this properly.  Thank you for a step by step guide.  These are the types of things needed by old(er) people like me.

By: Jim S Smith

Have done this successfully with several installed harddrives. Just gotta LOVE GPartEd!

 

Even had to do a slight "reshuffling" on one of them. GPartEd has been one of my favorite utilities for years.

 

- Good stuff here. - Keep up the good info.

 

- Jim

 

By: joe perry

tried to get gpart to fix RAW partition that was currupted. running CHECK did not work.? i need to have the RAW filesystem ntsf reinstated?  i am running search for file system on /dev/sda

is there a mount button? but you cant mount a RAW parititon most likely. need to beable to recover

the file system ntsf from RAW..??

 

thanks joe

By: DGBurns

gParted livecd has much more current versions here:https://sourceforge.net/projects/gparted/

By: Alex

Thank You!

By: Luke Nguyen

Can this be done on Windows ? and how to do it? 

By: Bob

The used file space shown in GParted is different mounted vs unmounted.  Seems the mounted view shows the region of the partition containing files.  While the unmounted view graphically show the total size of file space which can be much smaller. 200meg of files can be spread over a gig of partition. So before you shrink you want to determine the shrink from the mounted view,  then unmount and hen shrink to the previously determined size.

By: bd

I have done some changes on sda11 with Diskgenius Version 1412 in Windows.

Diskgenius reports Filesystem is still Ext4.

Other tools show different results.

Ubuntu is unbootable now from this partition.

In addition, I have added the screenshot below. 

 

Ubuntu:

Disk: /dev/sda

Size: 953.87 GiB, 1024209543168 bytes, 2000409264 sectors

Label: gpt, identifier: 67F034C0-ACB6-03B0-300D-FC992D2BEC00

 

    Device          Start        End   Sectors   Size Type

>>  /dev/sda1          40    1230847   1230808   601M EFI System            

    /dev/sda2     1230848    1492991    262144   128M Microsoft reserved

    /dev/sda3     1492992  784914431 783421440 373.6G Microsoft basic data

    /dev/sda4   784914432  786262015   1347584   658M Windows recovery enviro

    /dev/sda5   786262016  989726719 203464704    97G Microsoft basic data

    /dev/sda6   989726720  991299583   1572864   768M Windows recovery enviro

    /dev/sda7   991299584 1344710655 353411072 168.5G Microsoft basic data

    /dev/sda8  1344710656 1846263807 501553152 239.2G Microsoft basic data

    /dev/sda9  1846263808 1846468607    204800   100M Microsoft basic data

    /dev/sda10 1846468608 1879955455  33486848    16G Microsoft basic data

    /dev/sda11 1879955456 1945585663  65630208  31.3G Windows recovery enviro

    Free space 1945585664 2000409230  54823567  26.1G                       

 

???????????????????????????????????????????????????????????????????????????

? Partition name: EF                                                      ?

? Partition UUID: 56FB037A-C3B7-4E6D-A230-9152913A116B                    ?

? Partition type: EFI System (C12A7328-F81F-11D2-BA4B-00A0C93EC93B)       ?

?Filesystem UUID: B8F0-60BB                                               ?

?     Filesystem: vfat                                                    ?

???????????????????????????????????????????????????????????????????????????

   [ Delete ]  [ Resize ]  [  Quit  ]  [  Type  ]  [  Help  ]  [  Write ]

   [  Dump  ]

     Device is currently in use, repartitioning is probably a bad idea.

                    Quit program without writing changes

Windows:

DISKPART> lis part

 

  Partition ###  Typ               Größe    Offset

  -------------  ----------------  -------  -------

  Partition 1    System             600 MB    20 KB

  Partition 2    Reserviert         128 MB   601 MB

  Partition 3    Primär             373 GB   729 MB

  Partition 4    Wiederherstellun   658 MB   374 GB

  Partition 5    Primär              97 GB   374 GB

  Partition 6    Wiederherstellun   768 MB   471 GB

  Partition 7    Primär             168 GB   472 GB

  Partition 8    Primär             239 GB   641 GB

  Partition 9    Primär             100 MB   880 GB

 Partition 10   Primär              15 GB   880 GB

  Partition 11   Wiederherstellun    31 GB   896 GB

 

DISKPART> lis vol

 

  Volume ###  Bst  Bezeichnung  DS     Typ         Größe    Status     Info

  ----------  ---  -----------  -----  ----------  -------  ---------  --------

  Volume 0     I                       DVD-ROM         0 B  Kein Medi

  Volume 1     C   0_1_HDD_NTF  NTFS   Partition    373 GB  Fehlerfre  Startpar

  Volume 2     E   1_3_HDD_NTF  NTFS   Partition     97 GB  Fehlerfre

  Volume 3     F   1_1_HDD_NTF  NTFS   Partition    168 GB  Fehlerfre

  Volume 4     G   1_2_HDD_NTF  NTFS   Partition    239 GB  Fehlerfre

  Volume 5     H   HP_TOOLS     FAT32  Partition    100 MB  Fehlerfre

  Volume 6         1-HP-10-HDD  NTFS   Partition     15 GB  Fehlerfre

  Volume 7     D                FAT32  Partition    600 MB  Fehlerfre  System

  Volume 8                      NTFS   Partition    658 MB  Fehlerfre  Versteck

  Volume 9                      NTFS   Partition    768 MB  Fehlerfre  Versteck

  Volume 10                     RAW    Partition     31 GB  Fehlerfre  Versteck