[zfs-discuss] zfs create -p only creates the parent but not the child
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 228G32K /tank* *tank/dir1 31K 228G31K /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 228G33K /tank* *tank/dir1 63K 228G32K /tank/dir1* *tank/dir1/dir2 31K 228G31K /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] Question regarding incremental zfs send/recv for hundreds of zfs filesystems under one pool
There is only one pool and hundreds of zfs file systems under that pool. New file systems are getting created on the fly. Is it possible to automate zfs incremental send/recv in this scenario? My assumption is negative as incremental send/recv needs a full snapshot to be sent first before starting the incremental one. In our case file systems are getting created on the fly while incremental send/recv is active in parallel. Thanks in advance, --Rahul ___ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
Re: [zfs-discuss] zfs create -p only creates the parent but not the child
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 228G33K /tank* ***tank/dir1 95K 228G32K /tank/dir1* ***tank/dir1/dir2 63K 228G32K /tank/dir1/dir2* ***tank/dir1/dir2/dir331K 228G31K /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 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 228G32K /tank* > *tank/dir1 31K 228G31K /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 228G33K /tank* > *tank/dir1 63K 228G32K /tank/dir1* > *tank/dir1/dir2 31K 228G31K /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
Re: [zfs-discuss] Question regarding incremental zfs send/recv for hundreds of zfs filesystems under one pool
Thanks Ian for your response. So you are saying, if I create recursive snapshot of the pool, it will be able to do the incremental send/recv for the file systems created on the fly? I was thinking that if the file systems are created on the fly, then there is no previous snapshot for the newly created filesystems under that pool. So incremental send/recv will not work. On Mon, Jan 24, 2011 at 3:34 PM, Ian Collins wrote: > On 01/25/11 12:30 PM, Rahul Deb wrote: > > There is only one pool and hundreds of zfs file systems under that > pool. New file systems are getting created on the fly. > > Is it possible to automate zfs incremental send/recv in this scenario? > > My assumption is negative as incremental send/recv needs a full > snapshot to be sent first before starting the incremental one. In our > case file systems are getting created on the fly while incremental > send/recv is active in parallel. > > Provided you do a recursive snapshot of the pool then yes, it will work. > > -- > Ian. > > ___ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
[zfs-discuss] Question regarding "zfs snapshot -r"
Hello All, I have two questions related to "zfs snapshot -r" 1. When "zfs snapshot -r tank@today" command is issued, does it creates snapshots for all the descendent file systems at the same moment? I mean to say if the command is issued at 10:20:35 PM, does the creation time of all the snapshots for descendent file systems are same? 2. Say, tank has around 5000 descendent file systems and "zfs snapshot -r tank@today" takes around 10 seconds to complete. If there is a new file systems created under tank within that 10 seconds period, does that snapshot process includes the new file system created within that 10 seconds? OR it will exclude that newly created filesystem? Thanks, -- Rahul ___ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
Re: [zfs-discuss] Question regarding "zfs snapshot -r" and also regarding "zfs send -R"
Hello Eric, Thanks for your response. I have another question. This time regarding zfs send. I have updated the subject line to include "zfs send" question in this thread. If the pool tank has 5000 descendent file systems and the snapshots are being taken using "zfs snapshot -r". Now I will be sending and receiving incremental snapshot to a second system using the following command. "zfs send -R -i | ssh zfs recv -vFd tank" My question is: Is "zfs send -R " sends snapshot all at once OR does it send all the descendent snapshots serially(one after another) ? I am asking this because, if it sends serially, send/recv will take long time to finish based on the number of snapshots need to be send and this duration will gradually increase if number of snapshots also keep increasing. Is my assumption correct? Thanks, -- Rahul On Tue, Feb 1, 2011 at 5:05 PM, Eric D. Mudama wrote: > On Tue, Feb 1 at 10:54, Rahul Deb wrote: > >> Hello All, >> I have two questions related to "zfs snapshot -r" >> 1. When "zfs snapshot -r tank@today" command is issued, does it creates >> snapshots for all the�descendent file systems at the same moment? I mean >> to say if the command is issued at 10:20:35 PM, does the creation time of >> all the snapshots for descendent file systems are same? >> 2. Say, tank has around 5000 descendent file systems and "zfs snapshot -r >> tank@today" takes around 10 seconds to complete. If there is a new file >> systems created under tank within that 10 seconds period, does that >> snapshot process includes the new file system created within that 10 >> seconds? >> OR it will exclude that newly created filesystem? >> Thanks, >> -- Rahul >> > > I believe the contract is that the content of all recursive snapshots > are consistent with the instant in time at which the snapshot command > was executed. > > Quoting from the ZFS Administration Guide: > > Recursive ZFS snapshots are created quickly as one atomic > operation. The snapshots are created together (all at once) or not > created at all. The benefit of such an operation is that the snapshot > data is always taken at one consistent time, even across descendent > file systems. > > Therefore, in #2 above, the snapshot wouldn't include the new file in > the descendent file system, because it was created after the moment in > time when the snapshot was initiated. > > In #1 above, I would guess the snapshot time is the time of the > initial command across all filesystems in the tree, even if it takes > 10 seconds to actually complete the command. However, I have no such > system where I can prove this guess as correct or not. > > --eric > > -- > Eric D. Mudama > edmud...@mail.bounceswoosh.org > > ___ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
[zfs-discuss] Concurrent zfs send/recv for 100 file systems
Hi All, I have two text files: 1. *snap_prev.txt:* This one lists the name of the immediate previous snapshots of the 100 zfs file systems. One per line. 2. *snap_latest.txt:* This one contains the name of the corresponding latest snapshots of those 100 zfs file systems. One per line. Is it posible to send/recv these 100 snapshots to a second systems concurrently? Can someone point me to some sample bash script or to some URL? If I send them one after another, it takes more time based on the size of the filesystems. My idea is to send them concurrently so that it takes much more less time for send/recv operation to the second system. Thanks, -- Rahul ___ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
Re: [zfs-discuss] Concurrent zfs send/recv for 100 file systems
Sorry, I forgot to mention. This is for Incremental Snapshots On Fri, Feb 18, 2011 at 4:00 PM, Rahul Deb wrote: > Hi All, > > I have two text files: > > 1. *snap_prev.txt:* This one lists the name of the immediate previous > snapshots of the 100 zfs file systems. One per line. > > 2. *snap_latest.txt:* This one contains the name of the corresponding > latest snapshots of those 100 zfs file systems. One per line. > > Is it posible to send/recv these 100 snapshots to a second systems > concurrently? Can someone point me to some sample bash script or to some > URL? > > If I send them one after another, it takes more time based on the size of > the filesystems. My idea is to send them concurrently so that it takes much > more less time for send/recv operation to the second system. > > Thanks, > > -- Rahul > ___ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss