Thanks Richard for the prompt response. But second time same commands creates dir3 too.
I mean to say, as I said earlier, first time it gives the mounting error and does not create dir3 *# zfs create -p tank/dir1/dir2/dir3* *cannot mount '/tank/dir1/dir2': directory is not empty* *#* but if I issue the same command again(just after the above error ), it creates the dir3. After that "zfs list" shows dir3 but "df -h" still does not show dir2 as mounted. *# zfs create -p tank/dir1/dir2/dir3* ***# zfs list|grep tank* ***tank 290K 228G 33K /tank* ***tank/dir1 95K 228G 32K /tank/dir1* ***tank/dir1/dir2 63K 228G 32K /tank/dir1/dir2* ***tank/dir1/dir2/dir3 31K 228G 31K /tank/dir1/dir2/dir3* ***#* * # df -h|grep tank* * tank 229G 33K 229G 1% /tank* * tank/dir1 229G 34K 229G 1% /tank/dir1* * tank/dir1/dir2/dir3 229G 31K 229G 1% /tank/dir1/dir2/dir3* * #* On Mon, Jan 24, 2011 at 7:02 PM, Richard Elling <richard.ell...@gmail.com>wrote: > comment below... > > On Jan 24, 2011, at 1:58 PM, 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? > > > Yes. > With the -p option, ZFS will create: > /tank/dir1/dir2 > when that succeeds, it will try and create: > /tank/dir1/dir2/dir3 > > The creation of /tank/dir1/dir2 file system succeeds, as you note. > But the mounting of that file system fails because the /tank/dir1/dir2 > directory contains files. Therefore the /tank/dir1/dir2/dir3 file system > is not created. > -- richard > > >
_______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss