Hi. I want to delete a whole series of snapshots. How do I go about that. I have tried doing a rm -rf of one of the snapshot directories but I''m not allowed since its read-only despite that I''m root. Do I use the zfs destroy command? I''d appreciate some help. Thanks. Kind regards. -- Luke Vanderfluit Analyst / Web Programmer e3Learning.com.au 08 8221 6422
I think zfs destroy is correct. Check ''man zfs'' for details - you probably have to supply the ''-r'' option for recursion. blake/ On 8/17/07, Luke Vanderfluit <luke.vanderfluit at e3learning.com.au> wrote:> > Hi. I want to delete a whole series of snapshots. > > How do I go about that. > > I have tried doing a rm -rf of one of the snapshot directories but I''m > not allowed since its read-only despite that I''m root. > > Do I use the zfs destroy command? > > I''d appreciate some help. Thanks. > > Kind regards. > > -- > Luke Vanderfluit > Analyst / Web Programmer > e3Learning.com.au > 08 8221 6422 > > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20070817/2be5bebb/attachment.html>
Hi. Thanks greatly for your reply. Since I am trying _not_ to inadvertently destroy anything but the snapshots... could you tell me your syntax? Kind regards. Luke. HHZEJJHLFSJL at spammotel.com wrote:> On Fri, 17 Aug 2007, Luke Vanderfluit wrote: > >> >> Do I use the zfs destroy command? >> >> > I use zfs destroy and it works-- Luke Vanderfluit Analyst / Web Programmer e3Learning.com.au 08 8221 6422
Hey, "zfs destroy snapshotname" is the way I use to remove snapshots. Kind regards, Steve On 8/17/07, Luke Vanderfluit <luke.vanderfluit at e3learning.com.au> wrote:> > Hi. > > Thanks greatly for your reply. > Since I am trying _not_ to inadvertently destroy anything but the > snapshots... could you tell me your syntax? > > Kind regards. > Luke. > > HHZEJJHLFSJL at spammotel.com wrote: > > On Fri, 17 Aug 2007, Luke Vanderfluit wrote: > > > >> > >> Do I use the zfs destroy command? > >> > >> > > I use zfs destroy and it works > > > -- > Luke Vanderfluit > Analyst / Web Programmer > e3Learning.com.au > 08 8221 6422 > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20070817/f3c3c8ed/attachment.html>
> Hi. I want to delete a whole series of snapshots. > > How do I go about that. > > I have tried doing a rm -rf of one of the snapshot directories but I''m > not allowed since its read-only despite that I''m root.You can''t use ''-r'' because the contents are immutable. But you may be able to simply ''rmdir'' the snapshot directory. -- Darren Dunham ddunham at taos.com Senior Technical Consultant TAOS http://www.taos.com/ Got some Dr Pepper? San Francisco, CA bay area < This line left intentionally blank to confuse you. >
To list your snapshots: /usr/sbin/zfs list -H -t snapshot -o name Then you could use that in a for loop: for i in `/usr/sbin/zfs list -H -t snapshot -o name` ; do echo "Destroying snapshot: $i" /usr/sbin/zfs destroy $i done The above would destroy all your snapshots. You could put a grep on the end to select certain ones by a specific string... For example: /usr/sbin/zfs list -H -t snapshot -o name | grep "aug-16" David This message posted from opensolaris.org
Now I''m curious. I was recursively removing snapshots that had been generated recursively with the ''-r'' option. I''m running snv65 - is this a recent feature? Example: 2007-07-08.05:48:36 zfs destroy -r tarn at 06_12_07 (this removed each recursive snapshot for all the filesystems contained in the ''tarn'' pool) Blake -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20070817/3dc3b120/attachment.html>
Blake wrote:> Now I''m curious. > > I was recursively removing snapshots that had been generated recursively > with the ''-r'' option. I''m running snv65 - is this a recent feature?No; it was integrated in snv_43, and is in s10u3. See: PSARC 2006/388 snapshot -r 6373978 want to take lots of snapshots quickly (''zfs snapshot -r'') --matt
On 18/08/07, Matthew Ahrens <Matthew.Ahrens at sun.com> wrote:> Blake wrote: > > Now I''m curious. > > > > I was recursively removing snapshots that had been generated recursively > > with the ''-r'' option. I''m running snv65 - is this a recent feature? > > No; it was integrated in snv_43, and is in s10u3. See: > > PSARC 2006/388 snapshot -r > 6373978 want to take lots of snapshots quickly (''zfs snapshot -r'')I think he was asking about recursive destroy, rather than create. I know recursive rename went in at b63, because it saves me a lot of work :) -- Rasputin :: Jack of All Trades - Master of Nuns http://number9.hellooperator.net/
Dick Davies wrote:> On 18/08/07, Matthew Ahrens <Matthew.Ahrens at sun.com> wrote: >> Blake wrote: >>> Now I''m curious. >>> >>> I was recursively removing snapshots that had been generated recursively >>> with the ''-r'' option. I''m running snv65 - is this a recent feature? >> No; it was integrated in snv_43, and is in s10u3. See: >> >> PSARC 2006/388 snapshot -r >> 6373978 want to take lots of snapshots quickly (''zfs snapshot -r'') > > I think he was asking about recursive destroy, rather than create. > I know recursive rename went in at b63, because it saves me a lot of > work :)Recursive destroy was integrated as part of the above mentioned psarc case & bug, in build 43. Glad you''re enjoying rename -r too! --matt
Matthew Ahrens wrote:> Dick Davies wrote: >> On 18/08/07, Matthew Ahrens <Matthew.Ahrens at sun.com> wrote: >>> Blake wrote: >>>> Now I''m curious. >>>> >>>> I was recursively removing snapshots that had been generated recursively >>>> with the ''-r'' option. I''m running snv65 - is this a recent feature? >>> No; it was integrated in snv_43, and is in s10u3. See: >>> >>> PSARC 2006/388 snapshot -r >>> 6373978 want to take lots of snapshots quickly (''zfs snapshot -r'') >> I think he was asking about recursive destroy, rather than create. >> I know recursive rename went in at b63, because it saves me a lot of >> work :) > > Recursive destroy was integrated as part of the above mentioned psarc case & > bug, in build 43.Just to bo be crystal clear: I''m talking about recursive destroy of a snapshot ("zfs destroy -r pool/fs at snap"), which destroys the snapshots created by "zfs snapshot -r". Recursive destroy of a filesystem (destroying all filesystems & snapshots beneath it) has been in ZFS since before it was integrated into Nevada. --matt
Hi. Thanks to everyone who helped me on this (-: That was a really good experience. Great list. I ended up using the script below (thanks David (-:). Kind regards. Luke. David Smith wrote:> To list your snapshots: > > /usr/sbin/zfs list -H -t snapshot -o name > > Then you could use that in a for loop: > > for i in `/usr/sbin/zfs list -H -t snapshot -o name` ; > do > echo "Destroying snapshot: $i" > /usr/sbin/zfs destroy $i > done > > The above would destroy all your snapshots. You could put a grep on the end to select > certain ones by a specific string... > > For example: > > /usr/sbin/zfs list -H -t snapshot -o name | grep "aug-16" > > David > > > This message posted from opensolaris.org > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss-- Luke Vanderfluit Analyst / Web Programmer e3Learning.com.au 08 8221 6422