Cannot boot after moving and resizing partitions

I can not boot in Manjaro after moving and resizing partitions by kde partition manager

Before Action
I have 7 partitions nvme0n1p1 to nvme0n1p7, nvme0n1p1 … nvme0n1p4 were partition for windows

Action
I deleted nvme0n1p1 … nvme0n1p4 partition, and combine these partition into one unallocated partition, and move this partition after nvme0n1p7. and I applied.

After Action
After this I can not boot into Manjaro, and kde partition manager shows unknown file system, but fdisk show like that

Disk /dev/nvme0n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: WDC PC SN730 SDBPNTY-512G-1101          
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 3A2429AA-EEF2-44A9-9295-DD92CADFEBDC

Device            Start       End   Sectors   Size Type
/dev/nvme0n1p5     2048   4196351   4194304     2G EFI System
/dev/nvme0n1p6  4196352  12584959   8388608     4G Linux swap
/dev/nvme0n1p7 12584960 789934079 777349120 370.7G Linux filesystem 

I have no idea how to repair this, or there is no way to repair/restore

[sorry for the expressions, English is not my native language]

Boot into a LIVE ISO, double check the UUID’s of all your partitions using Gparted or kde partition manager and then mount your / partition manually and check if in /etc/fstab the correct UUID’s are set. When moving partitions sometimes the UUID’s are changed.

Then unmount the / partition again, manjaro-chroot into your install by

sudo manjaro-chroot -a

and restore the boot loader. This is needed as you most likely have changed the start sector of your / partition and grub does not find it any more.

Afterwards, try to reboot and report.

2 Likes

It seems I cannot mount it manually? Sorry I’m a newbee to linux

[manjaro@manjaro etc]$ sudo mount /dev/nvme0n1p7 /
FUSE exfat 1.3.0
ERROR: exFAT file system is not found.
[manjaro@manjaro etc]$ lsblk 
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0         7:0    0    26M  1 loop /run/miso/sfs/livefs
loop1         7:1    0 370.4M  1 loop /run/miso/sfs/mhwdfs
loop2         7:2    0   1.5G  1 loop /run/miso/sfs/desktopfs
loop3         7:3    0 697.2M  1 loop /run/miso/sfs/rootfs
sda           8:0    1  57.6G  0 disk 
├─sda1        8:1    1  57.6G  0 part 
│ └─ventoy  254:0    0   2.7G  1 dm   /run/miso/bootmnt
└─sda2        8:2    1    32M  0 part 
nvme0n1     259:0    0 476.9G  0 disk 
├─nvme0n1p5 259:1    0     2G  0 part 
├─nvme0n1p6 259:2    0     4G  0 part 
└─nvme0n1p7 259:3    0 370.7G  0 part 
[manjaro@manjaro etc]$ sudo fdisk -l
Disk /dev/nvme0n1: 476.94 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: WDC PC SN730 SDBPNTY-512G-1101          
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 3A2429AA-EEF2-44A9-9295-DD92CADFEBDC

Device            Start       End   Sectors   Size Type
/dev/nvme0n1p5     2048   4196351   4194304     2G EFI System
/dev/nvme0n1p6  4196352  12584959   8388608     4G Linux swap
/dev/nvme0n1p7 12584960 789934079 777349120 370.7G Linux filesystem

:bangbang: Tip: :bangbang:

When posting terminal output, copy the output and paste it here, wrapped in three (3) backticks, before AND after the pasted text. Like this:

```
pasted text
```

Or three (3) tilde signs, like this:

~~~
pasted text
~~~

This will just cause it to be rendered like this:

Sed
sollicitudin dolor
eget nisl elit id
condimentum
arcu erat varius
cursus sem quis eros.

Instead of like this:

Sed sollicitudin dolor eget nisl elit id condimentum arcu erat varius cursus sem quis eros.

Alternatively, paste the text you wish to format as terminal output, select all pasted text, and click the </> button on the taskbar. This will indent the whole pasted section with one TAB, causing it to render the same way as described above.

Thereby increasing legibility thus making it easier for those trying to provide assistance.

For more information, please see:


:bangbang::bangbang: Additionally

If your language isn’t English, please prepend any and all terminal commands with LC_ALL=C. For example:

LC_ALL=C bluetoothctl

_This will just cause the terminal output to be in English, making it easier to understand and debug.

You seem to have deleted your EFI System Partition (ESP) – There is little wonder that your machine fails to boot. The ESP should never be combined with any other partition.

You will need to create a new ESP.

In fact, it may be easier for you to completely reinstall Manjaro.

I didn’t remove or combine EFI System partition, you can see it is the partition nvme0n1p5

Clearly, you did:

The ESP is by default configured as the first partition on a drive – in your case, that was nvme0n1p1 which you deleted.

