LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices

Reply
 
Search this Thread
Old 06-10-2010, 09:34 AM   #1
san4fun2004
LQ Newbie
 
Registered: Jun 2010
Posts: 1

Rep: Reputation: 0
How to edit a file in grub mode


I was having windows 7 and fedora linux 12 in dual. My windows crashed and i cant even go to the recovery console. After booting it just goes to the grub what ever key i press (other than f2 for bios). So i thought of editing the /boot/grub/menu.lst file and changed the values. After rebooting, i still cant go the windows recovery console. Also if i press some other key its showing the grub option, when i try to boot to the linux, it says 'unable to mount'. I tried using live cd to edit the menu.lst file back to the original values, but when i open that file, it shows nothing. When i see in grub mode (after rebooting, going to grub options) i can see the file with all the details. How can i edit the file from grub mode? I tried help in grub mode, i am not sure what command to use exactly. Can anyone help on this.

Thanks in advance.

Last edited by san4fun2004; 06-10-2010 at 10:21 AM.
 
Old 06-10-2010, 10:28 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,397

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
you don't need to edit it, just enter your boot parameters directly in the grub shell.
 
Old 06-10-2010, 11:51 AM   #3
rikijpn
Member
 
Registered: Jun 2007
Location: Japan
Distribution: Debian lenny, DSL, Solaris 10
Posts: 157

Rep: Reputation: 33
Assuming your hard disk is not the problem, when the grub screen appears, press "c" to get into grub's prompt and type...
Code:
root (hd0,0) #change as needed to your windows partition
makeactive
chainloader   +1
boot
 
Old 06-11-2010, 01:44 PM   #4
Karl Godt
Member
 
Registered: Mar 2010
Location: Kiel , Germany
Distribution: once:SuSE6.2,Debian3.1, aurox9.2+3,Mandrake?,DSL? then:W7st,WVHB, #!8.10.02,PUPPY4.3.1 now:Macpup
Posts: 308

Rep: Reputation: 45
cat >> does not work at grub1 to write into menu.lst

It might not be possible to write into /boot/grub/menu.lst
from grub1 shell :

Code:
grub> cat >> /boot/grub/menu.lst

Error 12: Invalid device requested

grub> root (hd0,0)

grub> cat >> /boot/grub/menu.lst

Error 1: Filename must be either an absolute pathname or blocklist
try :
Code:
grub> find (hd0,0)/boot/TAB
 Possible files are: grub vmlinuz

grub> find (hd0,0)/boot/grub/TAB
 Possible files are: e2fs_stage1_5 fat_stage1_5 jfs_stage1_5 minix_stage1_5 rei
serfs_stage1_5 stage1 stage2 stage2_eltorito xfs_stage1_5 usage.txt mbr.sda.310
82 device.map menu.lst

grub> cat (hd0,0)/boot/grub/menu.lstENTER
to see if it is still there
also:
Code:
grub> geometry (hd0,0)
drive 0x80: C/H/S = 527/255/63, The number of sectors = 8467200, /dev/sda
   Partition num: 0,  Filesystem type is ext2fs, partition type 0x83
   Partition num: 1,  Filesystem type unknown, partition type 0x82
REMEMBER most LiveCD/DVD start up to $-user mode
to turn to #-user mode differs a lot
try sudo , su or su root
sudo bash etc. for root xterm/console
sudo editor for rw ability at gedit/leafpad etc.
sudo filemanager for pcmanfm/thunar etc.
(hope that helps)
btw : what were you running last at windows and fedora 12
did you had some update to f 13 as it is released for the moment
it still looks like fedora uses grub 1 for grub 2 is being introduced
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How edit file with grub mode eng_mohammedmostafa Linux - Software 17 04-27-2010 08:38 AM
Edit file from Rescue Mode? tdog Linux - General 3 10-29-2005 01:59 PM
Edit file in rescue mode DanielTan Linux - Newbie 1 09-19-2004 11:44 AM
Edit file in Grub Baklan Linux - Newbie 9 07-11-2003 12:14 PM
Edit a file in single-user mode ricardocastro Linux - Software 2 02-26-2002 04:37 PM


All times are GMT -5. The time now is 09:24 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration