LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 09-11-2008, 06:02 AM   #1
czezz
Member
 
Registered: Nov 2004
Distribution: Slackware/Solaris
Posts: 810

Rep: Reputation: 40
chroot on Solaris 10 SPARC.


How can I use "chroot" on Solaris 10 SPARC.
Here is what I tryed:

Code:
ok boot cdrom -s
# mount -F ufs /dev/dsk/c1t0d0s0 /a
# chroot /a /usr/bin/sh
chroot: exec failed: No such file or directory
also tryed
Code:
# chroot /a
it complained about some argument
# chroot /a /
it sompleined about premission
 
Old 09-11-2008, 08:26 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Tribblix, Ubuntu/WSL
Posts: 9,771

Rep: Reputation: 468Reputation: 468Reputation: 468Reputation: 468Reputation: 468
Quote:
Originally Posted by czezz View Post
How can I use "chroot" on Solaris 10 SPARC.
Just like with any other Unix and Unix like OS.
Quote:
Code:
# mount -F ufs /dev/dsk/c1t0d0s0 /a
# chroot /a /usr/bin/sh
chroot: exec failed: No such file or directory
That means there is no /usr/bin/sh in your new root, i.e. there is no /a/usr/bin/sh.

Quote:
Code:
# chroot /a
it complained about some argument
You need to tell what program you want to run.
Quote:
Code:
# chroot /a /
it sompleined about premission
/ isn't an executable name.

You need to create an environment where your chrooted program can execute. This can be done simply by copying the shared libraries it requires and possibly other files. eg.
Code:
# pwd
/home/jlliagre
# find tmp -type f
tmp/lib/libm.so.2
tmp/lib/libuutil.so.1
tmp/lib/libsec.so.1
tmp/lib/ld.so.1
tmp/lib/libnsl.so.1
tmp/lib/libmd.so.1
tmp/lib/libmp.so.2
tmp/lib/libscf.so.1
tmp/lib/libgen.so.1
tmp/lib/libsecdb.so.1
tmp/lib/libc.so.1
tmp/lib/libsocket.so.1
tmp/bin/ksh
tmp/bin/ls
# chroot $PWD/tmp /bin/ksh
# pwd
/
# ls -l /bin
total 584
-r-xr-xr-x   1 0        0         220932 Sep 11 12:14 ksh
-r-xr-xr-x   1 0        0          33416 Sep 11 12:18 ls
Note that chroot has been mostly obsoleted by Solaris Containers (Zones) starting with Solaris 10.

Last edited by jlliagre; 09-11-2008 at 08:27 AM.
 
Old 09-11-2008, 09:22 AM   #3
czezz
Member
 
Registered: Nov 2004
Distribution: Slackware/Solaris
Posts: 810

Original Poster
Rep: Reputation: 40
I should mention that at the beginning:

please note that I am booted from install DVD in SINGLE USER MODE.
The /a is a mount place where slice 0 of system disk is mounted.
What I want to do now, is to chroot on mountd fs and change root user passwd.

Im sure I have done once this way under Linux - must be similar procedure under Solaris
 
Old 09-11-2008, 09:47 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Tribblix, Ubuntu/WSL
Posts: 9,771

Rep: Reputation: 468Reputation: 468Reputation: 468Reputation: 468Reputation: 468
This seems an overly complicated way to change root password. Just blank root password field in /a/etc/shadow when under a shell from the installation DVD. Then reboot and set root's password to whatever you want.

No need to chroot. In any case, on your system, ./usr/bin/sh (a link to ../../sbin/sh) is not under /a for some reason. Did you check for that ?
 
  


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
Solaris 10 SPARC - 2 NIC czezz Solaris / OpenSolaris 1 06-11-2008 11:11 PM
Solaris 8.1.7 on SPARC, how I get it? saudoi Solaris / OpenSolaris 2 06-02-2005 10:39 PM
Solaris Sparc Sun redhatrosh Solaris / OpenSolaris 4 03-26-2005 01:54 AM
VNC 4 on Solaris 9 (Sparc) gquiring Solaris / OpenSolaris 1 10-08-2004 03:06 AM
solaris 8 Sparc problems skunk1 Solaris / OpenSolaris 4 03-30-2003 07:17 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 09:20 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration