Hello, I''m trying to implement a NAS server with solaris/NFS and, of course, ZFS. But for that, we have a little problem... what about the /home filesystem? I mean, i have a lot of linux clients, and the "/home" directory is on a NFS server (today, linux). I want to use ZFS, and change the "directory" home like /home/leal, to "filesystems" like /home/leal (just like the documentation recommends). Now, a PAM module (pam_mkhomedir) have solved that problem, creating the user home directory (as demand). Do you have a solution to that? Like a linux PAM module to create a zfs filesystem under /home, and not a ordinary directory? So i can have a per user filesystem under "/home/"... Of course, with a service on the NFS solaris server... I''m asking because if you agree that it is a "problem", we can create a project in opensolaris to work on it. Or maybe, you have a trivial solution, that i''m not seeing. Thanks very much for your time! This message posted from opensolaris.org
msl wrote:> Hello, > I''m trying to implement a NAS server with solaris/NFS and, of course, ZFS. But for that, we have a little problem... what about the /home filesystem? I mean, i have a lot of linux clients, and the "/home" directory is on a NFS server (today, linux). I want to use ZFS, and > change the "directory" home like /home/leal, to "filesystems" like > /home/leal (just like the documentation recommends). Now, a PAM module > (pam_mkhomedir) have solved that problem, creating the user home > directory (as demand). Do you have a solution to that? Like a linux PAM > module to create a zfs filesystem under /home, and not a ordinary > directory? So i can have a per user filesystem under "/home/"... Of course, with a service on the NFS solaris server... > I''m asking because if you agree that it is a "problem", we > can create a project in opensolaris to work on it. Or maybe, you have a > trivial solution, that i''m not seeing. > Thanks very much for your time!Have an executable automounter map that runs on the NFS server do that for you. See automount(1M) for information on how to write the maps. You could also port the pam_mkhomedir module and have it do a zfs create instead of mkdir. PAM after all started on Solaris :-) -- Darren J Moffat
Ok, thanks very much for your answer. I will look the automounter. But, about the pam module, how it would work? running on linux machine, and creating a zfs filesystem on a solaris server (via NFS)? Thanks again. This message posted from opensolaris.org
Hey guys, I think i know what is going on. A set of files was attempted to be deleted on a FS that had almost consumed its reservation. It failed because one or more snapshots hold references to these files and the snaps needed to allocate FS space. Thus, the no space error. Now the stupid question.. If the snapshot is identical to the FS, I can''t remove files from the FS because of the snapshot and removing files from the snapshot only removes a reference to the file and leaves the memory. So, how do I do a atomic file removes on both the original and the snapshot(s). Yes, I am assuming that I have backed up the file offline. Can I request a possible RFE to be able to force a file remove from the original FS and if found elsewhere remove that location too IFF a ENOSPC would fail the original rm? Thanks, Mitchell Erblich
Erblichs wrote:> Now the stupid question.. > If the snapshot is identical to the FS, I can''t > remove files from the FS because of the snapshot > and removing files from the snapshot only removes > a reference to the file and leaves the memory. > > So, how do I do a atomic file removes on both the > original and the snapshot(s). Yes, I am assuming that > I have backed up the file offline. > > Can I request a possible RFE to be able to force a > file remove from the original FS and if found elsewhere > remove that location too IFF a ENOSPC would fail the > original rm?No, you can not remove files from snapshots. Snapshots can not be changed. If you are out of space because of snapshots, you can always ''zfs destroy'' the snapshot :-) --matt
msl wrote:> Ok, thanks very much for your answer. I will look the automounter. But, about the pam module, how it would work? running on linux machine, and creating a zfs filesystem on a solaris server (via NFS)? > Thanks again.It wouldn''t run on the Linux machine it would run on the Solaris machine and you would need to have the users login to the Solaris machine once first. -- Darren J Moffat
On October 20, 2006 12:00:26 PM +0100 Darren J Moffat <Darren.Moffat at Sun.COM> wrote:> msl wrote: >> Ok, thanks very much for your answer. I will look the automounter. But, >> about the pam module, how it would work? running on linux machine, and >> creating a zfs filesystem on a solaris server (via NFS)? Thanks again. > > It wouldn''t run on the Linux machine it would run on the Solaris machine > and you would need to have the users login to the Solaris machine once > first.It could rsh/ssh to the solaris machine and create the fs. -frank
Frank Cusack wrote:> On October 20, 2006 12:00:26 PM +0100 Darren J Moffat > <Darren.Moffat at Sun.COM> wrote: >> msl wrote: >>> Ok, thanks very much for your answer. I will look the automounter. But, >>> about the pam module, how it would work? running on linux machine, and >>> creating a zfs filesystem on a solaris server (via NFS)? Thanks again. >> >> It wouldn''t run on the Linux machine it would run on the Solaris machine >> and you would need to have the users login to the Solaris machine once >> first. > > It could rsh/ssh to the solaris machine and create the fs.I had the same offline conversation with Marcelo and sent him this as an outline of how to do this: What you could do is have a PAM module that does an ssh to the Solaris NFS server as a non root account. That account on the Solaris machine would only be able to run a script that creates the users home dir. The script would need to do something like this: #!/bin/sh # Assumes $1 is the username # Assumes mypool/home is already shared ie, zfs set sharenfs=rw USER=$1 zfs create mypool/home/$USE chown -R $USER /mypool/home/$USER You can have the deployment account (lets call it homedep) setup so that it can not login directly: passwd -N homedep. Then set it up with ssh pubkey authentication so that it can only run the specific script above. Your pam module would then do something like this: ssh -lhomedep nfsserver /usr/local/mkhomedir bob -- Darren J Moffat
Matthew, et al, You haven''t identified a solution / workaround? Their is one "large" file within the FS and snapshot that has been backed up. They wish to remove this large file and the system is preventing this because of a additional reference from the snapshot. For some good reason to them, they do not wish to remove the entire snapshot. Then, how do you FORCE ably remove a file that fails with a no space error? Are you telling me that their is no way to access a single file within the snapshot and remove it? Mitchell Erblich ---------------- Matthew Ahrens wrote:> > Erblichs wrote: > > Now the stupid question.. > > If the snapshot is identical to the FS, I can''t > > remove files from the FS because of the snapshot > > and removing files from the snapshot only removes > > a reference to the file and leaves the memory. > > > > So, how do I do a atomic file removes on both the > > original and the snapshot(s). Yes, I am assuming that > > I have backed up the file offline. > > > > Can I request a possible RFE to be able to force a > > file remove from the original FS and if found elsewhere > > remove that location too IFF a ENOSPC would fail the > > original rm? > > No, you can not remove files from snapshots. Snapshots can not be > changed. If you are out of space because of snapshots, you can always > ''zfs destroy'' the snapshot :-) > > --matt
> Are you telling me that their is no way to access a single > file within the snapshot and remove it?That''s correct. The way snapshots are implemented, you cannot modify their contents. If the file or some smaller set of potential files is known beforehand, perhaps you could put them in a separate filesystem with different snapshot characteristics. -- Darren Dunham ddunham at taos.com Senior Technical Consultant TAOS http://www.taos.com/ Got some Dr Pepper? San Francisco, CA bay area < This line left intentionally blank to confuse you. >
Perfect, thanks for all answers. The solution that Darren has suggested to me, can be implemented even between linux -> linux. No more no_root_squash in home directories, what is a bad thing. thanks again. This message posted from opensolaris.org