Re: [zfs-discuss] Listing snapshots in a pool

2010-02-22 Thread Darren J Moffat

On 22/02/2010 00:23, David Dyer-Bennet wrote:

I thought this was simple.  Turns out not to be.

bash-3.2$ zfs list -t snapshot zp1
cannot open 'zp1': operation not applicable to datasets of this type

Fails equally on all the variants of pool name that I've tried,
including zp1/ and zp1/@ and such.

You can do zfs list -t snapshot and get a list of all snapshots in all
pools. You can do zfs list -r -t snapshot zp1 and get a recursive list
of snapshots in zp1. But you can't, with any options I've tried, get a
list of top-level snapshots in a given pool. (It's easy, of course, with
grep, to get the bigger list and then filter out the subset you want).


zfs list -d 1 -t snapshot zp1

From zfs(1M)
 -d depth

 Recursively display any  children  of  the  dataset,
 limiting  the  recursion to depth. A depth of 1 will
 display only the dataset and its direct children.


--
Darren J Moffat
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] Listing snapshots in a pool

2010-02-22 Thread David Dyer-Bennet

On 2/22/2010 3:31 AM, Darren J Moffat wrote:

On 22/02/2010 00:23, David Dyer-Bennet wrote:

I thought this was simple.  Turns out not to be.

bash-3.2$ zfs list -t snapshot zp1
cannot open 'zp1': operation not applicable to datasets of this type

Fails equally on all the variants of pool name that I've tried,
including zp1/ and zp1/@ and such.

You can do zfs list -t snapshot and get a list of all snapshots in all
pools. You can do zfs list -r -t snapshot zp1 and get a recursive list
of snapshots in zp1. But you can't, with any options I've tried, get a
list of top-level snapshots in a given pool. (It's easy, of course, with
grep, to get the bigger list and then filter out the subset you want).


zfs list -d 1 -t snapshot zp1

From zfs(1M)
 -d depth

 Recursively display any  children  of  the  dataset,
 limiting  the  recursion to depth. A depth of 1 will
 display only the dataset and its direct children.



Yes, that seems to be the elegant solution; although it's not available 
in 2009.06, which is what I'm currently running (which I said in a part 
of my message which you snipped in quoting).


--
David Dyer-Bennet, d...@dd-b.net; http://dd-b.net/
Snapshots: http://dd-b.net/dd-b/SnapshotAlbum/data/
Photos: http://dd-b.net/photography/gallery/
Dragaera: http://dragaera.info

___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] Listing snapshots in a pool

2010-02-22 Thread David Dyer-Bennet
On Mon, February 22, 2010 11:06, Cindy Swearingen wrote:

 I can't find any other solution than what you have already determined,
 which is this one:

 # zfs list -r -t snapshot tank

 The -d option integrated into b114. I'm running b132 and I still can't
 get any combination of zfs list -d to work.

Well, that's a bit discouraging.  Thanks for checking out the possibilities!

The script I needed this for is probably working, using the workaround,
which makes me happy.  (It's only hit one time so far when it's supposed
to do something, so lots of it hasn't been tested for real yet.)

-- 
David Dyer-Bennet, d...@dd-b.net; http://dd-b.net/
Snapshots: http://dd-b.net/dd-b/SnapshotAlbum/data/
Photos: http://dd-b.net/photography/gallery/
Dragaera: http://dragaera.info

-- 
David Dyer-Bennet, d...@dd-b.net; http://dd-b.net/
Snapshots: http://dd-b.net/dd-b/SnapshotAlbum/data/
Photos: http://dd-b.net/photography/gallery/
Dragaera: http://dragaera.info

___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] Listing snapshots in a pool

2010-02-22 Thread Brandon High
On Mon, Feb 22, 2010 at 9:06 AM, Cindy Swearingen
cindy.swearin...@sun.com wrote:
 The -d option integrated into b114. I'm running b132 and I still can't
 get any combination of zfs list -d to work.

 Its Monday and my brain is slow to warm up. See below.

You probably don't have any snapshots for that dataset.

