How to mount a free storage permanently on Ubuntu?
I have created a free non allocated volume by shrinking a drive in my windows, and now I want to add that free space to my Ubuntu 20.04 machine in dual boot.
I have created 150GB of free space in windows but now I am seeing 161GB free space on Ubuntu disk, Can anyone guide me how to mount this 161gb permanently on Ubuntu Please find the disk partition image here
First, you will need to
- Create a partition in the free space
- Format that partition so it contains a file system
Al of this can be done with the utility "Gnome Disks", installed by default in default Ubuntu with the Gnome desktop, or with Gparted, available by default in a live Ubuntu session started from an installation USB/DVD. Because you are not changing partitions that are in use, you can do this from within your running system. Alternatively, boot into the live environment.
Then you can
- Mount that partition automatically during startup. That can be done manually by editing the system configuration file
/etc/fstab
, but it can also be done with the utility "Gnome Disks", installed by default in default Ubuntu with the Gnome desktop.
You cannot "simply" add that space to your Ubuntu system partition, because there is an ntfs partition to the right of it. That partition would need to be deleted (destructive process) or moved (slow process) to make free space adjacent to the Ubuntu system partition. Only then could that partition be expanded.
If you are using LVM, you could extend the logical volume that Ubuntu is installed on. This can be achieved with the following:
- create a new partition in the free space: use gparted or fdisk
- Create a new LVM physical volume(PV):
pvcreate /dev/sdb6
- Add the PV to the LVM Volume Group(VG):
vgextend vg-ubuntu /dev/sdb6
- Extend the LVM Logical Volume(LV):
lvextend -L +150G /dev/vg-ubuntu/root
- Resize the filesystem:
resize2fs /dev/vg-ubuntu/root
If you are not using LVM, the you can just create a normal partition and mount it wherever you like.
- create a new partition in gparted and format it as ext4 or xfs
- mount it where you need to store files.