LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Screwed up boot (https://www.linuxquestions.org/questions/linux-newbie-8/screwed-up-boot-264931/)

TaNeK 12-10-2004 12:48 PM

Screwed up boot
 
Hello all

Here's the problem. Beeing the idiot I am, I managed to screw up my boot/grub/menu.list so now I cant boot my debian. This happened after a kernel upgrade. Now I'm quite sure I've found the right thing to place there, but I have no permission to write to files using knoppix :(. How can I undo this stupidity?

Thx a lot!

darkleaf 12-10-2004 12:50 PM

You should be able to write things as root in knoppix. Are you root?

BTW you can also use your debian CD as rescue disk (also with different kernels if you need). Check out the boot options.

TaNeK 12-10-2004 12:50 PM

nope, not root. any root password?

darkleaf 12-10-2004 12:55 PM

Then you need to edit the file via an terminal. Open xterm and then do
Code:

su -
It'll ask your password. Then you can change the text file with vi.
Code:

vi /path/to/file
Some basic vi commands are:
i = insert. if you hit i you'll be able to start editing the text file.
esc = to stop editing and give you the colon after which you can write commands
shift-q = exit menu
wq = save and exit

So use i then change the text. Then hit esc, shift-q, wq to save and exit

TaNeK 12-10-2004 01:06 PM

it doesn't seem to be working, I use vi as root, and it returns these errors:

E45: 'readonly' option is set (add ! to override)

so I ad !:

nothing seems to happen, i just get a new line, and if i hit enter I eventually get into the code.

cannot change anything, and when i try to quit using q, i get:

E37 No write since last time (add ! to override)

with q! nothing has changed in the file :(

TaNeK 12-10-2004 01:10 PM

also, when typing wq! time nr 2 i get:

E212: Can't open file for writing

nor can I run any program as root using "run as different user", error child terminated with 1 status :(

darkleaf 12-10-2004 01:53 PM

Can you perhaps try with the debian CD. I'm not really familiair with knoppix and I know the debian rescue cd just works. If the CD starts don't hit enter but use F3 to check the options. Now you have to type the code for the rescue. Since you'll only need to edit a text file I think it's fine to just do it with a plain rescue command (no different kernels and stuff) IIRC the code was something like this:

rescue root=/dev/hd..

You have to say what your root partition is and then a debian session will start.

blinux1 12-10-2004 02:27 PM

It is possible that you're dead debian filetree is being mounted readonly. If you ever use that debian rescue disk, make sure the filetree is mounted read-write.

darkleaf 12-10-2004 02:50 PM

Quote:

Originally posted by blinux1
It is possible that you're dead debian filetree is being mounted readonly. If you ever use that debian rescue disk, make sure the filetree is mounted read-write.
I think it does this automatically. You specify which root partition you use then you can login as root and edit whatever you want.

JimBass 12-10-2004 03:12 PM

IIRC, Knoppix shows your hard disks on the desktop. If you right click them, there is gui interface that has the option like "allow write to this drive" or something in that neighborhood. That is not checked by default, but would have to be to edit a file on your debian drive. After clicking the write checkbox, you'll still have to be root and go through all the steps people ahve given here.

Peace,
JimBass

TaNeK 12-10-2004 03:54 PM

i've unchecked the read only box and changed to let users write to files through the gui. still cannot use either vi or any other editor... how does the rescue work? it lts me reinstall grub?

TaNeK 12-10-2004 05:12 PM

ok, i fixed it.

for everyone other than me who makes this kind of mistakes:

open terminal
su
passwd
set a password
run as a different user on an editor, think kedit or something worked for me (don't use kde-apps much..)
edit the file and voila, you should be able to save. :D


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