Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I made a rather bad mistake while playing around with Solaris 11, which has left me locked-out. I accidently changed the first character of my username in /etc/passwd, and the "new" username is not recognized as having the root-role (major bummer).

So I need a way to access the root-filesystem in rpool on the partition I use for Solaris while using the live install-DVD. Sadly zpool doesn't detect the partition while i run the live-DVD, and since I'm a bit of a novice, I don't want to experiment on my own and make things worse...

So what is the correct way of getting Solaris to detect a pool on a disk-partition and/or access a filesystem in a pool on a disk-partition when it's not automatically detected?

share|improve this question
if you do format you can see the disk from live dvd? What is the output of zfs import? could you paste both here? – BitsOfNix Aug 8 '13 at 10:55
@AlexandreAlves s/zfs import/zpool import/ – jlliagre Aug 8 '13 at 12:44
I rather not do format... ;-) I can however get the correct dev-string using gpart. I'm not at home, and don't remember exactly, but I'm sure there was a "p" for partition in it rather than "s" for slice (or whatever). Eg. /dev/...d1p3. "zfs import"? That sonds promising... tell me more. (Almost total novice with zpool and zfs, and I rather not learn by my mistakes just now) – Baard Kopperud Aug 8 '13 at 12:45
@BaardKopperud If you haven't read it already, you may be interested in Solaris ZFS Administration Guide: Importing ZFS Storage Pools and possibly ditto Using ZFS Alternate Root Pools. – Michael Kjörling Aug 8 '13 at 13:18
@BaardKopperud in Solaris the format command shows you the disks available. It does not actually format unless you say so. if you want to feel more secure echo | format will only display disks and exit. And as Michael stated those two guides will help you a lot. – BitsOfNix Aug 8 '13 at 13:52
up vote 1 down vote accepted

A couple of things to check into:

  1. Depending on how much patching you may have done, but zpool and/or zfs versions of the initial installation media may not be compatible with the version of zpool/zfs on disk. Do you know how far your solaris image had been patched? or what the most recent SRU applied was? If you have Oracle support, SRU 9.5 had enough patches that Oracle has made installation media available that's patched to that level.

  2. If you are running Solaris 11.1, or Solaris 11 11/11, there are differences with the way the rpool is configured. If zpool import doesn't show you the rpool, you can try forcing it to recognize rpool by importing with the -f option. Then you'll need to mount the boot environment you wish to change. Once the BE is mounted, you can edit the password and shadow files to fix your username, then restart the computer from the internal disk to recover.

From a GNOME terminal in the live CD desktop:

# zpool import -f rpool
# beadm list
be_find_current_be: failed to find current BE name
be_find_current_be: failed to find current BE name
BE                 Active Mountpoint Space  Policy Created          
--                 ------ ---------- -----  ------ -------          
solaris            -      -          11.45M static 2011-10-22 00:30 
solaris-2          R      -          12.69G static 2011-10-21 21:04 
# mkdir /a
# beadm mount solaris-2 /a
# TERM=vt100
# export TERM
# cd /a/etc
# vi shadow 
<make necessary changes>
# vi passwd
<make necessary changes>
# cd /
# beadm umount solaris-2
# halt

Since you mention being relatively a novice with Solaris 11, please let me know if clarification of any of these steps would be helpful. What you are trying to do is very achievable.

share|improve this answer
It worked! Thank you, now I finally can use my Solaris-installation again. – Baard Kopperud Aug 27 '13 at 14:32
Glad to hear it. :) – Tim Kennedy Aug 27 '13 at 18:22

And on solaris10 with zfs as root?

zpool import -f rpool

But no beadm exist. How to mount zfs root on a? Thanks p.s=i know is possible using the dvd,and click 6 so automount a But i want to know the procedure.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.