Your setup seems very simple. The relevant partition is /dev/sda2, it contains ext4 filesystem, the filesystem is mounted as /. The free space is adjacent to the partition, after the partition (i.e. "to the right").
You want to expand the partition and the filesystem to the right. As ext4 can be expanded to the right online (i.e. when mounted), you can do all this from within the running system. No reboot required.
Please read the entire answer before proceeding.
To be on the safe side, invoke sudo blkid /dev/sda2 and save its output. We will need the string in double-quotes just after PARTUUID=.
Expand the partition:
- Run
sudo fdisk /dev/sda.
- Delete (
d) the partition number 2.
- Create anew (
n) a partition number 2. The start sector must be what it was (4096). Accept the default end sector, it will be somewhat lower than 1953525167. The type of the partition by default should be Linux filesystem and this is right.
- After seeing
Created a new partition, examine it (p). You should see /dev/sda2 with the size of about 931.5G and the type Linux filesystem. /dev/sda1 should be unaffected (i.e. exactly as it was).
- To be on the safe side, change partition UUID for the second partition (
x, then u). Type the exact string you got in the output of blkid /dev/sda after PARTUUID= (type the string without double-quotes). Return to the main menu (r).
- In case of any doubt quit without writing (
q) and wait until you get further help. But if everything looks like I described, write the modified partition table to the disk (w).
Yes, deleting a partition and creating it anew is the right way. Now it's time to expand the filesystem.
Expand the filesystem:
- Run
sudo resize2fs /dev/sda2. By default the tool will expand the filesystem so it takes the entire (new) partition.
- Verify with
df -h the filesystem is as large as you expected and there is free space in it.
The filesystem is still the old filesystem with its old UUID. We took care to replicate the PARTUUID of the old partition to the new one. Regardless if your GRUB and /etc/fstab use one or the other, they shouldn't notice the difference and the OS should still be able to boot.
lsblk? What is the output offdisk -l? (usesudoif needed). Please [edit] and add this information to the question. Tell us what device the question is about and what exactly you want to do with the unallocated space (i.e. which partition you want to expand, if this is what you want to do). – Kamil Maciorowski Oct 04 '22 at 15:42swapor other partition after it, with the unallocated space all at the end of drive, resulting from the cloning. – ChanganAuto Oct 04 '22 at 20:45/is a guess. Therefore IMO the definitive statement "you can't manage partitions anyway within a running system" is too strong. "You may or may not be able to manage …" is what I agree. – Kamil Maciorowski Oct 04 '22 at 21:00/dev/sdais the disk in question then whatfdisk -l /dev/sdaprints is the most important part of the output offdisk -l(frankly: the only important part; I asked for the output offdisk -l, notfdisk -l /dev/sda, because you hadn't told us the name of the disk). In the picture you posted this crucial part is truncated. – Kamil Maciorowski Oct 05 '22 at 16:33fdisk -l. Also I would prefer adding the unallocated space to/but if it is not possible then a new partition would work as well. – Ali Asghar Chakera Oct 05 '22 at 16:36lsblk? It's better to post it as text. – Kamil Maciorowski Oct 05 '22 at 16:38lsblkas well now – Ali Asghar Chakera Oct 05 '22 at 16:38mount | grep /dev/sda2? Please don't post images of text. – Kamil Maciorowski Oct 05 '22 at 16:42/dev/sda2 on / type ext4 (rw, relatime)– Ali Asghar Chakera Oct 05 '22 at 16:46