DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
soo.. how do i get to this menu? ..all i have is a grub recovery prompt.
Since you can access fd0 let's start from this. Type line by line followed by ENTER. Pay attention to output, if there is error do not continue.
checking partition in floppy
Code:
ls (fd0)
let's assume there is part 1 in floppy and then try to load configfile to show menu. configfile requires configfile.mod hence setting prefix is needed.
Code:
set prefix=(fd0,1)/boot/grub/i386-pc
configfile (fd0,1)/boot/grub/grub.cfg
try to boot Debian 6.0
Code:
set prefix=(fd0,1)/boot/grub/i386-pc
set root=(hd0,5)
insmod (fd0,1)/boot/grub/i386-pc/part_msdos.mod
insmod (fd0,1)/boot/grub/i386-pc/ext2.mod
insmod (fd0,1)/boot/grub/i386-pc/linux.mod
linux /boot/vmlinuz-2.6.32-5-686 root=/dev/sda5 ro
initrd /boot/initrd.img-2.6.32-5-686
boot
to make it easy typing, type one or two characters followed by TAB.
'ls (fd0)' returns 'error: bad filename'. 'ls (fd0,1)'/'ls (fd0,0)' returns 'error:no such partition'.
However, 'ls /' shows the contents of the floppy? (/boot and boot.catalog)
e: continued using the /boot/grub... path and 'configfile /boot/grub/grub.cfg' returns "Unknown command 'conifigfile'"
e2: if i set root=(hd0,5) at that point then i cannot (i don't know how if there is a way?) access the floppy drive again. If i set the root like that then (fd0,0/1) doesn't access it. Nor / of course. I tried using insmod before changing root but i was unable to load linux.mod; 'error: out of disk'
e3: a-ha.. so loading the other 2 modules.. then an ls shows the partitions are (then?) named like (hd0,msdos5) or (fd0,msdos1). and i can actually see the contents of the hdd for the first time with this... so if i 1) load part_msdos and ext2, then set the root to hd0,msdos5.. then try and load (fd0,msdos1)/.../linux.mod.. i get 'error: unknown filesystem' (ie on the floppy)?... update; it seems? that it wants it in the format (fd0)/.../linux.mod, however, then i still get 'out of disk'.
'ls (fd0)' returns 'error: bad filename'. 'ls (fd0,1)'/'ls (fd0,0)' returns 'error:no such partition'.
However, 'ls /' shows the contents of the floppy? (/boot and boot.catalog)
e: continued using the /boot/grub... path and 'configfile /boot/grub/grub.cfg' returns "Unknown command 'conifigfile'"
e2: if i set root=(hd0,5) at that point then i cannot (i don't know how if there is a way?) access the floppy drive again. If i set the root like that then (fd0,0/1) doesn't access it. Nor / of course. I tried using insmod before changing root but i was unable to load linux.mod; 'error: out of disk'
e3: a-ha.. so loading the other 2 modules.. then an ls shows the partitions are (then?) named like (hd0,msdos5) or (fd0,msdos1). and i can actually see the contents of the hdd for the first time with this... so if i 1) load part_msdos and ext2, then set the root to hd0,msdos5.. then try and load (fd0,msdos1)/.../linux.mod.. i get 'error: unknown filesystem' (ie on the floppy)?... update; it seems? that it wants it in the format (fd0)/.../linux.mod, however, then i still get 'out of disk'.
You know how it works now, however you did it backwards. set prefix, set root, insmod, etc. (fd0) is drive not partition. (When you cannot go or find some error with 'ls' just use set prefix=/boot/grub/i386-pc to go back to default.)
to access modules within the floppy you can
set prefix=/boot/grub/i386-pc --> use this before typing anything
or
set prefix=(fd0,1)/boot/grub/i386-pc --> it seems only available after you insmod-ing part_msdos
--------------------------------------------
after you can 'ls (hd0,5)' or 'ls (hd0,msdos5)' you no longer need (fd0,1), instead try following:
insmod /boot/grub/i386-pc/part_msdos.mod --> this is perhaps already loaded
insmod /boot/grub/i386-pc/ext2.mod --> this is perhaps already loaded
insmod /boot/grub/i386-pc/linux.mod --> this is needed to load linux/kernel
linux /boot/vmlinuz-2.6.32-5-686 root=/dev/sda5 ro
initrd /boot/initrd.img-2.6.32-5-686
boot
--------------------------------------------
or
just type
insmod /boot/grub/i386-pc/configfile.mod --> here we need to load configfle.mod
configfile /boot/grub/grub.cfg
I was doing it in different order because it wasn't working.. and it definately only works with (fd0).. 'ls (fd0,1)/'/'ls (fd0,msdos1)/' gives 'unknown filesystem', but 'ls (fd0)/' shows contents. Anyway, i don't think it can find /i386-pc in /boot/grub/ (atleast not /i386-pc/linux.mod) on hd0,5. I have too many contents to see them all with 'ls (hd0,msdos5)/boot/grub/'.. is there any way to show only part of the ouput/result in this enviroment??
I was doing it in different order because it wasn't working.. and it definately only works with (fd0).. 'ls (fd0,1)/'/'ls (fd0,msdos1)/' gives 'unknown filesystem', but 'ls (fd0)/' shows contents. Anyway, i don't think it can find /i386-pc in /boot/grub/ (atleast not /i386-pc/linux.mod) on hd0,5. I have too many contents to see them all with 'ls (hd0,msdos5)/boot/grub/'.. is there any way to show only part in this enviroment??
I see after you ls you got /boot and boot.catalog.
You are now in floppy we should not go further to hd0,5 (if you insist to go to, grub files are available in /boot/grub/). I found something missing in that directory, so please stay in floppy. Here you will find /boot/grub/i386-pc
Distribution: Debian Testing, Stable, Sid and Manjaro, Mageia 3, LMDE
Posts: 2,628
Rep:
Quote:
Originally Posted by hurry_hui
I see after you ls you got /boot and boot.catalog.
You are now in floppy we should not go further to hd0,5 (if you insist to go to, grub files are available in /boot/grub/). I found something missing in that directory, so please stay in floppy. Here you will find /boot/grub/i386-pc
I am sorry I cannot write clearly. English is not my tongue.
HTH
While I am not sure what language you do speak, I know your English is a lot better than I would be in yours. You certainly are getting your point across well enough that progress is being made.
Are you now getting a grub recovery prompt when booting from the hard drive? If so try this:
I don't think it will work, but might be worth a try, you never know.
Quote:
insmod ext2
set root=(hd0,5)
kernel /boot/grub/core.img
boot
@widget:
Many thanks for your support. Btw, I am Indonesian.
@OP:
Let's do this differently.
The way grub2 works is every command needs certain module. To access each modules, grub2 needs to find path to the modules. In our case, (I am assuming) it is '(fd0)/boot/grub/i386-pc/'. To see what grub2 sees we need to run 'set' command.
Pay attention to this. After typing each command, sometimes grub2 changes its settings; hence you cannot continue typing certain line.
Before we move on, check what is the output of 'set' and 'ls' and write them down. If 'set' generates '(fd0)/boot/grub/i386-pc/' (or as resulted from first 'set' command) and 'ls' generates '/boot boot.catalog', we can continue typing.
In a case where such output is different then we need to reset 'set prefix=(fd0)/boot/grub/i386-pc/' (or as resulted from first 'set' command). And recheck whether 'ls' generates '/boot boot.catalog' output.
If both results are matched, we can continue issuing command as previously posted.
HTH
PS:
To fix 'out of disk' message.
Code:
insmod ata
update_paths
Last edited by hurry_hui; 12-14-2011 at 08:23 PM.
Reason: Rearrange sentences
Here is what is happening... please ask if anything is not 100% clear
i load part_msdos and ext2 with insmod. Works. 'ls' (not 'ls /'!) shows (hd0,msdos1), (hd0,msdos5), (fd0) etc.
LOAD LINUX;
'insmod linux' (from floppy) = 'error: out of disk'
TRY FIX;
'insmod ata' = 'error: no device connected'.
Now 'ls' (not 'ls /'!) shows (ata0,msdos1), (at0, msdos5), (ata2) etc. Cannot access floppy by 'ls (ata2)/' ('error: ATAPI read error.' -- note external USB floppy drive) Same with '(ata2,msdos1)'.
'ls (fd0)/' or 'ls /' = 'error: no such disk'. Same with (fd0,msdos1). SO-- AFTER 'insmod ata' CANNOT ACCESS FLOPPY.
TRY TO LOAD linux.mod from HDA5;
'insmod (ata0,msdos5)/boot/grub/i386-pc/linux.mod' (OR 'hd0' without 'insmod ata') = 'error: file not found
'ls (ata0,msdos5)/boot/grub/i386-pc' = 'error: file not found'
'ls (ata0,msdos5)/boot/grub' gives more items than fit on the screen. There is a 'linux.mod' file. If i run 'insmod (ata0,msdos5/boot/grub/linux.mod' = 'error: incompatible licence'.
From the output, this means we can start insmod-ing without setting prefix.
Lets's try to load configfile.
Code:
insmod configfile
configfile /boot/grub/grub.cfg
This (if runs properly) will bring you grub2 menu. You can then choose 'Detect any OS' menu.
-------------
Following quote added by OP while I am editing post and testing some commands. I added dashes for easy reading.
Quote:
Here is what is happening... please ask if anything is not 100% clear
i load part_msdos and ext2 with insmod. Works. 'ls' (not 'ls /'!) shows (hd0,msdos1), (hd0,msdos5), (fd0) etc.
-(1)------------
LOAD LINUX;
'insmod linux' (from floppy) = 'error: out of disk'
-(2)------------
TRY FIX;
'insmod ata' = 'error: no device connected'.
Now 'ls' (not 'ls /'!) shows (ata0,msdos1), (at0, msdos5), (ata2) etc. Cannot access floppy by 'ls (ata2)/' ('error: ATAPI read error.' -- note external USB floppy drive) Same with '(ata2,msdos1)'.
'ls (fd0)/' or 'ls /' = 'error: no such disk'. Same with (fd0,msdos1). SO-- AFTER 'insmod ata' CANNOT ACCESS FLOPPY.
-(3)------------
TRY TO LOAD linux.mod from HDA5;
'insmod (ata0,msdos5)/boot/grub/i386-pc/linux.mod' (OR 'hd0' without 'insmod ata') = 'error: file not found
-(4)------------
'ls (ata0,msdos5)/boot/grub/i386-pc' = 'error: file not found'
'ls (ata0,msdos5)/boot/grub' gives more items than fit on the screen. There is a 'linux.mod' file. If i run 'insmod (ata0,msdos5/boot/grub/linux.mod' = 'error: incompatible licence'.
-(4a)-----------
(1) Works as expected.
(2) This is weird. Perhaps this because grub2 need full path to linux (i.e., (fd0)/boot/grub/i386-pc/)
(3) Insmod ata takes you to (ata2) (do everything with ata2). Every reference to (ata2) is similar to (fd0)/ (that is root of floppy). This time you can no longer access floppy, which is as intended. Type 'set' again to check path.
(3a) 'update_paths' is needed to reset path to new path--that is (ata2).
(4) This path does not exist. You have /boot/grub/ on hdd to access grub2 modules.
(4a) 'incompatible licence'--I am not sure; this might refer to different version of grub2.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.