Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
rossiOffline
Post subject: grub is broken ... help  PostPosted: 18.09.2010, 19:38



Joined: 2010-09-13
Posts: 35
Location: New York City
Status: Offline
Hello:

I performed the conversion successfully to aptosid.

I shutdown the system.

It came up fine.

Then I ran the command
      Code:
upgrade-from-grub-legacy


and somehow broke grub. The system won't boot now.

Is there a way to fix grub?

I have booted off a cd and performed the command

      Code:
mount /dev/sda1 /media/sda1


I am there now, but I am not sure what to do.

Please help.

Regards,

Angelo
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
rossiOffline
Post subject: RE: grub is broken ... help  PostPosted: 18.09.2010, 19:52



Joined: 2010-09-13
Posts: 35
Location: New York City
Status: Offline
This is what is in the /media/sda1/boot/grub file

root

title Debian GNU/Linux, kernel 2.6.34-0.slh.11-sidux-686
root (hd0,0)
kernel /boot/vmlinuz-2.6.34-0.slh.11-sidux-686 root=UUID=f1f5f2c3-dd08-4e10-b6f6-7729d8815eb6 ro quiet vga=791
initrd /boot/initrd.img-2.6.34-0.slh.11-sidux-686

title Debian GNU/Linux, kernel 2.6.34-0.slh.7-sidux-686
root (hd0,0)
kernel /boot/vmlinuz-2.6.34-0.slh.7-sidux-686 root=UUID=f1f5f2c3-dd08-4e10-b6f6-7729d8815eb6 ro quiet vga=791
initrd /boot/initrd.img-2.6.34-0.slh.7-sidux-686

title Debian GNU/Linux, kernel memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
rossiOffline
Post subject: RE: grub is broken ... help  PostPosted: 18.09.2010, 19:54



Joined: 2010-09-13
Posts: 35
Location: New York City
Status: Offline
This is what is in the /media/sda/boot sub-directory:
root@sidux:/media/sda1/boot# ls
config-2.6.34-0.slh.11-sidux-686 initrd.img-2.6.35-4.slh.14-aptosid-686 System.map-2.6.34-0.slh.11-sidux-686
config-2.6.35-4.slh.14-aptosid-686 memtest86+.bin System.map-2.6.35-4.slh.14-aptosid-686
grub memtest86+_multiboot.bin vmlinuz-2.6.34-0.slh.11-sidux-686
initrd.img-2.6.34-0.slh.11-sidux-686 message vmlinuz-2.6.35-4.slh.14-aptosid-686
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
muchan
Post subject: RE: grub is broken ... help  PostPosted: 18.09.2010, 20:21
Moderator


Joined: 2010-09-11
Posts: 468

from the aptosid manual:

Using chroot to recover an overwritten or corrupted Grub in the MBR
http://manual.aptosid.com/en/sys-admin- ... htm#chroot

or, if you're italian, as your name would suggest:

Utilizzare chroot per ripristinare un Grub2 corrotto o cancellato nell'MBR
http://manual.aptosid.com/it/sys-admin- ... htm#chroot
 
 View user's profile Send private message  
Reply with quote Back to top
rossiOffline
Post subject: Re: RE: grub is broken ... help  PostPosted: 18.09.2010, 21:00



Joined: 2010-09-13
Posts: 35
Location: New York City
Status: Offline
      muchan wrote:
from the aptosid manual:

Using chroot to recover an overwritten or corrupted Grub in the MBR
http://manual.aptosid.com/en/sys-admin- ... htm#chroot

or, if you're italian, as your name would suggest:

Utilizzare chroot per ripristinare un Grub2 corrotto o cancellato nell'MBR
http://manual.aptosid.com/it/sys-admin- ... htm#chroot


Hello:

This what I get

root@sidux:/# apt-get install --reinstall grub-pc
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 1,011kB of archives.
After this operation, 0B of additional disk space will be used.
Err http://ftp.us.debian.org/debian/ unstable/main grub-pc i386 1.98+20100804-4
Could not resolve 'ftp.us.debian.org'
Failed to fetch http://ftp.us.debian.org/debian/pool/ma ... 4_i386.deb Could not resolve 'ftp.us.debian.org'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Also,

the command
      Code:
mount -t devpts devpts /mnt/aptosid-chroot/dev/pts

doesn't work.

I am using an older sidux distribution on cd as the "recovery disk"
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
muchan
Post subject: RE: Re: RE: grub is broken ... help  PostPosted: 18.09.2010, 23:00
Moderator


Joined: 2010-09-11
Posts: 468

first, if mount command did not worked, no sense trying the command (apt-get install --reinstall...).

If manual has a problem, I can't say for sure, but I'd suggest (reading 'man mount')

first create the directories to mount.
mkdir /mnt/aptosid-chroot
mkdir /mnt/aptosid-chroot/proc
mkdir /mnt/aptosid-chroot/dev

then as manual:
mount /dev/sda1 /mnt/aptosid-chroot

then change the order of mount:
mount -t proc proc /mnt/aptosid-chroot/proc
mount -o bind /dev /mnt/aptosid-chroot/dev
mount -t devpts devpts /mnt/aptosid-chroot/dev/pts

