Give more Hard disk space to Ubuntu

28,869

Before you start the process below, I suggest you backup your user files to an external hard disk, a USB flash drive, or a cloud storage service like Dropbox.

Assuming you have your Ubuntu partition beside the Windows 10 NTFS partition, like in this picture this picture, you first have to boot into Windows 10, and shrink the main Windows partition from there.

There are instructions on how to do that all over the internet, one here. You will see the new space as a black box in Disk Management marked as Unallocated Space.

Now boot into Ubuntu from a live USB, assuming you have one from which you installed your Ubuntu. If not, create one (again?) via pendrivelinux.com and use your existing Ubuntu disk image or download a new one.

You should have GParted installed on your live USB, if not you can get it in the Ubuntu Software Center, Synaptic Package Manager, or by running sudo apt-get install gparted from a terminal window.

Run GParted, find your hard disk Ubuntu main partition, and expand it. If you don't know how, you can find instructions on it here.

Hope that helps, if not just leave a comment.

Share:
28,869

Related videos on Youtube

Pham Quang Tuyen
Author by

Pham Quang Tuyen

Updated on September 18, 2022

Comments

  • Pham Quang Tuyen
    Pham Quang Tuyen over 1 year

    I know my question has been asked quite a few times on this forum but I am not sure if my situation is similar to what was described in those threads hence I decided to create a different one. Anyway here is my story, when I installed Ubuntu, I made a grave mistake by choosing a default dual-boot option (dual boot with windows 10) so I guess Ubuntu automatically allocates 32 GB by itself, now I want to allocate more HDD space to Ubuntu. However, since I didn't manually allocate a partition for Ubuntu during the installation process, I have no idea how. So is there any way to give more space to Ubuntu without deleting everything? Many thanks.

    Here is my partition:

    NAME   TYPE FSTYPE   SIZE MOUNTPOINT
    sda    disk        465.8G 
    ├─sda1 part ntfs   426.3G 
    ├─sda2 part            1K 
    ├─sda3 part ntfs     450M 
    ├─sda5 part swap     3.9G [SWAP]
    └─sda6 part ext4    35.2G /
    sr0    rom          1024M 
    

    So I guess ext4 is my Ubuntu partition ? So how can I resize it ? Many thanks.

  • Byte Commander
    Byte Commander over 8 years
    You probably can't shrink Win10's main partition while it's running. Do that from the Ubuntu live CD as well, gparted is capable of operating on NTFS partitions as well. On the other hand, never resize Ubuntu partitions using Windows tools, as they don't know the file system and will destroy it. See this question. (You did not suggest this, it's just an additional warning to readers who might want to save the time to boot the Ubuntu live CD).
  • theodorn
    theodorn over 8 years
    Are you sure one can't resize a Windows partition in Windows? I'm talking from my (volatile!) memory, but I'm pretty sure I shrunk my Windows partition while in Windows, before I dual-booted my system. I only had this one partition you see in the picture, which is from my computer. I shrunk it by 100 GB, installed Ubuntu, and have never had any problems.
  • theodorn
    theodorn over 8 years
    About resizing a Win partition from Ubuntu, from what I have read it is not recommended - better to deal with Ubuntu partitions in Ubuntu and Windows partitions in Windows.
  • Byte Commander
    Byte Commander over 8 years
    GParted can resize NTFS volumes, but only when they're unmounted. I think the same applies for Windows itself, but I could not find a good resource to proof that. Furthermore, the standard built-in Windows partitioning tools are not capable of moving immobile files (e.g. page file or special file system stuff like the ntfs journal or the mft), so if you've got (parts of) such a file near the end of your Windows partition, Windows itself can't shrink it past that point anyway. I personally trust in Gparted.
  • theodorn
    theodorn over 8 years
    OK maybe GParted isn't less suitable in meddling with a partition with another OS on it than Ubuntu. I'd like to add to my recommendations, that - regardless from which OS the OP chooses to shrink his Windows partition - that he/she would prepare a Windows Recovery Disk, in order to be able to restore Windows 10, in case something goes wrong. I don't want to be responsible for sinking someone's system, at least not with no way back!
  • Pham Quang Tuyen
    Pham Quang Tuyen over 8 years
    Just a quick question ? How do you know if something is a Ubuntu partition ? I did manually shrink my HDD prior to Ubuntu installation to allocate some space, however, I did not tell Uubuntu to be installed on those free space. Hence I am kinda confused about where Ubuntu is stored on my HDD. Many thanks.
  • theodorn
    theodorn over 8 years
    If you can paste a screenshot from GParted that would help us help you identify it. Usually a Ubuntu partition will be marked ext4, but the Windows ones NTFS.
  • Byte Commander
    Byte Commander over 8 years
    @PhamQuangTuyen Please edit your question and add the output of lsblk -o name,type,fstype,size,mountpoint and we will help you to identify your partitions.
  • Pham Quang Tuyen
    Pham Quang Tuyen about 8 years
    Hi guys, I apologize for not being able to return to this post sooner, I have already updated my post, and I found the Ubuntu partition ext4 sda6. So what should I do next? Since there seems to be a debate among you guys on where and how to resize the partition. Many thanks.
  • theodorn
    theodorn about 8 years
    There are two partitions in between the big Windows partition, SDA1, and the Ubuntu partitions, the swap in SDA5, and the main one at SDA6. Which makes things harder. SDA3 is probably the Windows recovery partition. I would be afraid to move it, but you can run GParted and see if you can "tilt" the three Windows partitions, to make space immediately before (to the left of) the swap partition. AGAIN, HAVE TWO RECOVERY DISKS OR USB DRIVES BY THE HAND, ONE FOR UBUNTU, ONE FOR WINDOWS, before doing anything of that kind.
  • theodorn
    theodorn about 8 years
    Edit: If I were in your shoes I'd install Ubuntu all over again, after allocating enough free space first, in Windows Disk Management. First, wait and see if someone will post a better suggestion, that doesn't require reinstall.
  • Pham Quang Tuyen
    Pham Quang Tuyen about 8 years
    Hi theodorn, many thanks. One more question, how to reinstall Ubuntu? According to my research, apparently, the Ubuntu installation overrides the starting files of windows, so if one delete Ubuntu, windows can not be started properly, I suspect.
  • theodorn
    theodorn about 8 years
    You are right. If you plan to reinstall, follow the steps here (in the dual-boot section of course.) howtogeek.com/141818/… Basically, you have to 1) delete the Ubuntu partitions, 2) allocate the resulting free space back to Windows, 3) restore the Windows boot loader (with a Windows recovery disk) 4) partition the disk again 5) and finally reinstall Ubuntu into the new partitions - the option "Something else" in the install process.
  • theodorn
    theodorn about 8 years
    Please, don't forget to mark my answer as complete, if your problem is solved.