Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Grub doesn't appear for a multiboot Debian & Wndows Xp

Posted on 2012-09-06
19
Medium Priority
?
655 Views
Last Modified: 2013-01-29
Hi,

I had a pc with Xp installed and I install Debian on it and everything
was good because Linux installed Grub Legacy.
I was able to boot on Grub and choice between Linux and Windows.

But now when a boot my pc I have a black screen asking me to press a key
when boot device is choice

I had in sda7 my linux root
and in sda1 the windows XP

So the only way that I can boot is on Windows by set the boot flag on sda1 with Gparted.

How can I resolve this multiboot problem is my menu.lst grub configuration faulty

I attached the menu.lst of grub and information about my present system on this pc.

When I had this problem the config of menu.lts of grub was like this:

..
root            (hd0,5)
kernel            /boot/vmlinuz-2.6.18-6-686 root=/dev/sda6 ro
..

I changed to :

..
root            (hd0,6)
kernel            /boot/vmlinuz-2.6.18-6-686 root=/dev/sda7 ro
..

Because my Linux is on sda7 but it still fails to boot.


I retrieve some info about my system with a repair-boot-cd (see attachment)
I'm afraid to loose my linux partition, so I had already save my 512 bytes MBR
but is it enough to restore a lost partition ?

How it will be possible to get back multiboot, is this with the menu.lst of grub ?
what is for chainloader      +1 ?

Thank you
Boot-Info-2012-09-05--21h56.txt
menu.lst
0
Comment
Question by:Develprog
  • 10
  • 9
19 Comments
 
LVL 44

Assisted Solution

by:Darr247
Darr247 earned 2000 total points
ID: 38374558
Most modern Debian builds (e.g. Ubuntu) are using grub2, not legacy grub.

What happens if you press a Shift key during the POST screen and hold it down for a minute or so?

And what does it say when you run
$ sudo update-grub
and enter your user password?
0
 

Author Comment

by:Develprog
ID: 38379368
Hi,

I have set the boot flag into into my Linux partition (sda7) and during my computer opening I press 'shift' button but I still can't boot on it I have this message on black screen :

"Reboot and select proper Boot Device
or insert Boot Media in selected Boot Device an press a key"


The problem is that I can't boot into my Linux partition (sda7) in which I have a Debian distrubition (and for this version it was Grub Legacy) to run the command:
$ sudo update-grub


So I decided to use a repair cd named "Rescatux" that include Gparted, Super Grub2 Disk)
when booting with this I do an "Update Grub configuration"  and it ask my which partition

- sda7
- loop

So I choose sda7 and update was good done but when I reboot I still have
the same message  and grub doesn't appear and I can nor run my Debian.

I don't have internet connected to this pc, so What can I do ?
Knoppix or other ?

Thanks
0
 
LVL 44

Expert Comment

by:Darr247
ID: 38380255
$ sudo update-grub is a grub2 command.

Do you have a bootable Debian install disk?

You should be able to reinstall grub, if not repair it, using the Debian install disk.
The SuperGrub disk should be able to do it, too... but I don't know my way around its GUI.


Follow the instructions at http://www.debian.org/releases/stable/i386/ch08s07.html to get to a prompt (select /dev/sda7 for the location of your linux install)... in the shell, run the commands.

$ sudo grub
grub> root (hd0,6)
grub> setup (hd0)
grub> quit
$ exit

When it reboots you should get your grub menu again.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:Develprog
ID: 38381552
I think so with supergrub disk but if I remember it recommend to backup data before
install grub.. Is it possible to lose the sda7 partition although I have a img of sda MBR ?

So I decided to look to other solution, without risk.

>>When it reboots you should get your grub menu again.
Will Grub take care about the existant Windows XP partition ?

Thanks
0
 
LVL 44

Expert Comment

by:Darr247
ID: 38381792
> Is it possible to lose the sda7 partition although I have a img of sda MBR ?

It's possible to do that without repairing grub... repairing grub should not do anything to your partition structure, though.

Microsoft actually recommends you do a complete backup of your system before applying the monthly updates they issue, too.

