Hi Folks, Is there any technical difference between using "zfs unmount" to unmount a ZFS filesystem versus the standard unix "umount" command? I always use "zfs unmount" but some of my colleagues still just use umount. Is there any reason to use one over the other? Thanks. Doug Linder ---------- Learn more about Merchant Link at www.merchantlink.com. THIS MESSAGE IS CONFIDENTIAL. This e-mail message and any attachments are proprietary and confidential information intended only for the use of the recipient(s) named above. If you are not the intended recipient, you may not print, distribute, or copy this message or any attachments. If you have received this communication in error, please notify the sender by return e-mail and delete this message and any attachments from your computer. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20100930/652fc4b6/attachment.html>
On Thu, 30 Sep 2010, Linder, Doug wrote:> Is there any technical difference between using "zfs unmount" to unmount > a ZFS filesystem versus the standard unix "umount" command? I always > use "zfs unmount" but some of my colleagues still just use umount. Is > there any reason to use one over the other?No, they''re identical. If you use ''zfs umount'' the code automatically maps it to ''unmount''. It also maps ''recv'' to ''receive'' and ''-?'' to call into the usage function. Here''s the relevant code from main(): /* * The ''umount'' command is an alias for ''unmount'' */ if (strcmp(cmdname, "umount") == 0) cmdname = "unmount"; /* * The ''recv'' command is an alias for ''receive'' */ if (strcmp(cmdname, "recv") == 0) cmdname = "receive"; /* * Special case ''-?'' */ if (strcmp(cmdname, "-?") == 0) usage(B_TRUE);
On 30.09.10 15:42, Mark J Musante wrote:> On Thu, 30 Sep 2010, Linder, Doug wrote: > >> Is there any technical difference between using "zfs unmount" to unmount >> a ZFS filesystem versus the standard unix "umount" command? I always use >> "zfs unmount" but some of my colleagues still just use umount. Is there >> any reason to use one over the other? > > No, they''re identical. If you use ''zfs umount'' the code automatically maps > it to ''unmount''. It also maps ''recv'' to ''receive'' and ''-?'' to call into the > usage function. Here''s the relevant code from main():Mark, I think that wasn''t the question, rather, "what''s the difference between ''zfs u[n]mount'' and ''/usr/bin/umount''?" HTH Michael -- michael.schuster at oracle.com http://blogs.sun.com/recursion Recursion, n.: see ''Recursion''
Michael Schuster [mailto:michael.schuster at oracle.com] wrote:> Mark, I think that wasn''t the question, rather, "what''s the difference > between ''zfs u[n]mount'' and ''/usr/bin/umount''?"Yes, that was the question. Sorry I wasn''t more clear. Doug Linder ---------- Learn more about Merchant Link at www.merchantlink.com. THIS MESSAGE IS CONFIDENTIAL. This e-mail message and any attachments are proprietary and confidential information intended only for the use of the recipient(s) named above. If you are not the intended recipient, you may not print, distribute, or copy this message or any attachments. If you have received this communication in error, please notify the sender by return e-mail and delete this message and any attachments from your computer.
On Thu, 30 Sep 2010, Linder, Doug wrote:> Michael Schuster [mailto:michael.schuster at oracle.com] wrote: > >> Mark, I think that wasn''t the question, rather, "what''s the difference >> between ''zfs u[n]mount'' and ''/usr/bin/umount''?" > > Yes, that was the question. Sorry I wasn''t more clear.Oops, ok. But the answer is still the same - umount calls "zfs unmount" when used on zfs filesystems. If you use truss, you''ll see that it exec''s /usr/lib/fs/zfs/umount which is a symlink to /sbin/zfs
On 30/09/2010 14:49, Linder, Doug wrote:> Michael Schuster [mailto:michael.schuster at oracle.com] wrote: > >> Mark, I think that wasn''t the question, rather, "what''s the difference >> between ''zfs u[n]mount'' and ''/usr/bin/umount''?" > > Yes, that was the question. Sorry I wasn''t more clear.The main differences are: zfs umount will do all these things that /usr/bin/umount won''t do: * It can be applied recursively down a ZFS hierarchy * It will unshare the filesystems first Both ultimately just call umount2(2) -- Darren J Moffat
On Thu, 30 Sep 2010, Darren J Moffat wrote:> * It can be applied recursively down a ZFS hierarchyTrue.> * It will unshare the filesystems firstActually, because we use the zfs command to do the unmount, we end up doing the unshare on the filesystem first. See the opensolaris code for details: http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/lib/libzfs/common/libzfs_mount.c#zfs_unmount