help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deleting partitions


From: Jordan Uggla
Subject: Re: Deleting partitions
Date: Sat, 7 Apr 2012 01:59:48 -0700

On Fri, Apr 6, 2012 at 9:56 PM, Chris Jones <address@hidden> wrote:
> This is not a grub question per se but I'm not sure where else I could
> find _reliable_ information about this.¹
>
> I am in the process of spring-cleaning my laptop's hard drives and would
> like to delete a couple of partitions.

<snip>

>
> My /boot/grub directory is in the /dev/sda9 partition and if I boot off
> of a live CD and delete the /dev/sda5 and /dev/sda8 partitions, the
> current /dev/sda6, /dev/sda8 and /dev/sda9 will automatically be
> renumbered and become /dev/sda5, /dev/sda6, and /dev/sda7 (msdos5,
> msdos6, and msdos7).
>
> As a result, if I proceed to reboot off of the hard drive, the grub boot
> loader environement will fail to initialize because it will look for the
> /boot/grub/ directory in the /dev/sda9 (msdos9) partition, which no
> longer exists.²
>
> Rather than go through the hassle of repairing a broken boot loader
> manually from the grub rescue prompt (or worse do a grub-install
> --root-directory= of a possibly incompatible version of grub from
> a repair CD), is there a better strategy³..?
>
> Would chroot'ing to the linux system on /dev/sda9 (now /dev/sda7)
> immediately after deleting the two partitions and running update-grub
> (and OS-prober) from the chroot be the best choice..?

Yes, that would be the best choice and full instructions for doing
this are here: https://help.ubuntu.com/community/Grub2#ChRoot

Note that update-grub (technically /etc/grub.d/30_os-prober from
grub-mkconfig) runs os-prober and parses its output. Running os-prober
on its own does nothing but display terse information about other
detected OSs. So running os-prober on its own is not needed, but
doesn't do any harm.

-- 
Jordan Uggla (Jordan_U on irc.freenode.net)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]