0

Partition layout

I want to allocate 15 gb free space to /dev/sda6. Can it be done without moving or any damage to system/data?

2 Answers2

2

Yes, it's possible if you use a live USB/CD system.

Step by step guide:

  1. Find an USB drive with ~1.5 GiB of free space
    • I highly recommend that you back up any important data from that USB drive before continuing
  2. Download any recent Ubuntu image from the Download page (if you don't have one lying around already).
  3. Launch the Startup Disk Creator application
    1. Add the downloaded Ubuntu image using the Other… button of the first section
    2. Select your USB drive from the second list
    3. Start installation by clicking on Make Startup Disk

Now reboot and boot from the USB-Stick. Once you see the desktop on the USB system:

  1. Connect to the Internet as usual
  2. Launch the Ubuntu Software Center
  3. Install GParted as usual
  4. Launch GParted

Now start with the first NTFS partition (/dev/sda3):

  1. Right-click on it's entry in GParted's partition list
  2. Select Resize/Move from the menu
  3. In the dialog: Drag the partition from the right all the way to the left: Sample screenshot
  4. Confirm with the Resize/Move button in the bottom right

Next you have to make the extended partition (/dev/sda4) larger:

  1. Again, right-click on it's entry and select Resize/Move from the menu
  2. This time, in the dialog: Increase the size of the partition by dragging it's left handle all the way to the left: Sample screenshot

Now repeat everything you have done with the first NTFS partition (/dev/sda3) with the second NTFS partition (/dev/sda5).

Finally repeat what you have done for the extended partition (/dev/sda4) for your root partition (/dev/sda6).

The final list of pending operation should look similar to this: Sample screenshot

Once you're confident that you have done everything correctly, click on the Apply button, confirm the warning, and get a coffee. It'll take a while for the all operations to complete…

ntninja
  • 726
0

You could use parted or gparted to do this from a live CD since the partitions must not be in use while this is done for extending this should be done before resizing the filesystem, when shrinking a partition you should first resize the filesystem then the physical partition.

Resizing the filesystem is done by resize2fs command if it is an ext[2-4] filesystem.

Usually this is safe but there is always the risk that you could lose your data if external events cause the process to be interrupted such as a power failure so always back up critical data first.

MttJocy
  • 692
  • He can't resize it because the free space isn't next to it, so parted/resize2fs are out. – psusi Apr 26 '16 at 22:41
  • You can also move the existing partion, check out the other answer which gives more details on that. – MttJocy Apr 27 '16 at 00:44
  • That was kind of my point: you have to move it, and that requires gparted, rather than parted/resize2fs, as you point to. – psusi Apr 27 '16 at 01:52
  • gparted is just a graphical front end to parted so yes you can move partitions with parted the command is "move [partnum] [start] [end]" https://www.gnu.org/software/parted/manual/html_node/move.html – MttJocy Apr 27 '16 at 02:13
  • The move command was removed 5 years ago with version 3.0, along with the filesystem format and resize support. – psusi Apr 27 '16 at 23:13