[nSLUG] Question re. Installing GRUB (not GRUB2) on a 'new' hard drive

Frank Geitzler frank.geitzler at ns.sympatico.ca
Sun Oct 30 17:33:10 ADT 2016


Thanks, Stephen.  That looked like what I wanted, but when I tried the 6
commands below, modifying the first two to read;
sudo mount /dev/sda6 /mnt
sudo mount /dev/sda6  /mnt/dev
and the next three commands, with the 'sudo' prefix as well.
Unfortunately, the 'sudo chroot /mnt' command  responds:
    chroot: cannot run command '/bin/bash': Exec format error
and the same command, without 'sudo', responds:
    chroot: cannot change root directory to /mnt: Operation not
permitted

The latest issue of Ubuntu magazine, which I received in the mail
Friday, but didn't look through till I tried your commands, had a
similar sequence on page 87,  captioned 'Revival' which read, in part,
'To revive an installed Ubuntu, boot up Live mode on the DVD ... by
choosing the Try Ubuntu without installing option.  Be sure that the
Live and installed versions are the same architecture.  Then, invoke a
terminal and execute the following commands.  Substitute for /dev/sda6
entry the specific partition in which the root directory (/) of the
installed Ubuntu is located.
The sequence of commands in the magazine is similar to yours, except:
theirs are prefixed with 'sudo'
Their third command is for /sys rather than /proc (I know that has no
effect)
and the fourth command (for '/proc' reads slightly differently:
    sudo mount -t proc /proc /mnt/proc
rather than
    sudo mount -o bind /proc /mnt/proc

They then follow the above sequence with:
    sudo chroot /mnt
    grub mkconfig -o /boot/grub/grub.cfg
    update grub2
    grub-install /dev/sda
    exit
    sudo reboot
The magazine then says:
Use the chroot command (change root) to mount the installed system into
your Live system and work with it as if you had booted it.  Now you cn
set up a new GRUB2.

I tried their commands today, but
Of course, the sequence fails again with the 'sudo chroot /mnt' command,
as before, so I shut down. 



Why should I not be able to chroot?
Also, I thought that I should be able to just run
'grub-install /dev/sda' after a successful 'chroot /mnt' command.  I
have updated the fstab (I checked by entering the first two commands:
    mount /dev/sda6 /mnt  
    cat /dev/etc/fstab
which showed that the newly edited fstab had been mounted properly
on /mnt.
I chose to install GRUB rather than GRUB2 because that is the version
which is on Ubuntu 10.04 installation DVD -the version which I have
restored to my desktop machine.
Thanks again for your help,
Frank 

> 

On Sat, 2016-10-29 at 13:49 -0400, Stephen Gregory wrote:

> On 29 October 2016 at 12:26, Frank Geitzler
> <frank.geitzler at ns.sympatico.ca> wrote:
> > I have  an old laptop running Ubuntu 10.04.4 LTS.  Or course, this release
> > is no longer in support, but I want to retain it -but not on this computer.
> 
> > Unfortunately, when I booted the desktop machine with the Ubuntu 10.04.4
> > DVD, select 'try ubuntu',
> > open a terminal with Ctrl-Alt-t, and enter 'sudo grub',  the response is:
> > sudo: grub: command not found.
> 
> 
> after booting the live cd open a terminal and try:
> 
> mount <root_fs> /mnt
> mount <boot_fs> /mnt/boot   #optional if /boot is seperate
> mount -o bind /dev /mnt/dev
> mount -o bind /proc /mnt/proc
> mount -o bind /sys /mnt/sys
> chroot /mnt
> then run grub
> 
> 
> 
> 
> Also please don't connect Ubuntu 10.04 to the internet. The botnets
> are big enough.
> 
> 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nslug.ns.ca/pipermail/nslug/attachments/20161030/feeb5ab4/attachment.html>


More information about the nSLUG mailing list