Does deleting a partition below Ubuntu mess up grub?

Nils Kassube kassube at gmx.net
Sun Oct 12 16:06:05 UTC 2014


Colin Law wrote:
> So if I want to delete a partition should I first edit
> /boot/grub/grub.cfg, and if so can I assume that all sda numbers above
> the deleted one will be decremented?

Does your grub.cfg refer to sda4? Anyway, the partition numbers 1 to 4 
are fixed for the primary partitions. Only the numbers of the logical 
partitions would change if you remove a logical partition with a lower 
number.

> Or can I run gparted from the
> working system, unmount the partition I want to delete (assuming it
> is not in use), delete it, and run update-grub before re-booting?

That should work.

> I mis-typed, it is actually sda3 I want to delete.  However, when I
> look at the partition numbering it looks a bit strange,

What looks strange?

> so I am not
> sure how to predict what the sda numbers will be after deleting sda3.
> I have
> 
> /dev/sda1          Windows
> /dev/sda3          To be deleted
> /dev/sda4          /home
> /dev/sda2  Extended
>     /dev/sda5      /
>     /dev/sda6      Swap

No matter if it is sda3 or sda4, the numbers stay unchanged because it 
is one of the primary partitions.

> Perhaps the easiest thing is just to shrink sda3 down small and leave
> it, but that seems like admitting defeat.

:)


Nils





More information about the ubuntu-users mailing list