LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Grub install f up (https://www.linuxquestions.org/questions/debian-26/grub-install-f-up-916927/)

62chevy 12-08-2011 01:43 PM

Quote:

Originally Posted by sdfi (Post 4544631)
There is no 'Reinstall the Grub Boot Loader' option under Advance options>Rescue mode on the install CD. The options are 'execute a shell in [root fs location]' 'execute a shell in installer location', change root fs, and reboot.

widget; like i said, i removed the CD from sources.list. (It has the normal online sources, and they 'hit' fine when running apt-get update.) How do i put the install CD back in sources.list?


What CD are you using because the the only one I get those in is Lenny's installer every Squeeze install gave me the option to reinstall grub.

Hmmm the live CD? Didn't try that , let me test.


EDIT: Just checked the Squeeze live DVD and it lets you reinstall Grub too.

sdfi 12-09-2011 11:41 AM

Quote:

Originally Posted by widget (Post 4545262)
I don't know how you removed it.

Yes, i deleted the lines. It was stupid, i know. What i am trying to get at is exactly what do i need to enter back in.

62chevy - It is squeeze CD 1. This.

widget 12-09-2011 02:23 PM

Use the rescue option to drop into a shell and use the command in my script, one at a time, starting with the "mkdir" line.

When you do the last line, starts with "chroot", do;
Code:

apt-get update
then the grub removal stuff and then;
[code]
apt-get install grub-pc grub-common
[code]
then, to be sure it will boot to your install;
Code:

grub-mkconfig
this will print out the /boot/grub/grub.cfg file to your terminal. Check it to see if the entry for your Debian install is there.

If so boot to it and we will get the others to boot from there (easier from there).

If it is not there then do;
Code:

update-grub
and run the mkconfig command again to check.

You should watch when grub is installed to make sure it is also installed on the MBR. You should see a line saying the install is finished with no errors (can't remember the exact wording).

If you are worried that it is not installed or not sure, run;
Code:

grub-install /dev/sda
Should do the trick.

62chevy 12-09-2011 02:35 PM

1 Attachment(s)
This a screenshot of the .iso you used.

widget 12-09-2011 05:53 PM

You should not send such good screen shots. I tried to click on the menu window to close it.

sdfi 12-10-2011 10:50 AM

Right. Done everything as suggested by widget. I got apt-get install grub-pc grub-common to work.. [i think there was a problem with my sources.list but fixed now.] Although it reported the error
Code:

error processing grub-pc (--configure):
subprocess installed post-installation script returned error exit status 255

I could only see that grub found installations on /dev/sda1 (voyage) and not /dev/sda5 (debian). I ran all your suggestions in the last post and it hasn't changed my boot situation.

Note; 'cp /etc/resolv.conf /mnt/debian-root/etc/resolve.conf' - both should be resolv.conf AFAICT.
62chevy; i only get that if i select /dev/sda1 as my root filesystem. If i pick /dev/sda5 i do not get a grub option.

62chevy 12-10-2011 12:01 PM

Quote:

Originally Posted by sdfi (Post 4546602)
Right. Done everything as suggested by widget. I got apt-get install grub-pc grub-common to work.. [i think there was a problem with my sources.list but fixed now.] Although it reported the error
Code:

error processing grub-pc (--configure):
subprocess installed post-installation script returned error exit status 255

I could only see that grub found installations on /dev/sda1 (voyage) and not /dev/sda5 (debian). I ran all your suggestions in the last post and it hasn't changed my boot situation.

Note; 'cp /etc/resolv.conf /mnt/debian-root/etc/resolve.conf' - both should be resolv.conf AFAICT.
62chevy; i only get that if i select /dev/sda1 as my root filesystem. If i pick /dev/sda5 i do not get a grub option.

That doesn't sound right something had to go wrong. Run the Debian CD again in Rescue Mode but this time do not choose a partition to work from instead choose ' Do not use a root file system ' then ' Execute a shell in the installer environment ' then ' continue ' when you get a command prompt use ' fdisk -l ' to see what partitions show up. It's possible you are mistaken on the partition number or something went wrong when you created the partition. If /dev/sda5 is there then run ' e2fsck /dev/sda5 '. Let us know how that works out for you.

widget 12-10-2011 03:38 PM

Quote:

Originally Posted by 62chevy (Post 4546649)
That doesn't sound right something had to go wrong. Run the Debian CD again in Rescue Mode but this time do not choose a partition to work from instead choose ' Do not use a root file system ' then ' Execute a shell in the installer environment ' then ' continue ' when you get a command prompt use ' fdisk -l ' to see what partitions show up. It's possible you are mistaken on the partition number or something went wrong when you created the partition. If /dev/sda5 is there then run ' e2fsck /dev/sda5 '. Let us know how that works out for you.

Yes. Do that.

sdfi 12-10-2011 03:42 PM

Quote:

Originally Posted by fdisk -l
/dev/sda1 Linux
/dev/sda2 Extended
/dev/sda5 * Linux
/dev/sda6 Linux Swap

sda5 is labelled as boot. I don't know why there is no sda3/4? or what sda2 is about.

Quote:

Originally Posted by fsck /dev/sda5
../dev/sda5 was not cleanly unmounted... [checking..] ..optimizing directories.. [more checking...]
*****FILE SYSTEM WAS MODIFIED*****
xyz/123 files, abc/def blocks


widget 12-10-2011 04:42 PM

First. Sda1 is a primary partition. You are limited to only 4 primaries. Sda2 is an extended partition. This is a type of primary partition that you can put a number of other "logical" partitions inside of.

Sda5 and sda6 are logical partition within sda2. Logical partition numbers always start with 5. You could have 4 primary partitions 1,2,3 and 4 with 4 being an extended partition. Thus 5 makes sense to start logical partition numbers with.

Try setting up grub again. Get in with the rescue disk and run, as root;
Code:

dpkg --configure grub-pc grub-common
then rerun;
Code:

update-grub
and
Code:

grub-mkconfig
check what it is picking up now.

This is interesting as other OS' are detected by /etc/grub.d/30_os-prober and the install on which grub is actually installed, Debian in this case, is detected by /etc/grub.d/10_linux. 2 different scripts for 2 different jobs.

I do not understand why one would be working and not the other. Of the two 10_linux is by far the most reliable.

sdfi 12-10-2011 05:16 PM

Well thanks for clearing up about the partitions. I'm not sure what you are hoping here as it seems i've done all that before. It wasn't clear so I tried it first by chrooting into the debian install as there was no dpkg in installer environment;

Things 'dpkg --configure grub-pc grub-common' complains about; several complaints related to no default locale, 'unkown terminal: bterm Check the TERM environment variable'
dpkg: error processing grub-pc (--configure): subprocess installed post-installation script returned error exit status 255
dpkg:error processing grub-common (--configure): package grub-common is already installed and configured

update-grub only mentions /dev/sda1

then i used /dev/sda5 as root from the installer and 'dpkg --configure grub-pc grub-common' brought up a config window, i selected to install on /dev/sda. I passed over the option of installing it to /dev/sda5... following this, still only mentions of install in /dev/sda1. I tried running it again to also add grub to /dev/sda5 but it wouldn't let me saying it was already configured.

The thing that is really bugging me about this is that grub is supposedly finding the voyage install on /dev/sda1, and yet it is still not possible to boot into even this?? Nor do i get any grub screen, just 'Hard disk boot sector invalid'.

62chevy 12-10-2011 06:15 PM

1 Attachment(s)
Go back to ' Rescue Mode ' like you did when you used the command ' fdisk -l '.

This time I want you to mount /dev/sda5 like this.

Code:

mount -t auto /dev/sda5 /mnt
Then 'cd /mnt ' and do an ' ls '.

If mount gives you an error tell us what the error is, write it down verbatim, it's important to what what error is given and why.

If no error then have a look around and see if everything is installed. Check /etc, /boot, /lib, bin, /sbin and /usr.

Some directories will be empty. If you want mount /dev/sda1 to /media and compare the two but should not be exactly the just similar.

The last thing I would like for you to do is ' df -h '. This will give the size of the partition and amount used and unused.

Code:

chevy@debian:~$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda1            114G  38G  71G  35% /
tmpfs                7.9G    0  7.9G  0% /lib/init/rw
udev                  7.9G  220K  7.9G  1% /dev
tmpfs                7.9G    0  7.9G  0% /dev/shm
/dev/sdb1            294G  170G  109G  61% /home/chevy/Storage
chevy@debian:~$


widget 12-10-2011 06:36 PM

Yes you need to be in sda5 to do anything to sda5. Glad that dpkg finally got those packages installed.

Grub has no reason to be installed on sda5 in this context. The only place for it is /sda. That puts it on the MBR.

sdfi 12-11-2011 08:29 AM

No error with mount -t auto /dev/sda5. /etc, /boot, /lib, bin, /sbin and /usr all present. df -h reports nothing that looks odd.. sda5 is using 664M of 27G.

@widget; i thought the same, just clutching at straws.

Again, why won't voyage or even grub itself boot?

widget 12-11-2011 12:19 PM

You are getting some sort of screen menu, this is a good sign.

Try to get the detailed partition info asked for in post 42.

Something else that we should have asked for long ago was for you to rerun the boot script again. Please do both of these things.

There is another thing I would like you to try that would be much easier from a Live CD for you to do. That is to add a couple entries to your /etc/grub.d/40_custom file. As both of the installs are Debian based they should work. I would not do this until you have gotten the above requested info as doing so will change some things that we need to know about the current conditions.

These are the menu entries;
Code:

echo "Adding Debian on sda5" >&2
cat << EOF
menuentry "Debian on sda5" {
    set root=(hd0,5)
        linux /vmlinuz root=/dev/sda5 ro quiet
        initrd /initrd.img
}
EOF

echo "Adding Voyage on sda1" >&2
cat << EOF
menuentry "Voyage on sda1" {
    set root=(hd0,1)
        linux /vmlinuz root=/dev/sda1 ro quiet
        initrd /initrd.img
}
EOF

After getting the partition and boot info and posting it, go to a Live Session if you can and just copy/paste these into the /etc/grub.d/40_custom file. You will have to do this as root.

After doing this you will probably find it easiest to go back to the Debian install disk to chroot back to sda5 and run;
Code:

update-grub
and then to see if they will show up;
Code:

grub-mkconfig
If they show up they you should reboot and see if they work. They should be below the entry that you currently see on your menu screen.


All times are GMT -5. The time now is 11:52 PM.