Reinstall Manjaro on dual boot

I have a dual boot setup with Windows, created with Manjaro installer way back.

I want to wipe /dev/sda5, create a new ext4 partition, and reinstall Manjaro on it.

Device         Start        End   Sectors   Size Type
/dev/sda1       2048     923647    921600   450M Windows recovery environment
/dev/sda2     923648    1126399    202752    99M EFI System
/dev/sda3    1126400    1159167     32768    16M Microsoft reserved
/dev/sda4    1159168  536063638 534904471 255.1G Microsoft basic data
/dev/sda5  536063639 1000215182 464151544 221.3G Linux filesystem

Partition 5 does not start on physical sector boundary.

However, the new partition will have a new GUID I think, and booting will stop working (correct me if I’m wrong).

What is the correct high-level approach to this situation?

On top of my head, I think I’d might have to chroot into the new install and do:

grub-install
grub-update
mkinitcpio -P

Advice kindly appreciated.

consider this the correction
If you replace the current Linux system on /dev/sda5 with a new one
exactly that will happen.

The EFI partition get’s re-used (if you tell the installer to do so)
and everything will be as before, just with a different Linux system.

Yes - of course, if you create a fresh one in that place.
But booting will not stop working because of it.

You should have a backup of everything you care about - for when you accidentally overwrite some partition’s content, for example.
That includes the Windows partitions.

You can write down the UUID of the partition before formatting it, and then after formatting it, give it the old UUID back with tune2fs. :backhand_index_pointing_down:

sudo tune2fs -U your-old-uuid-here /dev/sda5

Note: The above pertains to the UUID of the filesystem. The PARTUUID in the partition table will not change unless you remove and recreate the partition itself during the installation.

Are you sure?
I’m asking because in my /etc/fstab, I see this line for /dev/sda5:

UUID=86cab457-aaca-4ba2-a2ed-12ae9029e3a1   /              ext4    noatime             0 1 

The partition will be deleted because there’s this alignment issue as you can see in the OP.

tune2fs certainly is useful.

I guess I need a similar command for giving the partition also the same PARTUUID as before the partition will be deleted, or… what do you think?

Well, unless you are effectively using the PARTUUID anywhere as an identifier — your /etc/fstab only uses the UUID — then you don’t need to change the PARTUUID. However, with a partition editor like gparted, you could always change it later if you want.

1 Like

Yes.

A new system will be installed - as you say.
That includes everything - /etc/fstab as well, of course

There is no issue - it’s simply a message stating that fact.

2 Likes

Aren’t you makeing it more convoluted than it has to be? It will be a new install…it will generate its own fstab and grub.
The only thing will be to be sure to enable os-prober in /etc/default/grub and run sudo update-grub after.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.