The ESP typically varies in size from 200MB to maybe 300MB, depending on the distribution. The partition now marked as ‘EFI System’ is ridiculously larger – 2GBobviously a result of combining the partitions; most likely ESP, /root and /home into one (nvme0n1p5).

Whatever operation(s) you used to combine these partitions has left you without an ESP (irrespective of the partition label remaining). An ESP has certain properties which were lost during this procedure.

Furthermore, if the whole 2GB partition inherited the underpinning fat32 filesystem of the former ESP, Linux will not work on that.

So, yes, you did remove the ESP. :slight_smile:

A complete reinstall – without merging any partitions – is probably the best way forward for you; especially considering your current knowledge of Linux:

Sorry I didn’t fill you in.
It is used to a dual boot, partition nvme0n1p1 - nvme0n1p4 are windows relevant. I wanna expand my manjaro partition, so I delete all these partition and move after to the partition nvme0n1p7.
I change the ESP to 2GB while I install manjaro before, I didnot combine any other partition to ESP

If I reinstall manjaro, all my data will lose?

Probably.

Try to Restore the GRUB Bootloader. Good luck.

It’s not work, I tried.
It cannot verify any Linux partition

Boot from the Live installer, and use manjaro-chroot to access your system:

sudo manjaro-chroot -a

Again: from a Live Installer DVD/USB.

Then try to restore Grub.

I follow this documentation, but error shows up. So I ask the question.

[manjaro ~]# manjaro-chroot -a
==> ERROR: No Linux partitions detected!
[manjaro ~]# whoami
root

I cannot help whith chrooting, but after you solve this problem, you should check if your newly created ESP had the correct flags - esp, boot. And 2GB is simply a lost space. The manjaro bootloader is 2 MB. I highly doubt you will install 1000 different OSes on that computer. Actually i am not sure if that massive size is not part of the problem too. A normal size for ESP is 200-300 MB max. Possibly the manjaro installer did something wrong with the ESP or assumed it is OK if it was preformatted by you before, wrongly.

Here is a reference how it has to look from gparted, you can do it and set the flags there from the live USB.
esp

Yes I preformatted. I cannot figure it out the chroot issue now, but thanks.

Please give the output of sudo blkid from within the manjaro-chroot environment. Please, not just the parts you might think are relevant. Thanks.

Sorry, this is not true, any partition could be used as ESP.

Also, not true, it’s recommendable to have for a Linux install 500 MiB these days, but certainly it could be larger without limit.

@cyberpelican, it’s a pity you could not just realize what I proposed, it could have solved your issue, but I’m not hand leading, if you have a question to a specific step, just ask, next time.

1 Like

It is true. Because you can do anything you want, but when you open the box of your newly purchased laptop, it IS p1. So he deleted it and recreated it as p5 but something went wrong in the process (i suspect the flags).

Some internet recommendations are kind of city legends. Maybe it started as 200mb somewhere and everyone wanted to be on the safe side and in every next copy-paste manual or wiki page were added 100MB and by the 3rd copy-paste we were at 500MB. I cannot imagine another reason. Microsoft itself recommends at least 100MB. My lenovo came factory with win11, and a lot of recovery bootloaders and tools and 260MB
There is a nice note in the arch wiki about this. Generally, everything above 300MB is either overprovisioning, or to avoid bugs, human errors or for buggy firmware versions or special cases. Supposedly there are “tools” that “might” install there. And some laptop/firmware brands may store language translations of the firmware there. But everything else… a bootloader of any OS is a couple of Megs.

That said, since resizing is a big pain, it is better to be safe than sorry and the upper limit of 500MB cannot hurt by the current price of SSDs. But 2 GB is just nonsense. In this particular situation i would leave it as is, because 1,5GB partition cannot be used for anything anyway, and is in the beginning of the drive. But if he repartitions and wipes everything anyway there is no need to be that big.

Thank you.

Yes, any partition can be used as an ESP, regardless of its position.

However, the ESP typically defaults to the first partition, when created during installation of an OS. That was the point; and that remains true.

Aside;- Interesting to note is that the UEFI specification only allows one ESP instance; whereas, in practice (depending upon tools used), multiple ESP’s are possible. Any specification is only as good as how well it’s implemented, or enforced. :slight_smile:

No, you can choose any partition as ESP, it was not the question what situation you face with a newly bought laptop.

The point is, there are many wiki infos but there is clearly no upper limit, therefore you cannot say a partition is too large as ESP, it might be much larger than needed but it will work. My answer was focussing the wrong conclusion:

Without sufficient information provided by the OP it’s easy (and often necessary) to make assumptions. The size of the ESP is anecdotal, at best; however, it’s fair to say that it is greatly in excess of the space typically used for the purpose.

Perhaps the OP can recover the situation (as @Teo alluded to) by setting appropriate flags to again make this partition a fully qualified ESP; or by recreating/restoring Grub while in a chroot environment, as you initially suggested. For the OP’s sake, I hope it’s that easy.

What interests me is this result: