Hi, I have a question about importing and exporting pools. I used files rather than disks, which I hope is close enough for this test. It seems that import/export creates some overhead in the pool, which is understandable. My question is, is there any way to reclaim this space? I create a small pool, based on a file: # mkfile 128m /tank/tpool # zpool create tpool /tank/tpool # zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT tank 10.1G 1.32G 8.80G 13% ONLINE - tpool 123M 32.5K 123M 0% ONLINE - After exporting the pool, then importing it back into my system, I can see the space used has gone up: # zpool export tpool # zpool import -d /tank tpool # zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT tank 10.1G 1.32G 8.80G 13% ONLINE - tpool 123M 68.0K 123M 0% ONLINE - If I repeat the export/import sequence about 40 times, I get this: # zpool list NAME SIZE USED AVAIL CAP HEALTH ALTROOT tank 10.1G 1.32G 8.80G 13% ONLINE - tpool 123M 1.94M 121M 1% ONLINE - Is there any way to reclaim this lost space? -- Eric Enright
On Tue, Nov 22, 2005 at 05:57:55PM -0500, Eric Enright wrote:> Hi, I have a question about importing and exporting pools. I used > files rather than disks, which I hope is close enough for this test. > > It seems that import/export creates some overhead in the pool, which > is understandable. My question is, is there any way to reclaim this > space?The space used is a result of our in-use spacemaps (which blocks are free, which are used). As you might expect, import/export writes some blocks, which allocates some space and frees others. The spacemap then takes up more space to represent this. Nothing to see here. This space will be relcaimed when we start to use up more space in the pool and the size of our spacemaps shrinks to 0. So while it may look like something to be concerned about, it''s not. As you write more data, the spacemaps will shrink in size and you''ll get the space back. --Bill
On 11/22/05, Bill Moore <Bill.Moore at sun.com> wrote:> On Tue, Nov 22, 2005 at 05:57:55PM -0500, Eric Enright wrote: > > Hi, I have a question about importing and exporting pools. I used > > files rather than disks, which I hope is close enough for this test. > > > > It seems that import/export creates some overhead in the pool, which > > is understandable. My question is, is there any way to reclaim this > > space? > > The space used is a result of our in-use spacemaps (which blocks are > free, which are used). As you might expect, import/export writes some > blocks, which allocates some space and frees others. The spacemap then > takes up more space to represent this. Nothing to see here. > > This space will be relcaimed when we start to use up more space in the > pool and the size of our spacemaps shrinks to 0. So while it may look > like something to be concerned about, it''s not. As you write more data, > the spacemaps will shrink in size and you''ll get the space back.I see, cool. Thanks for the explanation. -- Eric Enright