To start, let’s open up our trusty terminal and type in:
# This code script updates and upgrades the system using the apt-get command.
# The sudo command is used to run the following commands as a superuser, allowing for system changes.
# Update the list of available packages and their versions.
sudo apt-get update
# Upgrade all installed packages to their latest versions.
# The -y flag automatically answers "yes" to any prompts during the upgrade process.
sudo apt-get upgrade -y
This command will update our package list and install any available updates. It’s always a good idea to do this before we start messing around with partitions, just to make sure everything is up to date and running smoothly.
Next, let’s open up GParted by typing:
# This command updates the package list and installs any available updates.
# It's always a good idea to do this before making changes to partitions.
sudo apt-get update && sudo apt-get upgrade -y
# This command installs GParted, a partition editor.
sudo apt-get install gparted -y
This will download and install the GParted package from our repository. Once it’s finished, we can launch GParted by running:
# This script will download and install the GParted package from our repository.
# Once it's finished, we can launch GParted by running the following command:
# Use the gksu command to run GParted with root privileges
gksu gparted
We should now be looking at a fancy-schmancy partition editor that looks something like this:
As you can see, we have our Windows partition (which is currently taking up most of the space on our hard drive), as well as a few other partitions that are probably not important for this tutorial.
To shrink our Windows partition, let’s click on it and then hit “Resize/Move” in the menu bar at the top:
This will bring up a dialog box that looks like this:
As you can see, we have the option to move our partition (which is not what we want), as well as shrink it by a certain amount of megabytes or gigabytes. For this tutorial, let’s say that we want to free up 20GB of space on our Windows partition. To do this, we can either type in “20” for the value (in GB) and hit enter, or we can click on the little arrows next to the “Value” field and drag them over until they reach 20:
Once we’ve entered our desired value, let’s hit enter or click on the green checkmark to apply our changes. GParted will then ask us if we want to write these changes to disk (which is what we want), so go ahead and say “Yes”:
And that’s it! Our Windows partition should now be smaller by 20GB, which means we have some extra space to play with. If you ever need to install another operating system alongside Windows (like maybe Ubuntu or Fedora), this is the perfect time to do so. Just create a new partition in GParted and follow the instructions for your chosen OS.
Hope that helps! Let me know if you have any questions.