How to expand the capacity of Ubuntu in a dual system.
To expand the space on Ubuntu, you can follow these steps:
- To shrink a Windows partition in Windows: Open the “Disk Management” tool, right-click on the Windows partition, select “Shrink Volume” and specify the amount of space to be released.
- Create a new partition: create a new partition on the freed-up space. You can complete this operation using either the “Disk Management” tool or a third-party partition management tool.
- Format the new partition: Format the new partition as EXT4 file system, which is the file system used by Ubuntu. You can use tools like GParted to format the partition.
- Mounting a new partition: Open the terminal and run the following command to view the identifier of the new partition:
- Use the command “sudo fdisk -l”
- Identify the new partition with a label typically represented in the form of “/dev/sdXn”, where X is the disk number and n is the partition number.
- Then create a new mount point, such as “/media/newdrive”, and run the following command:
- Create a new directory named “newdrive” in the “/media” directory.
- Next, mount the new partition onto a new mount point and run the following command:
- Mount the specified device (/dev/sdXn) to the /media/newdrive directory using superuser privileges.
- To update the /etc/fstab file, use the following command to open the /etc/fstab file:
- Edit the /etc/fstab file using sudo nano.
- Add a line at the end of the file to automatically mount the new partition, for example:
- Mount the /dev/sdXn partition to /media/newdrive with ext4 file system using default settings.
- Save the document and exit.
- Expand Ubuntu partition: Open GParted or another partition management tool, select the partition where Ubuntu is located, right-click on the partition, choose “Resize/Move,” and adjust the size of the partition to the desired size.
- Please make sure to backup important data and ensure there is sufficient power before adjusting partition sizes to prevent data loss in case of interruption.
- Update file system size: To update the size of the file system, run the following command in the terminal:
- Run the command “sudo resize2fs /dev/sdXn”
- This will allow the file system to use the newly adjusted partition size.
After completing the above steps, the partition size of Ubuntu will be expanded.