Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Root Password (Oh No! -- Help)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
hongkongblue2
n00b
n00b


Joined: 06 Apr 2005
Posts: 64
Location: Hong Kong, China

PostPosted: Fri Apr 15, 2005 4:23 pm    Post subject: Root Password (Oh No! -- Help) Reply with quote

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
View user's profile Send private message
meyerm
Veteran
Veteran


Joined: 27 Jun 2002
Posts: 1311
Location: Munich / Germany

PostPosted: Fri Apr 15, 2005 4:27 pm    Post subject: Reply with quote

No panic... :-)

Just add "init=/bin/bash" at your kernel configs with grub. (of course manually and only this one time ;-) )
Back to top
View user's profile Send private message
hongkongblue2
n00b
n00b


Joined: 06 Apr 2005
Posts: 64
Location: Hong Kong, China

PostPosted: Fri Apr 15, 2005 4:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6051
Location: Removed by Neddy

PostPosted: Fri Apr 15, 2005 4:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
hongkongblue2
n00b
n00b


Joined: 06 Apr 2005
Posts: 64
Location: Hong Kong, China

PostPosted: Fri Apr 15, 2005 4:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
meyerm
Veteran
Veteran


Joined: 27 Jun 2002
Posts: 1311
Location: Munich / Germany

PostPosted: Fri Apr 15, 2005 4:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
hongkongblue2
n00b
n00b


Joined: 06 Apr 2005
Posts: 64
Location: Hong Kong, China

PostPosted: Fri Apr 15, 2005 4:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
meyerm
Veteran
Veteran


Joined: 27 Jun 2002
Posts: 1311
Location: Munich / Germany

PostPosted: Fri Apr 15, 2005 4:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
hongkongblue2
n00b
n00b


Joined: 06 Apr 2005
Posts: 64
Location: Hong Kong, China

PostPosted: Fri Apr 15, 2005 4:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
hongkongblue2
n00b
n00b


Joined: 06 Apr 2005
Posts: 64
Location: Hong Kong, China

PostPosted: Fri Apr 15, 2005 4:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
hongkongblue2
n00b
n00b


Joined: 06 Apr 2005
Posts: 64
Location: Hong Kong, China

PostPosted: Fri Apr 15, 2005 4:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
colin.fletcher
n00b
n00b


Joined: 15 Apr 2005
Posts: 1

PostPosted: Fri Apr 15, 2005 5:16 pm    Post subject: Maybe this will work Reply with quote

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
View user's profile Send private message
hongkongblue2
n00b
n00b


Joined: 06 Apr 2005
Posts: 64
Location: Hong Kong, China

PostPosted: Fri Apr 15, 2005 5:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
hongkongblue2
n00b
n00b


Joined: 06 Apr 2005
Posts: 64
Location: Hong Kong, China

PostPosted: Fri Apr 15, 2005 5:33 pm    Post subject: Re: Maybe this will work Reply with quote

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
View user's profile Send private message
ihtruelsen
Apprentice
Apprentice


Joined: 14 Mar 2003
Posts: 168
Location: Mill Bay, BC

PostPosted: Sun Jan 21, 2007 7:33 pm    Post subject: forgot to set password in raid install, now what? Reply with quote

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
View user's profile Send private message
beatryder
Veteran
Veteran


Joined: 08 Apr 2005
Posts: 1138

PostPosted: Sun Jan 21, 2007 7:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
nixnut
Bodhisattva
Bodhisattva


Joined: 09 Apr 2004
Posts: 10974
Location: the dutch mountains

PostPosted: Mon Jan 22, 2007 6:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
aryaniae
n00b
n00b


Joined: 18 Sep 2006
Posts: 40
Location: Sunnyvale, CA U.S.A.

PostPosted: Thu Jan 25, 2007 12:23 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum