Friday, August 24, 2018

12.04 - Partition not showing in dpkg-reconfigure grub-pc (grub2) menu



I am trying to install grub boot loader on a partition /dev/sda3 (ext3 formatted), but it is not showing as an option when I run dpkg-reconfigure grub-pc.



My details are:
I have a dual boot system set up with windows fully encrypted on sda1. It is encrypted using truecrypt, so truecrypt is required on the mbr of sda.

I will briefly outline the steps I have taken (NB- This is dangerous, backup your boot sector first, or even better your whole HDD):




  • Encrypted windows on sda1 using truecrypt

  • Ubuntu 12.04 installed on extended partition sda5 (within sda2) I need a logical partition to install grub, it will not work on extended) - so I shrunk sda5 by 20 MiB and then shrunk sda2 by the same

  • This allowed me to create a new logical partition sda3. I formatted it as ext3 and gave it the boot flag

  • I started up a live boot disk, mounted /dev/sda5 to /mnt, and installed grub using grub-install --force --root-directory=/mnt /dev/sda3

  • This allowed me to restart and boot into ubuntu normally, happy days.




At this point, after I boot into ubuntu normally, I usually run dpkg-reconfigure grub-pc. If I don't do this, any update to grub, or a new kernel, will overwrite the main mbr of sda. In ubuntu 10.04 this is fine, I go through the menu, and it usually gives me the option to install grub onto whatever partition I want, but now, when I run it, it only gives me two options: /dev/sda or /dev/sda5 (/dev/sda3 is missing).



Have I taken a step which stops /dev/sda3 showing up in this menu? Is there a way to fix this, or could you tell me how I can manually change the debconfig properties to get grub to install to /dev/sda3 by default.



--edit I think this is what I am looking for: http://feeding.cloud.geek.nz/2010/10/manipulating-debconf-settings-on.html



Thank you!



I used http://feeding.cloud.geek.nz/2010/10/manipulating-debconf-settings-on.html to manually set the dpkg (debconfig) flag. I had to use this command (nb. this is dangerous, dont use this as a copy paste solution)




echo "set grub-pc/install_devices /dev/disk/by-id/ata-TOSHIBA_MK1646GSX_481JF04DS-part3" | debconf-communicate 


There is more detail in the link above which should help with most debconf issues.



Incase anyone else hits the problem there are more details here: http://ubuntuforums.org/showthread.php?t=1981034


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...