Tuesday, November 8, 2011

(error: no such partition) after resizing Linux partition using Gparted

Errors and Solutions #28

Error


error: no such partition

Context

Got this error after resizing Linux partitions using GParted from Live CD, the resize included a move operation which led to inconsistency with GRUB boot data in MBR

Solution

1- Booting

You have 2 ways to boot, first you can boot using the GRUB rescue commands as follows

> ls
> set prefix=(hd0,msdos3)
> set root=hd0,msdos3
> insmod normal
> normal

Note: For me msdos3 corresponds to /dev/sda3 which in your case should be the boot partition


The second option is to use Ubuntu installation CD (try ubuntu option)


2- Reinstalling GRUB

After booting you need to reinstall GRUB in MBR to accommodate the new partition location

### get boot partition name
> sudo fdisk -l

The boot partition is the one which contains "*" , for me it was "/dev/sda3"

### (Only when booting from Live CD) change root filesystem from LiveCD to installation root filesystem

> sudo mount /dev/sda3 /mnt/realroot
> sudo mount ‐‐bind /dev /mnt/realroot/dev
> sudo mount ‐‐bind /proc /mnt/realroot/proc
> sudo mount ‐‐bind /mnt/realroot/sys

> sudo chroot /mnt/realroot


## Re-installing GRUB

> grub
> root (hd0,2)

Note: hd0 is the first drive and "2" is the index which corresponds to "/dev/sda3" ( the boot partition )

> setup (hd0)
> quit
> sudo grub-install /dev/sda
> rm -rf /boot/grub/menu.lst
> sudo update-grub


References:

1-http://ubuntuforums.org/showthread.php?t=224351
2- http://gparted.sourceforge.net/display-doc.php?name=help-manual&lang=C#gparted-fix-grub-boot-problem



No comments:

Post a Comment