I don't find "-o bind" in man mount, I see --bind. so maybe I'd try
mount --bind /dev /mnt/aptosid-chroot/dev
then
mount -t devpts devpts /mnt/aptosid-chroot/dev/pts

(correct me if I'm wrong here)


for the problem of:
Could not resolve 'ftp.us.debian.org'

(edit. when chroot was successful, you may first try grub-pc without reinstalling...
that is
# dpkg-recongigure grub-pc
)

1. do you have network connected?

2. DNS problem? check 'ping ftp.us.debian.org' (I get 149.20.20.135)
(Ctrl+C to stop the ping)

3. if not solved. -- ping does not get reply

if you have network:
change us to ca in /etc/apt/sources.list.d/debian.list
http://ftp.us.debian.org/debian/ -> http://ftp.ca.debian.org/debian/

if you don't have network,
on other PC on network, download the current grub-pc package from
http://packages.debian.org/sid/grub-pc (near end of the page) for your
architecture (i.e. now grub-pc_1.98+20100804-4_i386.deb)
copy it on somewhere in above chroot environment, move to that folder
dpkg -i grub-pc_1.98+20100804-4_i386.deb

(here also, correct me if I'm wrong here above)
 
 View user's profile Send private message  
Reply with quote Back to top
bluewaterOffline
Post subject:   PostPosted: 19.09.2010, 10:04
Team Member


Joined: 2010-08-26
Posts: 58
Location: Hobart, Australia
Status: Offline
mount -o allows for you to also use dh -h in a chroot environment. --bind then using df -h will leave you scratching your head as to where everything else is.

mount -o bind is de rigueur when using a rescue ISO

_________________
If all else fails, get the instructions back out of the rubbish bin and read them. http://manual.aptosid.com/
 
 View user's profile Send private message  
Reply with quote Back to top
rossiOffline
Post subject: Re: RE: Re: RE: grub is broken ... help  PostPosted: 19.09.2010, 11:47



Joined: 2010-09-13
Posts: 35
Location: New York City
Status: Offline
      muchan wrote:
first, if mount command did not worked, no sense trying the command (apt-get install --reinstall...).

If manual has a problem, I can't say for sure, but I'd suggest (reading 'man mount')

first create the directories to mount.
mkdir /mnt/aptosid-chroot
mkdir /mnt/aptosid-chroot/proc
mkdir /mnt/aptosid-chroot/dev

then as manual:
mount /dev/sda1 /mnt/aptosid-chroot

then change the order of mount:
mount -t proc proc /mnt/aptosid-chroot/proc
mount -o bind /dev /mnt/aptosid-chroot/dev
mount -t devpts devpts /mnt/aptosid-chroot/dev/pts

I don't find "-o bind" in man mount, I see --bind. so maybe I'd try
mount --bind /dev /mnt/aptosid-chroot/dev
then
mount -t devpts devpts /mnt/aptosid-chroot/dev/pts

(correct me if I'm wrong here)


for the problem of:
Could not resolve 'ftp.us.debian.org'

(edit. when chroot was successful, you may first try grub-pc without reinstalling...
that is
# dpkg-recongigure grub-pc
)

1. do you have network connected?

2. DNS problem? check 'ping ftp.us.debian.org' (I get 149.20.20.135)
(Ctrl+C to stop the ping)

3. if not solved. -- ping does not get reply

if you have network:
change us to ca in /etc/apt/sources.list.d/debian.list
http://ftp.us.debian.org/debian/ -> http://ftp.ca.debian.org/debian/

if you don't have network,
on other PC on network, download the current grub-pc package from
http://packages.debian.org/sid/grub-pc (near end of the page) for your
architecture (i.e. now grub-pc_1.98+20100804-4_i386.deb)
copy it on somewhere in above chroot environment, move to that folder
dpkg -i grub-pc_1.98+20100804-4_i386.deb

(here also, correct me if I'm wrong here above)


That did it!!!!!!!!!

It worked!!!!!!!!!!!!!

Thank you Thank you Thank you Thank you Thank you Thank you

Thank you Thank you Thank you Thank you Thank you Thank you.

Warm regards,

Angelo Laughing
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
raidOffline
Post subject: RE: Re: RE: Re: RE: RERERE grub is broken ... help  PostPosted: 19.09.2010, 12:36



Joined: 2010-09-11
Posts: 8

Status: Offline
Tip: before resorting to a chroot, I use --root-directory like this, as superuser:

let's assume the drive to install into is /dev/sdZ, and the root partition is the first one
      Code:
mount /dev/sdZ1 /mnt

(if it had a boot partition e.g. in /dev/sdZ2 you also have to mount it in the proper place)
      Code:
mount /dev/sdZ2 /mnt/boot

then:
      Code:
grub-install --recheck --root-directory=/mnt


If the installation is not borked this should suffice, YMMV.
 
 View user's profile Send private message  
Reply with quote Back to top
bluewaterOffline
Post subject:   PostPosted: 19.09.2010, 14:40
Team Member


Joined: 2010-08-26
Posts: 58
Location: Hobart, Australia
Status: Offline
apsotid haha that is very good twist on the distro name, I will propose that name gets the royal boot (without prejudice )

Meanwhile the installation was borked , as was the problem, your post is not in context

_________________
If all else fails, get the instructions back out of the rubbish bin and read them. http://manual.aptosid.com/
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by Zafenio