Need drive gparted advice: remove first EOS, keep second EOS

I’m looking for advice after doing quite a bit of net research, and can’t find a specific example.

I’ve got a efi based laptop with two EOS installs. First is on /dev/sda2; second on /dev/sda3.

I’ve got no need for /dev/sda2, and would like to delete it and expand the space allocated to /dev/sda3.

I’d assume when I do this in gparted from an ISO where the disk is unmounted, after a reboot, will what is now /dev/sda3 be renumbered to /dev/sda2 ?

Will /etc/fstab need updating as well?

I’ll need to clean up grub’s menu as well. It’s kind of a mess, as when I did the installs, OS Prober was enabled and double entries exist.

Advice appreciated. There isn’t anything of value on this computer, so worst case, a new reinstall and reformat of the disk.

Thank you

You can just boot into your installation on /sda3 and remove your /sda2. Or you can use your live environment from the ISO. I don’t think it would be renumbered as I recall the partition are numbered accordingly to their location on disk (correct me if I’m wrong). So you’ll get another /sda2 with clean disk space.

Depends, if that partition is mounted as another drive that you can access from your /sda3 then you have to edit it because the mount point might change. Some times UUIDs chage too.

Yep would be advised to do so.

But my advice is to do a proper clean install without jumping through all the hoops. You would have fewer headaches.

I’d agree with what @s4ndm4n said.
That said, if you do decide to proceed with expanding partitions - keep a usb stick of supergrubdisk2 or equivalent handy so that if things go south, you can boot the into the endeavourOS installed on the hard disk by booting from usb.
Then you can re-generate grub from endeavourOS.
This strategy worked for me sometime ago.
My motivation for retaining the partition, was

  • I didn’t want to re-install stuff I couldn’t remember (laziness?)
  • I was curious to see if I could do it without messing up
  • if things went south, I could recover ( I run multiple installations)

Also the output of sudo parted -l plus an screenshot of your disk from Gparted could give some clues to the forum.

Is your second EnOS controlling the Grub?

1 Like

Yes, the second EOS is the one that built/configured the current grub.

sudo parted -l looks just about the same as gparted.

Model: ATA …
Disk: /dev/sda
Sector size 512B
Partition table: gpt
Disk Flags:

num start end size file system name flags
1 2097KB 317MB 315MB fat32 boot, esp
2 317MB 64.2GB 63.9GB ext4 root
3 64.2GB 128GB 63.9GB ext4 root

Pretty straight forward. And yeah, I always have a few ISO’s handy for emergency situations.

In this case, this should be pretty straightforward. No need to to re-install the Grub bootloader after moving and resizing your system partition.

A couple of things to consider:

:warning: Any kind of disk manipulation (moving, resizing etc.) entails certain risk of data loss/corruption. It would be a good idea to backup your valuable data from both systems.

Normally moving a partition as well as copy-pasting one in Gparted won’t change the UUID of the partition in question. However, for being on the safe side, make note of the UUID of /dev/sda3 and compare it to the one after you are done with the moving and resizing. Also compare with the UUIDs in your /etc/fstab.

Now you could just launch Gparted in an EnOS’ live session. Make sure the partitions are unmounted.
Right-click on the partition to be deleted and delete it.
Right click on the partition to be moved and move it to the left so that the unallocated space is to its right-side.
Right-click on it and resize it to the right to fill out the whole space.

In the event that you will end up with an unbootable system, you could always arch-chroot into it from an EnOS live iso and re-install the bootloader.

Hope this helps and good luck!

I’ll have to reconfigure grub though, as there will be orphaned menu items to what was on /dev/sda2 though.

Good idea on making note of the UUIDs of the partitions before any action.

And finally, thanks for the reminder on backup of data. It’s even easier, as I’ve got nothing really there that I couldn’t lose as this was just a testing environment until now. Even if this goes horribly wrong, I’ll just do a fresh install. But I hope I can save 2 hours. Thanks!

1 Like