LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-02-2012, 02:46 PM   #1
kostya
Member
 
Registered: Mar 2010
Location: Moscow, Russia
Distribution: Ubuntu Studio, antix(mepis), Fedora, FreeBSD
Posts: 174
Blog Entries: 5

Rep: Reputation: 18
booting into chroot -- can't log in


Hey guys, nice to see you (well virtually speaking) all again.

I'm trying to accomplish another unusual thing, so, as one might naturally expected, I've run into a problem.
I just wanted to install the beta Fedora 17, but didn't have enough space on the only disk in my "slimline" HP computer.
So I installed on a USB stick, but running a distro from a USB stick is a nightmare... just driving me mad.
Well then I copied all the files into a chroot directory "/testing" and asked myself: Why not try booting into that chroot right from the start?? What is there which could prevent a system to boot from a different root?

So I'm using the kernel option:
Code:
init=$mychrootinit
,
which I borrowed from one guy who shared his experience with Debian.
This $mychrootinit is a custom script, which bind mounts the necessary stuff and than calls chroot command to chroot into /testing directory and
execute the init from that system
Here's the script:
Code:
#!/bin/bash
mount --bind /proc /testing/proc
mount --bind /sys /testing/sys
mount --bind /dev /testing/dev
mount --bind /tmp /testing/tmp
exec /usr/sbin/chroot /testing/ /usr/sbin/init 5
With all this stuff it boots fine, but then I can't login!
It just doesn't accept any login/password that has been created for the system in the /testing directory.
Sure enough, the /testing directory was created and all the files copied there as root.
I've checked and there ARE several virtual consoles, the graphical login runs on the 2-nd one, not on the 8th or 9th as usual. Unfortunately, I can't even check anything, cause I CAN'T LOGIN, ha-ha.

So please, what do you think could be wrong about it? Or maybe the very idea of booting into chroot is not that "smooth"?

Thanks in advance,
Kostya
 
Old 03-02-2012, 03:06 PM   #2
kostya
Member
 
Registered: Mar 2010
Location: Moscow, Russia
Distribution: Ubuntu Studio, antix(mepis), Fedora, FreeBSD
Posts: 174

Original Poster
Blog Entries: 5

Rep: Reputation: 18
OK, by checking the /var/log/secure in the /testing chroot directory I found this line:
Code:
Feb 29 19:21:04 localhost gdm-password][1096]: pam_unix(gdm-password:session): session opened for user kostya by (unknown)(uid=0)
Perhaps the word "(unknown)" is the reason why it can't log me in?
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Chroot in shell scripts: Ensuring that subsequent commands execute within the chroot Kenny_Strawn Programming 2 05-21-2012 12:25 PM
Problem with vsftpd chroot mode when user log on first time xuta Linux - Server 4 06-22-2011 01:47 PM
log with bind ( chroot ) pk_kala Linux - Server 1 12-07-2007 04:12 AM
log the booting ?! Amir21 Linux - Newbie 2 11-30-2004 03:26 AM
Error during booting but still can log in properly deMilo Slackware 1 09-20-2003 02:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration