0

I am new to Ubuntu 17.10 and there is a problem I can't solve on my own or with doing research on the Internet. First of all, I resized the partition to get space for another one for having Windows 7 and Ubuntu coexisting on my Computer.

So as the title says, I want to receive that unallocated space which lies within my /home partition. I unmounted and resized it by login as root in terminal, using the following command:

resize2fs /dev/sda5 500G

The screenshots show my problem, as the space within the resized partition isn't assigned to the unallocated space and I can't get it to.

gparted1

gparted2

galoget
  • 2,963
Bent93
  • 3

1 Answers1

3

resize2fs resizes a file-system, not a partition. To shrink a partition both have to be resized, first the file-system, second the partition.

I would recommend to use GParted to edit partitions, both steps are managed by GParted and you don't need to bother with that.

Follow the warning in your second screenshot to repair the partition and then just resize the partition using GParted's graphical user interface.

Remind that shrinking the /home-partition will result in unallocated space in the extended partition. You can create only logical partitions in that space. To create a primary partition (which is needed for a Windows installation) you will have to shrink the extended partition sda2 as well.

Do all that partition-editing while booted into a live-session, so all partitions on your HDD are unmounted.

If you have any data on your disk you can't risk to lose, it is a good idea to backup it first.

If you use a laptop, make sure your power supply is connected, you don't want to run out of battery while performing such tasks!

David Foerster
  • 36,264
  • 56
  • 94
  • 147
mook765
  • 15,925