mount zpool root from usb to reset a root password

Hi. I've got myself in trouble. Need to ask every one to help.
One day realized that I cannot login as a root. Cannot login in single user mode, because some time long ago, I've setup it to insecure in /etc/ttys file.
So a have burned a memstick to usb drive. Booted from it, and choose a LiveCD mode.
So the first try was
Code:
zpool import raid-5
zfs mount -a
It mount every thing except a root (I can't see /etc/ folder)
The second try was
Code:
mkdir /tmp/zfs
zpool import -f -R /tmp/zfs raid-5
But it also was not mount system root.
What gives mount in livecd mode
liveCD_mount.jpg


And what I've got after system boot under user rights
system_boot_user_mount.jpg


May be some glue is in a zpool history
I found a string "zfs set mountpoint=legacy raid-5"

zpool_history2.jpg


Ask every one for help. it's a live working system.
How can I mount a pool root to get into system's /etc/ folder and reset root password ?
Thank for any help.
 
First import the pool. Then run
# zfs mount -o mountpoint=[I]somewhere path-to-root-filesystem[/I]
You can find the root filesystem by using zfs list.
 
Here is my solution
Code:
mkdir /tmp/zfs
zpool import -f -R /tmp/zfs raid-5
mount -t zfs raid-5 /tmp/zfs/
cd /tmp/zfs/etc/
Now I can access root of this machine and edit password and make console secure for booting into single user mode by server itself.
Problem solved
 
Back
Top