0

I have a 2TB harddrive which I restored a Clonezilla Ubuntu OS image on it, the image was of a 512GB disk, so now my system sees the 2TB drive as a 512 with 1.5TB of free space. I looked into it and some suggestions is to boot from a USB then install gparted then merge them but then it said that it might mess up with the grub and since it’s the OS system drive I don’t want to mess it up that’s why I am seeking advice before trying things.

And here is the result of sudo lsblk

enter image description here

So I wonder how I can allocate the 1.5TB to the rest of the OS harddrive so my system sees the drive as 2 TB not 512GB without messing up GRUB?

enter image description here

3
  • 1
    No research effort shown - what have you already tried? Where did that fail?
    – Panki
    Nov 26, 2021 at 10:25
  • @Panki I looked into it and some suggestions is to boot from a USB then install gparted then merge them but then it said that it might mess up with the grub and since it’s the OS system drive I don’t want to mess it up that’s why I am seeking advice before trying things.
    – Tak
    Nov 26, 2021 at 10:27
  • 1
    Tak: what you replied to @Panki is the type of missing info in OP. If your boot volume is on the partition you which to extend, you may have issues and that could be the subject of the question: "how can I expand a partition (with my Grub boot loader on it) and make sure it still boots after the fact ?" You might want to read about how to restore a boot loader and so on... If you boot info region on disk is NOT on the partition to extend, then you may only have to check that your UUIDs in your /etc/fstab are as expected after GParted did its surgery.
    – Cbhihe
    Nov 26, 2021 at 11:28

1 Answer 1

3
  1. Unmount the swap and logical partition
  2. use the gparted to delete the partitions
  3. extend your root partition using gparted
  4. finally create a logical partition and a swap partition in it
  5. Verify/modify the /etc/fstab so that UUID matches

Here is a small illustration.Modify for your case accordingly.Feel free to ask if you face any error/doubs and accept the answer if it helped


if you are doing this from system itself then unmount the swap partition before continuing

if doing this from live usb make sure every partition in unmounted ofc ):


  1. current situation,disk in mbr and swap in lartition

enter image description here

  1. start by deleting the swap partition

enter image description here

  1. delete the logical partition

enter image description here

  1. resize your root ext4 partition

enter image description here


here you might get something like

enter image description here

well read it carefully; basically if anything happens during resizing then you are done and your data is gone );


  1. root partition size before resizing

enter image description here

  1. root partition size after resizing

enter image description here

  1. now it should look like this

enter image description here

  1. create your logical partition

enter image description here

  1. allocate te size of logical partition

enter image description here

  1. create a swap partition in logical partition

enter image description here

  1. allocate swap partition size

enter image description here

  1. finally it should look like this.check the list of pending processes

enter image description here

  1. apply the changes

enter image description here

  1. all done , this is how it should look like

enter image description here

  1. correct the UUID of swap partition in /etc/fstab

enter image description here

8
  • Do I need to boot from a USB and install gparted then do these steps or?
    – Tak
    Nov 26, 2021 at 10:36
  • @Tak you can do this from ubuntu itself {you can simply resize ext4 while ussing it}; i am adding more examples hang on
    – Madhubala
    Nov 26, 2021 at 10:38
  • Yes if you could please add a step by step example to follow, thanks a ton
    – Tak
    Nov 26, 2021 at 10:39
  • many thanks. In your last step when you say "correct the UUID of swap partition" you copy it from the disks window then paste it where?
    – Tak
    Nov 26, 2021 at 11:56
  • @Tak in the /etc/fsatb file you will find an entry related to swap partition.you have to replace it's uuid; if you want help with that - attach the contents of /etc/fstab in you question {and also attach the uuid of root and swap after resizing}
    – Madhubala
    Nov 26, 2021 at 12:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .