You're mixing a mkdir operation with a zfs create operation and only
the zfs create operation creates a file system that is mounted, which
is why df -h doesn't show dir2 as mounted. dir2 is just a directory,
not a file system.
ZFS does two things with a default zfs create operation:
o creates the file system
o creates the file system mountpoint
In this case, you pre-created the file system mount point but
because it is not empty, ZFS can't mount the file system.
If the directory dir2 was empty, then this command would succeed by
mounting the dir2 file system right over the dir2 directory:
# zfs create tank/dir1
# mkdir /tank/dir1/dir2
# zfs create -p tank/dir1/dir2/dir3
# zfs list -r tank
NAME USED AVAIL REFER MOUNTPOINT
tank 210K 134G 32K /tank
tank/dir1 95K 134G 32K /tank/dir1
tank/dir1/dir2 63K 134G 32K /tank/dir1/dir2
tank/dir1/dir2/dir3 31K 134G 31K /tank/dir1/dir2/dir3
Thanks,
Cindy
On 01/24/11 14:58, Rahul Deb wrote:
I have a pool "tank" and "dir1" is the filesystem on that pool. "zfs
list" and "df -h" both shows "tank/dir1" mounted.
*-----------------------------------------------------*
*# zfs list*
*tank 124K 228G 32K /tank*
*tank/dir1 31K 228G 31K /tank/dir1*
*#*
*
*
*# df -h*
*tank 229G 32K 229G 1% /tank*
*tank/dir1 229G 31K 229G 1% /tank/dir1*
*#*
*-----------------------------------------------------*
After that I created a directory "dir2" with mkdir command under
/tank/dir1 and touch couple of files inside dir2
*-------------------*
*# cd /tank/dir1*
*# mkdir dir2*
*# cd dir2*
*# touch file1 file2*
*-------------------*
Now if I try to create zfs filesystem named "dir2/dir3" under
"tank/dir1", it gives the following message. Though I am using -p flag,
it only creates filesystem until tank/dir1/dir2 but not dir3 and also
"df -h" does not show "/tank/dir1/dir2" as mounted.
*# zfs create -p tank/dir1/dir2/dir3*
*cannot mount '/tank/dir1/dir2': directory is not empty*
*#*
*
*
*# zfs list*
*tank 250K 228G 33K /tank*
*tank/dir1 63K 228G 32K /tank/dir1*
*tank/dir1/dir2 31K 228G 31K /tank/dir1/dir2*
*#*
Is it a normal behaviour?
------------------------------------------------------------------------
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss