zfs list and non-root user

Norman Maurer norman at apache.org
Thu May 29 12:24:56 UTC 2008


Hi,

even if the zfs module is loaded I get the error message:

[norman at harmonia ~]$ kldstat | grep zfs
 7    1 0xfffffffffcc1c000 80ee8    zfs.ko
[norman at harmonia ~]$ zfs list
internal error: failed to initialize ZFS library


Anyway thx for the info.. At least now I know why it "should" not work ;-)

bye
Norman



2008/5/29 Pawel Jakub Dawidek <pjd at freebsd.org>:
> On Fri, Apr 11, 2008 at 01:41:28PM -0500, Mark Kane wrote:
>> On Fri, Apr 11, 2008, at 15:13:16 +0200, Norman Maurer wrote:
>> > Hi all,
>> >
>> > is it normal that I can't do a 'zfs list' ( for example ) as non-root
>> > user ?
>> >
>> > $ zfs list
>> > internal error: failed to initialize ZFS library
>> >
>> > I think there is really a use case for use some zfs commands as
>> > non-root user..
>> >
>> > Thx
>> > Norman
>>
>> Hi.
>>
>> One way to do this as a non-root user is to add the account to the
>> "operator" group. This is what I do on my personal desktop machine
>> and it has worked fine, but I understand that may not be best in all
>> cases.
>>
>> You might also try changing the permissions on /dev/zfs. I don't do
>> this method and I'm not sure if it's a proper way, but from trying it
>> very briefly it seems to work correctly with the user not in the
>> "operator" group.
>
> In Solaris anyone can open /dev/zfs and the kernel side of ZFS decides
> if the user has permission to perform some action or not. In FreeBSD we
> try to be more careful for now, but it will change soon, once we import
> delegated administration functionality.
>
> Although... The error above (failed to initialize ZFS library) most
> likely means that zfs.ko module wasn't loaded. zfs(8) tries to do that
> automatically, but of course it will only succeed if we are root. In
> this case zfs.ko has to be manually loaded by root and then members of
> operator group can use zfs(8) command.
>
> --
> Pawel Jakub Dawidek                       http://www.wheel.pl
> pjd at FreeBSD.org                           http://www.FreeBSD.org
> FreeBSD committer                         Am I Evil? Yes, I Am!
>


More information about the freebsd-questions mailing list