Darren Reed
2006-Jul-03 10:02 UTC
[zfs-discuss] zfs filesystem/path names args with leading /
What danger is there in stripping off the leading / from zfs command args and using what is left as a filesystem name? Quite often I do a quick copy-paste to get from df output to the zfs command line and every time I need to re-edit the command line because the copy-paste takes the leading / with it. Darren
Tim Foster
2006-Jul-03 10:14 UTC
[zfs-discuss] zfs filesystem/path names args with leading /
On Mon, 2006-07-03 at 18:02 +0800, Darren Reed wrote:> What danger is there in stripping off the leading / from zfs > command args and using what is left as a filesystem name?If I''m understanding you correctly, then you can''t do that, as the mountpoint isn''t always the same as the name of the filesystem. For example: timf at haiiro[513] df | grep local /usr/local (space/usrlocal ):17092419 blocks 17092419 files /usr/local/foo (space/usrlocal/foo):17092419 blocks 17092419 files Of course, there''s nothing stopping you taking the middle field (enclosed in parenthesis) from df instead. does this help ? cheers, tim -- Tim Foster, Sun Microsystems Inc, Operating Platforms Group Engineering Operations http://blogs.sun.com/timf
Darren Reed
2006-Jul-03 10:43 UTC
[zfs-discuss] zfs filesystem/path names args with leading /
Tim Foster wrote:>On Mon, 2006-07-03 at 18:02 +0800, Darren Reed wrote: > > >>What danger is there in stripping off the leading / from zfs >>command args and using what is left as a filesystem name? >> >> > >If I''m understanding you correctly, then you can''t do that, as the >mountpoint isn''t always the same as the name of the filesystem. > >For example: > >timf at haiiro[513] df | grep local >/usr/local (space/usrlocal ):17092419 blocks 17092419 files >/usr/local/foo (space/usrlocal/foo):17092419 blocks 17092419 files > > >Of course, there''s nothing stopping you taking the middle field >(enclosed in parenthesis) from df instead. > >Well, I use "df -kl", but commands such as "df" will work just the same if I use "." or "/" or "/dev/dsk/c0t3d0s0" (and all three are the same.) Yes, arguably I am cut-past''ing the wrong part of the output.. I suppose what I''m questioning is, whether or not there is any real danger in zfs converting /usr/local to usr/local and then trying to do a delete of the filesystem usr/local. I suppose this could mounted in /opt/local and be not what I wanted... But in the case where the ZFS mountpoint is the ZFS filesystem name (plus a leading /), why not allow both names to mean the same? Darren
Eric Schrock
2006-Jul-03 16:13 UTC
[zfs-discuss] zfs filesystem/path names args with leading /
On Mon, Jul 03, 2006 at 06:43:59PM +0800, Darren Reed wrote:> > Well, I use "df -kl", but commands such as "df" will work just > the same if I use "." or "/" or "/dev/dsk/c0t3d0s0" (and all three > are the same.) > > Yes, arguably I am cut-past''ing the wrong part of the output.. > > I suppose what I''m questioning is, whether or not there is any > real danger in zfs converting /usr/local to usr/local and then > trying to do a delete of the filesystem usr/local. I suppose this > could mounted in /opt/local and be not what I wanted... > > But in the case where the ZFS mountpoint is the ZFS filesystem > name (plus a leading /), why not allow both names to mean the same?A better solution would be fixing this RFE: 6260523 want ''zfs list <path>'' Which could also be expanded to other zfs(1M) commands. This would do the statvfs()/getmntany() to find the associated zfs dataset, regardless of whether it matches the mountpoint or not. - Eric -- Eric Schrock, Solaris Kernel Development http://blogs.sun.com/eschrock