basestar:~$ zfs list -d 1 -t snapshot  tank
no datasets available
bh...@basestar:~$ zfs list -d 1 -t snapshot  tank/export/samba/public | head -2
NAME
USED  AVAIL  REFER  MOUNTPOINT
tank/export/samba/pub...@zfs-auto-snap:monthly-2009-11-10-12:01
51.0M  -   801G  -

-B

-- 
Brandon High : bh...@freaks.com
For sale: One moral compass, never used.
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


[zfs-discuss] Listing snapshots in a pool

2010-02-21 Thread David Dyer-Bennet

I thought this was simple.  Turns out not to be.

bash-3.2$ zfs list -t snapshot zp1
cannot open 'zp1': operation not applicable to datasets of this type

Fails equally on all the variants of pool name that I've tried, 
including zp1/ and zp1/@ and such.


You can do zfs list -t snapshot and get a list of all snapshots in all 
pools.  You can do zfs list -r -t snapshot zp1 and get a recursive 
list of snapshots in zp1.  But you can't, with any options I've tried, 
get a list of top-level snapshots in a given pool.  (It's easy, of 
course, with grep, to get the bigger list and then filter out the subset 
you want).


Am I missing something?  Has this been added after snv_111b?

--
David Dyer-Bennet, d...@dd-b.net; http://dd-b.net/
Snapshots: http://dd-b.net/dd-b/SnapshotAlbum/data/
Photos: http://dd-b.net/photography/gallery/
Dragaera: http://dragaera.info

___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] Listing snapshots in a pool

2010-02-21 Thread Dave

Try:

zfs list -r -t snapshot zp1

--
Dave

On 2/21/10 5:23 PM, David Dyer-Bennet wrote:

I thought this was simple.  Turns out not to be.

bash-3.2$ zfs list -t snapshot zp1
cannot open 'zp1': operation not applicable to datasets of this type

Fails equally on all the variants of pool name that I've tried,
including zp1/ and zp1/@ and such.

You can do zfs list -t snapshot and get a list of all snapshots in all
pools. You can do zfs list -r -t snapshot zp1 and get a recursive list
of snapshots in zp1. But you can't, with any options I've tried, get a
list of top-level snapshots in a given pool. (It's easy, of course, with
grep, to get the bigger list and then filter out the subset you want).

Am I missing something? Has this been added after snv_111b?


___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


Re: [zfs-discuss] Listing snapshots in a pool

2010-02-21 Thread David Dyer-Bennet

On 2/21/2010 7:33 PM, Dave wrote:

Try:

zfs list -r -t snapshot zp1


I hate to sound ungrateful; but what you suggest I try is something that 
I listed in my message as having *already* tried.


Still down there in the quotes, you can see it.  I listed two ways to 
get a superset of what I wanted, and pointed out that grep would then 
let you whittle it down, so I can make my script work.


I'm still looking for a cleaner way, because it seems like a weird thing 
not to be able to get directly from zfs list.  A solution was proposed 
to me in email that works in later versions, but wasn't in OpenSolaris 
2009.06: use the -d switch and set recursion to 1 level.  That seems 
like it will work, when a stable version including that option is 
released.  I'll note it in my code for use then.




On 2/21/10 5:23 PM, David Dyer-Bennet wrote:

I thought this was simple.  Turns out not to be.

bash-3.2$ zfs list -t snapshot zp1
cannot open 'zp1': operation not applicable to datasets of this type

Fails equally on all the variants of pool name that I've tried,
including zp1/ and zp1/@ and such.

You can do zfs list -t snapshot and get a list of all snapshots in all
pools. You can do zfs list -r -t snapshot zp1 and get a recursive list
of snapshots in zp1. But you can't, with any options I've tried, get a
list of top-level snapshots in a given pool. (It's easy, of course, with
grep, to get the bigger list and then filter out the subset you want).

Am I missing something? Has this been added after snv_111b?


___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss



--
David Dyer-Bennet, d...@dd-b.net; http://dd-b.net/
Snapshots: http://dd-b.net/dd-b/SnapshotAlbum/data/
Photos: http://dd-b.net/photography/gallery/
Dragaera: http://dragaera.info

___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss