ONIE Partition Exists Fix

ONIE Partition Exists Fix

I recently ran into an issue where I had uninstalled Onyx on my switch and I was trying to reinstall it but couldn’t because I was getting an error. Below is an example of the error.

partition exists - please uninstall first
EXT4-fs (sda3): couldn't mount as ext3 due to feature incompatibilities
cp: write error: No space left on device

There is also another variation of this error that I ran into. Below is an example of that error too.

umount: can't unmount /mnt/onie-boot: Invalid argument
/mnt/onie-boot not mounted
Error: You requested a partition from 1000MiB to 2000MiB (sectors 2048000..4095999).
The closest location we can manage is 1000MiB to 1000MiB (sectors 2047999..2047999).

The issue seems to be that somewhere along the lines the NOS uninstall process left behind a partition or two. To fix this we need to delete them. In this post, I’ll show you step-by-step how to delete the leftover partitions with ONIE.

The Fix

This fix works for the Nvidia/Mellanox switches and will likely work on other ONIE switches however, I’ve only tested this on Nvidia/Mellanox switches.

In my case the disk was sda it’s likely the same in most setups.

In my example, I will run umount/dev/sda3 and umount/dev/sda4

If the partition wasn’t mounted it is normal to get an invalid argument error.

Now that the partitions aren’t mounted we can delete them.

In my example, I will run rm 3 and rm 4

That is all it takes to resolve the ONIE partition exists errors.

Exit mobile version