# Repairing configuration settings with zfs root



## davidgurvich (Sep 13, 2010)

I'm largely posting this so that if it comes up again I can find the record somewhere.

In attempting to get resume from suspend working on a thinkpad T42 I managed to make two basic errors.  I made a setting change that caused Xorg to lock up the system and forgot to turn off automatic startup of the GUI.  Without both of these errors I would never have learned something about single-user mode and zfs.

When booting into single-user mode the root filesystem is mounted read-only.  That means any configuration changes don't get written.  The regular tools to remount the system read-write don't work on zfs.  I tried [cmd=]mount -o remount,rw[/cmd] and [cmd=]zfs mount -o remount,rw[/cmd]

The first doesn't work on a zfs filesystem and the second fails because the filesystem is in use as root.  I believe that opensolaris mount does work with zfs.  

Anyway, here's how to set a zfs root read-write in single-user mode.
[cmd=]zfs set readonly=off tank/root[/cmd]


----------



## Kevin Butski (Sep 15, 2016)

`zfs set readonly=off tank/root` didn't work for me things probably change.

`mount -u /`  does however.


----------



## ShelLuser (Sep 15, 2016)

Kevin Butski said:


> zfs set readonly=off tank/root didn't work for me things probably change.
> 
> mount -u /  does however.


Please note that you're bumping a 6 year old thread, meaning that a dozen things could have changed in the mean time.

Another thing to keep in mind, the OP mentioned this himself, is that he wrote this down for his own reference as well. When it comes to ZFS pools and filesystems it heavily depends on your system how things were set up. For example; on my ZFS only system I don't use tank, but zroot, which is the root filesystem. So on my end I'd need to use `# zfs set readonly=false zroot`, after which I normally issue `# zfs mount -a`.


----------



## kpa (Sep 15, 2016)

The readonly property is a "lower level" setting than the mount(8) readonly/read-write flag. You can try to mount a dataset that has readonly=on as read-write and the mount will succeed but ZFS will still deny any writes to the dataset. This is exactly the same situation you have with readonly NFS shares. You can mount them as read-write at the client but the NFS server will still deny all writes.


----------