> Will Grub take care about the existant Windows XP partition ?
You have your menu.lst backed up (it's attached to the first message, above), and it should work as it did before once the grub setup directs the MBR to make a pointer at grub in /dev/sda7/boot/grub/ again.
0
 

Author Comment

by:Develprog
ID: 38401597
So I tried with a Debian Install Cd by booting in recovery mode.

So I choose to install grub but the tool doens't propose me location like /dev/sdaX
but strange thing like loop.. part1, loop0....part2 -> part7

Anyway I found the way with prompt command but after installing grub on sda7, the recovery tool ask me to partition the disk for sure I don't partition it and so I finished at this step.

When rebooting still this message:
"Reboot and select proper Boot Device
or insert Boot Media in selected Boot Device an press a key"

Which tool must I used and how ?

thanks
0
 
LVL 44

Expert Comment

by:Darr247
ID: 38402121
If you followed the instructions at http://www.debian.org/releases/stable/i386/ch08s07.html you should have been chroot'd into the hard drive's file system, not looped to the CD.

Then the grub setup would have been done on hd0, with hd0,6 selected as grub's root.

Is that what you did?
0
 

Author Comment

by:Develprog
ID: 38403231
Hi,

For now it is ok for grub I have
it on boot the problem was that
I tried to grub install but with no correct mounts
so I made this with the Debian install cd and when
at point of partitioning I opened a new consol (ALT+F2)
Than I did what you said and now I have the Grub.

But unfortunatly when in grub a choose my system
it shows me a error 17

"
    Booting 'Debian GNU/Linx, kernel 2.6.18-6-686'

root (hd0,5)
  Filesystem type unknown, partition type 0x082
kernel  /boot/vmlinuz-2.6.18-6-686 root=/dev/sda6 ro acpi=off

Error 17: cannot mount selected partition
"

But it seems strange because I run these commands:
$ sudo grub
grub> root (hd0,6)
grub> setup (hd0)
grub> quit
$ exit

So again I used Rescatux to update grub configuration to sda7 but still same error.

So what is wrong ?
0
 
LVL 44

Expert Comment

by:Darr247
ID: 38403409
82 is type linux swap.  That's not a bootable partition.

Edit menu.lst and change
root (hd0,5)
to
root (hd0,6)
0
 

Author Comment

by:Develprog
ID: 38420082
Hi,

I did like you say change:
root (hd0,5)
to
root (hd0,6)

Seems ok when in grub boot, I choose  my system
but just after severals auto scripting the system hangt
in initramfs, and the errors I see are in mount procedure
sda6  no such file or directory.

In the menu.lst I see  something like
root            (hd0,6)
kernel            /boot/vmlinuz-2.6.18-6-686 root=/dev/sda6 ro

So I change sda6 to sda7 ?

After reboot the system boot doesn't hangt  
but show that Activating swap... failed
and after that it has perform a check on root then reboot

Now I'm happy to see my Linux destkop :) it is ok but at each boot I see:
Activating swap... failed

How fix it ?
0
 

Author Comment

by:Develprog
ID: 38420111
Ok the system runs well
but when I perform a shutdown

it runs severals scripts :

     Shutting down ALSA ... done.
     ...
     Stopping NFS common utilities: statd.
     ...
     Will now halt.
     Syncronizing SCSI cache for fdisk sda:
     usb 1-2: new ....
     .....
     System halted.

but at this point it fails:
      ....
      hub 1-0:1.0: hub_port_status failed (err = -108)

what would be the problem ?

Because I performed this command: mount -t ext3 /dev/sda1 /mnt
to change my menu.lst after doing job I do a: umount /mnt/boot
but this last command does not run well.
Is the problem due to not perform a unmount?



Thanks
0
 
LVL 44

Expert Comment

by:Darr247
ID: 38420423
All it should take is
# umount /mnt
not
# umount /mnt/boot

i.e. you umount the same point that was mounted


What does your /etc/fstab file contain?
e.g.
# cat /etc/fstab
0
 

Author Comment

by:Develprog
ID: 38424669
I tried too umount /mnt ..

In my current Debian system
When trying acces to my  Windows partitions,
I have these messages box:

' hal-storage-fixed-mount refused uid 1000 '

Which seems normal when I look at
the etc/fstab:

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/sda6       /               ext3    defaults,errors=remount-ro 0       1
/dev/sda7       none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0


so my windows partition are in sda1 and sda5 how to add in the fstab ?

Thanks
0
 
LVL 44

Expert Comment

by:Darr247
ID: 38425080
Hmmm... something's not making sense; please show us the output from
# fdisk -l
(that's a lower case L, as in list)... or
$ sudo fdisk -l
0
 

Author Comment

by:Develprog
ID: 38426173
the content is:

root:/home/user# fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1       22556   181181038+   7  HPFS/NTFS
/dev/sda2           22557       60801   307202962+   f  W95 Ext'd (LBA)
/dev/sda5           22557       56986   276558943+   7  HPFS/NTFS
/dev/sda6           56987       57129     1148616   82  Linux swap / Solaris
/dev/sda7   *       57130       60801    29495308+  83  Linux

Disk /dev/sdb: 2048 MB, 2048901120 bytes
64 heads, 63 sectors/track, 992 cylinders
Units = cylinders of 4032 * 512 = 2064384 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1         992     1999749+   b  W95 FAT32
0
 
LVL 44

Accepted Solution

by:
Darr247 earned 2000 total points
ID: 38426950
The file systems are backwards for /sda6 and /sda7 in the etc/fstab file.

First, change it to
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/sda6       none            swap    sw              0       0
/dev/sda7       /               ext3    defaults,errors=remount-ro 0       1
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto  0       0

Open in new window

Then, if you really want to mount the NTFS partitions so they're accessible while you're in linux, you need to have ntfs-3g* installed.

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install ntfs-config

Installing ntfs-config should install the other parts of ntfs-3g you need too.

After it's installed, run
$ sudo ntfs-config

That should let you choose what NTFS partitions you want to setup for access, whehter you want to allow write access or not, etc, and it should make an entry in fstab for you.



After that, you could edit fstab to change it to use the partition's UUID instead of the partition name, but that's not required. e.g. from one of my fstab files
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
#Entry for /dev/sda1 :
UUID=924CA33A4CA3184D	/media/Win7_C	ntfs-3g	defaults,locale=en_US.UTF-8	0	0
#Entry for /dev/sda2 :
UUID=80a09b26-64cb-4753-b8dd-438c2f66f4c3	/boot	ext4	defaults	1	2
#Entry for /dev/sda3 :
UUID=36c9a350-d35e-4cbc-93c9-5d8493188c2a	/	ext4	defaults	1	1
#Entry for /dev/sda5 :
UUID=e952fd79-5365-457e-8971-350e69d9b32d	swap	swap	defaults	0	0
192.168.1.208:/Temp /media/Temp  nfs rw,defaults 1 1
#//192.168.1.128/T     /media/MBW1             cifs    rw,gid=0,uid=0,mode=0755              0 0
//192.168.1.129/U     /media/MBW2             cifs    rw,gid=500,uid=500,mode=0755,pass=password      0 0

Open in new window

Find UUID's with the blkid command
$ blkid
/dev/sda1: UUID="924CA33A4CA3184D" LABEL="Win7_C" TYPE="ntfs"
/dev/sda2: UUID="80a09b26-64cb-4753-b8dd-438c2f66f4c3" TYPE="ext4"
/dev/sda3: UUID="36c9a350-d35e-4cbc-93c9-5d8493188c2a" TYPE="ext4"
/dev/sda5: UUID="e952fd79-5365-457e-8971-350e69d9b32d" TYPE="swap"
 
Using the UUIDs instead means if the partition number changes, such as could happen if you add another hard drive, or added another partition, the partition would still mount in the same place, because the UUID shouldn't change unless you delete the partition with which it's associated.
0
 

Author Comment

by:Develprog
ID: 38434834
I have done changes  concerning the etc/fstab file.

And after reboot I have still the same problem.

  hub 3-0:1.0: hub_port_status failed (err = -108)
 ....



I remember to access to windows partition easyly, is there other solution to load, at boot, windows partition without installing  ntfs-3g?

Thank you
0
 
LVL 44

Expert Comment

by:Darr247
ID: 38435490
Anything else you install to mount the windows partition is likely going to use ntfs-3g in order to mount that NTFS partition.
0
 

Author Comment

by:Develprog
ID: 38439209
Ok,

So the answer to problem is solved but one unexpected
thing is that  when shutdowing the pc has still this error -108 message and pc
dos not shutdown.

Thanks
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Often times it's very very easy to extend a volume on a Linux instance in AWS, but impossible to shrink it. I wanted to contribute to the experts-exchange community a way of providing a procedure that works on an AWS instance. It can also be used on…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question