LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 04-25-2010, 07:41 AM   #1
eng_mohammedmostafa
Member
 
Registered: Nov 2008
Location: Egypt
Posts: 95
Blog Entries: 1

Rep: Reputation: 15
How edit file with grub mode


Dears,,

Now i am in grub mode as following :
grub>
And i need to edit a specific file
What is the command that enable me to do this?

Thanks & regards,,
 
Old 04-25-2010, 07:49 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
I would not normally think of grub for editing files---what are you trying to do?

At the grub> prompt, enter "help" to see all the commands available. The grub manual should explain them all. ("info grub" on my system)

Last edited by pixellany; 04-25-2010 at 07:52 AM.
 
Old 04-25-2010, 08:16 AM   #3
eng_mohammedmostafa
Member
 
Registered: Nov 2008
Location: Egypt
Posts: 95
Blog Entries: 1

Original Poster
Rep: Reputation: 15
Dear ,,,

I have a problem in /etc/X11/xdm/Xsession file
Because due to previous issue i hashed the following lines
# elif [ -x /etc/X11/xinit/Xclients ]; then
# exec -l $SHELL -c "$DBUS_LAUNCH /etc/X11/xinit/Xclients"
# else

But after this i removed the hashed again but forgot to remove the hash in this line
# exec -l $SHELL -c "$DBUS_LAUNCH /etc/X11/xinit/Xclients"

Now , i can not log in with root.
So , i tried to edit this file to remove the hash using grub>

You got my point now?

Thanks & regards,,
 
Old 04-25-2010, 08:21 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Again, I am not sure about editing with GRUB, but check the manual.

I would just boot up from a Linux live CD and edit the file(s).
 
Old 04-25-2010, 09:01 AM   #5
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian, OS X
Posts: 1,266

Rep: Reputation: 99
Booting up with the CD is the best option. Get back to us if you have any problems in booting with CD.
 
Old 04-26-2010, 01:55 PM   #6
eng_mohammedmostafa
Member
 
Registered: Nov 2008
Location: Egypt
Posts: 95
Blog Entries: 1

Original Poster
Rep: Reputation: 15
If i boot with CD.
How can i edit the file while booting from CD?
 
Old 04-26-2010, 02:39 PM   #7
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
The typical Linux Live CD will have a variety of editors. Running from the Live CD, simply mount the partition of interest, navigate to the file, and open it with an editor.

Example: Suppose you need to edit /etc/X11/xorg.conf on /dev/sda3

Code:
cd /mnt
mkdir something
mount /dev/sda3 something
cd something
nano etc/X11/xorg.conf
Note that there is no "/" before etc. If you put it in, you would go to /etc for the liveCD OS. You need to be in /mnt/something/etc/X11/xorg.conf
 
Old 04-26-2010, 04:05 PM   #8
eng_mohammedmostafa
Member
 
Registered: Nov 2008
Location: Egypt
Posts: 95
Blog Entries: 1

Original Poster
Rep: Reputation: 15
Dear,,

First , You should know that i am now cannot log in graphical mode.
Second , you mean that i will start the machine and make it booting from CD?
If yes , how can i order the boot to tell the machine that it will be boot from CD?
 
Old 04-26-2010, 04:08 PM   #9
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
There is typically a setting in the BIOS configuration to enable booting from CD or DVD.

to get into the BIOS configuration, there is a key you must press during the POST (right after re-start). sometimes it is "DEL", and sometimes one of the F-keys. (It should tell you as it is starting up.)
 
Old 04-26-2010, 04:40 PM   #10
eng_mohammedmostafa
Member
 
Registered: Nov 2008
Location: Egypt
Posts: 95
Blog Entries: 1

Original Poster
Rep: Reputation: 15
Yes , you are true
F2 enable me to get into the BIOS configuration.
Now , i booted from CD but the following appear to me:
boot:
How can i go to the file i need to edit from boot:
 
Old 04-26-2010, 06:16 PM   #11
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
ummmmm.....

First, I assume you are booting from a Linux Live CD which is known to be good. (If in doubt, try it in another computer).

Tell us exactly what happens when attempting to boot the CD. For example, after the POST, you should see (and hear) activity on the CD Drive, and some kind of message indicating what is happening. If you see your normal Linux bootloader (grub) screen, then it means the CD did not boot.

Also, try booting the computer with some other CD.

Last edited by pixellany; 04-26-2010 at 06:17 PM.
 
Old 04-26-2010, 06:50 PM   #12
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
While you can't presently boot up in graphical mode, you probably can log into one of the virtual terminals, e.g. entering CTRL-ALT-F2 for vt/2. From there you can edit the files using vim, emacs or another text editor.

You should not be logging into your desktop environment as root in the first place. It is a dangerous policy to do so. But you may need to correct your configuration to allow graphically logging on as a regular user as well.

If you use a Live Linux CD to boot up, you are operating off a CD and memory. The fileystems on the computer's Hard Disks need to be mounted. After that, you can edit the file you want. The Knoppix live CD will create mount points for each partition under /mnt/ and will create entries in /etc/fstab that will allow you to mount them easily.

Please provide information about which distribution you are using. Some such as RHEL and Fedora use LVM2 by default . If this is the case, you may need to run a command to create the device nodes for the Logical Volumes of the LVM2 array. It really depends on what live distro you are using. It may create the device nodes of the Logical Volumes automatically, running this command when you boot up.
 
Old 04-26-2010, 06:52 PM   #13
eng_mohammedmostafa
Member
 
Registered: Nov 2008
Location: Egypt
Posts: 95
Blog Entries: 1

Original Poster
Rep: Reputation: 15
Dear,,

Boot from CD already success and it gave me the following messages:

To install or upgrade in graphical mode press enter
To install or upgrade in text mode press linux text
Use the function keys listed below for more information
F1 Main F2 options F3 General F4 kernel F5 Rescue
boot:

The question now , How can i go to the file i need to edit from boot: ?
 
Old 04-27-2010, 06:46 AM   #14
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
When I said "Linux Live CD", I meant a CD with an option to run Linux from the CD without installing. This does not appear to be what you have.

Regardless, you may be able to use this......Try entering ctlr-alt-F1 (or maybe F2 or F3) and see if you can get a terminal. If so, then you can proceed with my earlier instructions.

Otherwise, get yourself a Linux Live CD as I have defined it above. Most of the mainstream distros come this way now, but Knoppix is always a good thing to have.
 
Old 04-27-2010, 07:38 AM   #15
eng_mohammedmostafa
Member
 
Registered: Nov 2008
Location: Egypt
Posts: 95
Blog Entries: 1

Original Poster
Rep: Reputation: 15
Ok ,

I am using Oracle Enterprise Linux 32-bit
Please , from where can i get Linux Live CD for it?
Please , provide it to me ASAP.

Last edited by eng_mohammedmostafa; 04-27-2010 at 09:41 AM.
 
  


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
edit grub file lock out... OldBucko Linux - Newbie 1 10-17-2009 05:09 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 05:40 PM.

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