# mount zpool root from usb to reset a root password



## spin (Apr 27, 2017)

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 

```
zpool import raid-5
zfs mount -a
```
It mount every thing except a root (I can't see /etc/ folder)
The second try was

```
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





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


 

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



 

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.


----------



## t1066 (Apr 29, 2017)

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`.


----------



## spin (May 13, 2017)

Here is my solution

```
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


----------

