Choose style:

Author Topic: How to sudo grub-install from Live Media [SOLVED]  (Read 2211 times)

0 Members and 1 Guest are viewing this topic.

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4808
  • Karma: 1013
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 8 Respin-2 (64-bit)
How to sudo grub-install from Live Media [SOLVED]
« on: June 28, 2015, 06:30:36 am »
Hi all,  I was fiddling around with another distro and I knew I would loose Grub in Peppermint.  No problem because I know how to re-install it to the MBR from a Live USB stick - famous last words eh  :-[!!  For the life of me I can't remember how to do it.  Here's the output from, sudo fdisk -l:
Spoiler (click here to view / hide)
peppermint@peppermint ~ $ sudo fdisk -l

Disk /dev/sda: 4037 MB, 4037017600 bytes
64 heads, 32 sectors/track, 3850 cylinders, total 7884800 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3599a866

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           0     1361919      680960   17  Hidden HPFS/NTFS

Disk /dev/sda1: 697 MB, 697303040 bytes
64 heads, 32 sectors/track, 665 cylinders, total 1361920 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3599a866

     Device Boot      Start         End      Blocks   Id  System
/dev/sda1p1   *           0     1361919      680960   17  Hidden HPFS/NTFS

Disk /dev/sdc: 750.2 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00088042

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *        2048      821247      409600   83  Linux
/dev/sdc2          821248    42764287    20971520   83  Linux
/dev/sdc3        42764288    84707327    20971520   83  Linux
/dev/sdc4        84709374  1465147391   690219009    5  Extended
Partition 4 does not start on physical sector boundary.
/dev/sdc5        84711424  1448372223   681830400   83  Linux
/dev/sdc6      1448374272  1465147391     8386560   82  Linux swap / Solaris
peppermint@peppermint ~ $
[close]

  • /dev/sdc1=/boot
  • /dev/sdc2=/root
  • dev/sdc3=/home
  • dev/sdc4=Extended
  • /dev/sdc5/mnt/DATA
  • /dev/sdc6=swap
Any help would be much appreciated  ;).
« Last Edit: June 28, 2015, 07:59:27 am by AndyInMokum, Reason: Marking topic as [SOLVED]. »
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline Slim.Fatz

  • Trusted User
  • Veteran
  • *****
  • Posts: 1800
  • Karma: 472
  • Where's the mouse?
    • View Profile
  • Peppermint version(s): Peppermint 7, 8.5 & 10 - 64bit
Re: How to sudo grub-install from Live Media
« Reply #1 on: June 28, 2015, 06:35:01 am »
Hi AndyInMokum,

My quick look found this method -- quite a bit more involved than what you are thinking is the quick way! Here is another alternative method. Or this method might also be used.

Good luck.

Regards,

-- Slim
« Last Edit: June 28, 2015, 06:42:30 am by Slim.Fatz »
"Life first -- Peppermint a close 2nd!" -- Zeb

Tread lightly: Fluxbox, JWM, i3, Openbox, awesome

Online PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26064
  • Karma: 2840
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: How to sudo grub-install from Live Media
« Reply #2 on: June 28, 2015, 07:16:09 am »
Code: [Select]
sudo mount /dev/sdc2 /mnt
sudo mount /dev/sdc1 /mnt/boot
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
grub-install /dev/sdc
update-grub
hit Ctrl+D to exit chroot
then
Code: [Select]
sudo reboot
making sure sdc is set as the boot device

Source:
https://help.ubuntu.com/community/Grub2/Installing#via_ChRoot
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4808
  • Karma: 1013
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 8 Respin-2 (64-bit)
Re: How to sudo grub-install from Live Media
« Reply #3 on: June 28, 2015, 07:58:51 am »
Many thanks guys, It all makes sense now  ;).  This is a real brain fart day  :-[ .  Just out of interest, how do I get the quiet splash back?  I don't really need to see the GRUB screen on each boot.
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline Slim.Fatz

  • Trusted User
  • Veteran
  • *****
  • Posts: 1800
  • Karma: 472
  • Where's the mouse?
    • View Profile
  • Peppermint version(s): Peppermint 7, 8.5 & 10 - 64bit
Re: How to sudo grub-install from Live Media [SOLVED]
« Reply #4 on: June 28, 2015, 09:35:34 am »
Glad to hear of your success!!

In

/etc/default/grub

I think this section will do it:

Code: [Select]
GRUB_DEFAULT="0"
#GRUB_HIDDEN_TIMEOUT="0"
GRUB_HIDDEN_TIMEOUT_QUIET="true"
GRUB_TIMEOUT="0"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
I forget off the top of my head exactly which line is the critical one but I believe it to be

GRUB_TIMEOUT="0"

which indicates the number of seconds to wait before booting the default entry.

Regards,

-- Slim
"Life first -- Peppermint a close 2nd!" -- Zeb

Tread lightly: Fluxbox, JWM, i3, Openbox, awesome

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4808
  • Karma: 1013
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 8 Respin-2 (64-bit)
Re: How to sudo grub-install from Live Media [SOLVED]
« Reply #5 on: June 28, 2015, 10:10:54 am »
Glad to hear of your success!!

In

/etc/default/grub

I think this section will do it:

Code: [Select]
GRUB_DEFAULT="0"
#GRUB_HIDDEN_TIMEOUT="0"
GRUB_HIDDEN_TIMEOUT_QUIET="true"
GRUB_TIMEOUT="0"
GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
I forget off the top of my head exactly which line is the critical one but I believe it to be

GRUB_TIMEOUT="0"

which indicates the number of seconds to wait before booting the default entry.

Regards,

-- Slim
Yup, that's what I was looking for.  The GRUB_TIMEOUT="0" was set to 10.  All fixed - thanks again ;)!!
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline Slim.Fatz

  • Trusted User
  • Veteran
  • *****
  • Posts: 1800
  • Karma: 472
  • Where's the mouse?
    • View Profile
  • Peppermint version(s): Peppermint 7, 8.5 & 10 - 64bit
Re: How to sudo grub-install from Live Media [SOLVED]
« Reply #6 on: June 28, 2015, 01:59:11 pm »
Hi AndyInMokum,

You are more than welcome, Andy !! I assume, although others reading this might not know this, that after making the changes in

/etc/default/grub

you ran

Code: [Select]
sudo update-grub

For those "others": this is needed to make the change appy for your next boot.  ;)

Regards,

-- Slim
"Life first -- Peppermint a close 2nd!" -- Zeb

Tread lightly: Fluxbox, JWM, i3, Openbox, awesome

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4808
  • Karma: 1013
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 8 Respin-2 (64-bit)
Re: How to sudo grub-install from Live Media [SOLVED]
« Reply #7 on: June 28, 2015, 02:14:34 pm »
Hi Slim, oh yes.  How could I not do that?  The file notes make it so easy.  Whoever put it together was meticulous about detail.  That is very nice to see.
Code: [Select]
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
« Last Edit: June 28, 2015, 02:30:16 pm by AndyInMokum »
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.