View previous topic :: View next topic |
Author |
Message |
hongkongblue2 n00b
Joined: 06 Apr 2005 Posts: 64 Location: Hong Kong, China
|
Posted: Fri Apr 15, 2005 4:23 pm Post subject: Root Password (Oh No! -- Help) |
|
|
Forgot to change the root password on a recent installation of 2005.0, so on first boot can't log into root !
The Problem:
Grub does not accept booting into single user mode!! (kernel /boot/bzImage single ... etc). If i could do this I could change the root password!
The Complication!!
My installation is on a software raid, so booting from the livecd and then starting the raid is fine, but when chrooting into /mnt/gentoo i get a segfault so I can't change the password that way either!!
PLEASE HELP!!! _________________ Gentoo [~x86] GCC-4.1.0 (Beta) : NPTL ONLY (nitro-sources [2.6.12-n5]) : Mobo:915G-intel, HDA Audio-Alsa, 1GB Ram, 4xSATA:SW-RAID@Reiser4, HT-P4 3GHz, 19" LCD. |
|
Back to top |
|
|
meyerm Veteran
Joined: 27 Jun 2002 Posts: 1311 Location: Munich / Germany
|
Posted: Fri Apr 15, 2005 4:27 pm Post subject: |
|
|
No panic...
Just add "init=/bin/bash" at your kernel configs with grub. (of course manually and only this one time ) |
|
Back to top |
|
|
hongkongblue2 n00b
Joined: 06 Apr 2005 Posts: 64 Location: Hong Kong, China
|
Posted: Fri Apr 15, 2005 4:31 pm Post subject: |
|
|
meyerm wrote: | No panic...
Just add "init=/bin/bash" at your kernel configs with grub. (of course manually and only this one time ) |
Sorry to be a pain, but could you show me the actual line you would put into grub, something like ...
" root (hd0,0)
kernel /boot/bzImage root=/dev/md1 ..." then i'll give it a go straight away
thanx _________________ Gentoo [~x86] GCC-4.1.0 (Beta) : NPTL ONLY (nitro-sources [2.6.12-n5]) : Mobo:915G-intel, HDA Audio-Alsa, 1GB Ram, 4xSATA:SW-RAID@Reiser4, HT-P4 3GHz, 19" LCD. |
|
Back to top |
|
|
Naib Watchman
Joined: 21 May 2004 Posts: 6051 Location: Removed by Neddy
|
Posted: Fri Apr 15, 2005 4:31 pm Post subject: |
|
|
or just boot off the liveCD and chroot into the HD gentoo environement and use "passwd" from there to set it _________________
Quote: | Removed by Chiitoo |
|
|
Back to top |
|
|
hongkongblue2 n00b
Joined: 06 Apr 2005 Posts: 64 Location: Hong Kong, China
|
Posted: Fri Apr 15, 2005 4:34 pm Post subject: |
|
|
Naib wrote: | or just boot off the liveCD and chroot into the HD gentoo environement and use "passwd" from there to set it |
As i said above, i can't chroot into my environment because the raid segfaults on chrooting, thanks anyway. _________________ Gentoo [~x86] GCC-4.1.0 (Beta) : NPTL ONLY (nitro-sources [2.6.12-n5]) : Mobo:915G-intel, HDA Audio-Alsa, 1GB Ram, 4xSATA:SW-RAID@Reiser4, HT-P4 3GHz, 19" LCD. |
|
Back to top |
|
|
meyerm Veteran
Joined: 27 Jun 2002 Posts: 1311 Location: Munich / Germany
|
Posted: Fri Apr 15, 2005 4:38 pm Post subject: |
|
|
hongkongblue2 wrote: | Sorry to be a pain, but could you show me the actual line you would put into grub, something like ... |
Sure, no problem:
Code: |
root (hd0,0)
kernel /boot/bzImage root=/dev/md1 init=/bin/bash
|
This shoudl give you only a bash running "ontop" of the kernel. So there are no loginor password prompts. |
|
Back to top |
|
|
hongkongblue2 n00b
Joined: 06 Apr 2005 Posts: 64 Location: Hong Kong, China
|
Posted: Fri Apr 15, 2005 4:41 pm Post subject: |
|
|
hongkongblue2 wrote: | meyerm wrote: | No panic...
Just add "init=/bin/bash" at your kernel configs with grub. (of course manually and only this one time ) |
Sorry to be a pain, but could you show me the actual line you would put into grub, something like ...
" root (hd0,0)
kernel /boot/bzImage root=/dev/md1 ..." then i'll give it a go straight away
thanx |
Tried this, as suggested;
root (hd0,0)
kernel /boot/bzImage root=/dev/md1 init=/bin/bash
But this happens
VFS: Mounted root fs
Freeing unused kernel memory
(((HANG))))) !!
I'm really confused by my inability to get into single user mode - any ideas _________________ Gentoo [~x86] GCC-4.1.0 (Beta) : NPTL ONLY (nitro-sources [2.6.12-n5]) : Mobo:915G-intel, HDA Audio-Alsa, 1GB Ram, 4xSATA:SW-RAID@Reiser4, HT-P4 3GHz, 19" LCD. |
|
Back to top |
|
|
meyerm Veteran
Joined: 27 Jun 2002 Posts: 1311 Location: Munich / Germany
|
Posted: Fri Apr 15, 2005 4:44 pm Post subject: |
|
|
Hmm, that's not even near the interpretation of the "init" parameter. Does your kernel boots fine with your default config? I understand that you can't login then - but is the kernel able to mount the software raid? Did you compile all needed modules into your kernel? |
|
Back to top |
|
|
hongkongblue2 n00b
Joined: 06 Apr 2005 Posts: 64 Location: Hong Kong, China
|
Posted: Fri Apr 15, 2005 4:47 pm Post subject: |
|
|
Quote: | Tried this, as suggested;
root (hd0,0)
kernel /boot/bzImage root=/dev/md1 init=/bin/bash
But this happens
VFS: Mounted root fs
Freeing unused kernel memory
(((HANG))))) !!
I'm really confused by my inability to get into single user mode - any ideas |
I'm running vesafb could that be a problem? Could I turn of fb mode at the grub prompt to reduce resource useage? _________________ Gentoo [~x86] GCC-4.1.0 (Beta) : NPTL ONLY (nitro-sources [2.6.12-n5]) : Mobo:915G-intel, HDA Audio-Alsa, 1GB Ram, 4xSATA:SW-RAID@Reiser4, HT-P4 3GHz, 19" LCD. |
|
Back to top |
|
|
hongkongblue2 n00b
Joined: 06 Apr 2005 Posts: 64 Location: Hong Kong, China
|
Posted: Fri Apr 15, 2005 4:49 pm Post subject: |
|
|
meyerm wrote: | Hmm, that's not even near the interpretation of the "init" parameter. Does your kernel boots fine with your default config? I understand that you can't login then - but is the kernel able to mount the software raid? Did you compile all needed modules into your kernel? |
Yes, the raid builds fine and i get to a root login prompt. If i boot from a livecd i can check the status of the raid and it seems fine in /proc/mdstat. I have no idea why i can't chroot over to my environment - the cause of the segfault? _________________ Gentoo [~x86] GCC-4.1.0 (Beta) : NPTL ONLY (nitro-sources [2.6.12-n5]) : Mobo:915G-intel, HDA Audio-Alsa, 1GB Ram, 4xSATA:SW-RAID@Reiser4, HT-P4 3GHz, 19" LCD. |
|
Back to top |
|
|
hongkongblue2 n00b
Joined: 06 Apr 2005 Posts: 64 Location: Hong Kong, China
|
Posted: Fri Apr 15, 2005 4:58 pm Post subject: |
|
|
hongkongblue2 wrote: | meyerm wrote: | Hmm, that's not even near the interpretation of the "init" parameter. Does your kernel boots fine with your default config? I understand that you can't login then - but is the kernel able to mount the software raid? Did you compile all needed modules into your kernel? |
Yes, the raid builds fine and i get to a root login prompt. If i boot from a livecd i can check the status of the raid and it seems fine in /proc/mdstat. I have no idea why i can't chroot over to my environment - the cause of the segfault? |
Perhaps i could give knoppix livecd a try and do a raid boot? The recent livecds don't seem to have a "doraid" parameter as they used to. I'll try that now. _________________ Gentoo [~x86] GCC-4.1.0 (Beta) : NPTL ONLY (nitro-sources [2.6.12-n5]) : Mobo:915G-intel, HDA Audio-Alsa, 1GB Ram, 4xSATA:SW-RAID@Reiser4, HT-P4 3GHz, 19" LCD. |
|
Back to top |
|
|
colin.fletcher n00b
Joined: 15 Apr 2005 Posts: 1
|
Posted: Fri Apr 15, 2005 5:16 pm Post subject: Maybe this will work |
|
|
If you can boot and see the /mnt/gentoo structure, have you tried to vi the /mnt/gentoo/etc/shadow file ?
Second field, delimited by colons, is the password.
I just tried this on my laptop and I logged in as root w/o a password.
my "modified" /etc/shadow file looks like this (top 2 lines)
root::12887:0:::::
halt:*:9797:0::::: _________________ Colin Fletcher
Sun Certified Professional
Dell Latitude D600 & AMD Athlon(TM) XP1600+ Workstation
2.6.11-gentoo-r5 w/ udev |
|
Back to top |
|
|
hongkongblue2 n00b
Joined: 06 Apr 2005 Posts: 64 Location: Hong Kong, China
|
Posted: Fri Apr 15, 2005 5:31 pm Post subject: |
|
|
hongkongblue2 wrote: | hongkongblue2 wrote: | meyerm wrote: | Hmm, that's not even near the interpretation of the "init" parameter. Does your kernel boots fine with your default config? I understand that you can't login then - but is the kernel able to mount the software raid? Did you compile all needed modules into your kernel? |
Yes, the raid builds fine and i get to a root login prompt. If i boot from a livecd i can check the status of the raid and it seems fine in /proc/mdstat. I have no idea why i can't chroot over to my environment - the cause of the segfault? |
Perhaps i could give knoppix livecd a try and do a raid boot? The recent livecds don't seem to have a "doraid" parameter as they used to. I'll try that now. |
SOLVED:
Used knoppix, assembled the raid in /mnt, chrooted to environment using /bin/sh. Now, why should sh work and not bash?? Wierd. Thanx for your suggestions. _________________ Gentoo [~x86] GCC-4.1.0 (Beta) : NPTL ONLY (nitro-sources [2.6.12-n5]) : Mobo:915G-intel, HDA Audio-Alsa, 1GB Ram, 4xSATA:SW-RAID@Reiser4, HT-P4 3GHz, 19" LCD. |
|
Back to top |
|
|
hongkongblue2 n00b
Joined: 06 Apr 2005 Posts: 64 Location: Hong Kong, China
|
Posted: Fri Apr 15, 2005 5:33 pm Post subject: Re: Maybe this will work |
|
|
colin.fletcher wrote: | If you can boot and see the /mnt/gentoo structure, have you tried to vi the /mnt/gentoo/etc/shadow file ?
Second field, delimited by colons, is the password.
I just tried this on my laptop and I logged in as root w/o a password.
my "modified" /etc/shadow file looks like this (top 2 lines)
root::12887:0:::::
halt:*:9797:0::::: |
Actually this would be another route to keep in mind if i get myself into this mess again - thanx. _________________ Gentoo [~x86] GCC-4.1.0 (Beta) : NPTL ONLY (nitro-sources [2.6.12-n5]) : Mobo:915G-intel, HDA Audio-Alsa, 1GB Ram, 4xSATA:SW-RAID@Reiser4, HT-P4 3GHz, 19" LCD. |
|
Back to top |
|
|
ihtruelsen Apprentice
Joined: 14 Mar 2003 Posts: 168 Location: Mill Bay, BC
|
Posted: Sun Jan 21, 2007 7:33 pm Post subject: forgot to set password in raid install, now what? |
|
|
I just did my first software raid installation, but I forgot to set the root password. Normally, i would put the LiveCD in, chroot, set the password and voila. When I try to do this with the raid setup, it wants to create a new raid setup, and I don't know whether it would destroy my existing install.
I then thought to chroot to /dev/hda and set the password there, figuring that the data would be mirrored properly when the raid system started, but that doesn't work.
How would I go about fixing this? |
|
Back to top |
|
|
beatryder Veteran
Joined: 08 Apr 2005 Posts: 1138
|
Posted: Sun Jan 21, 2007 7:38 pm Post subject: |
|
|
What kinda of RAID is it?
How did you create it? Using mdadm? If so, what you need to do is read the man pages for it and figure out what command you need to assemble the raid. Once you have done that, then mount your md device and chroot into that.
http://gentoo-wiki.com/HOWTO_Install_on_Software_RAID#Set_up_partitions
Although that does not explain how to reassemble the raid, it is not hard to figure out. _________________ Dont make it idiot proof, make it work.
Neucode.org
<suppressed key> |
|
Back to top |
|
|
nixnut Bodhisattva
Joined: 09 Apr 2004 Posts: 10974 Location: the dutch mountains
|
Posted: Mon Jan 22, 2007 6:28 pm Post subject: |
|
|
Merged above two posts here. _________________ Please add [solved] to the initial post's subject line if you feel your problem is resolved. Help answer the unanswered
talk is cheap. supply exceeds demand |
|
Back to top |
|
|
aryaniae n00b
Joined: 18 Sep 2006 Posts: 40 Location: Sunnyvale, CA U.S.A.
|
Posted: Thu Jan 25, 2007 12:23 am Post subject: |
|
|
hongkongblue2 wrote: | SOLVED:
Used knoppix, assembled the raid in /mnt, chrooted to environment using /bin/sh. Now, why should sh work and not bash?? Wierd. Thanx for your suggestions. |
If this is still true, please add "[SOLVED]" to the subject of the original post. |
|
Back to top |
|
|
|