[OpenIndiana-discuss] Question about disk space usage on iSCSI volumes

Randy S sim.ple at live.nl
Thu Feb 7 09:56:09 UTC 2013


Hallo Ian,


> Sparse provisioned?
Yes, does this make a difference when determining free space?

I will test you method.

If the system can recognize that data is being stored (watching the number of "zfs get usedbydataset" grow), you would expect that it can also recognize that data has been deleted, regardless of being copy on write.
However the usedbydataset does not decrease. If it doesn't decrease ever, what's the use of such an attribute?

Thanks,

R



> Date: Thu, 7 Feb 2013 14:59:54 +1300
> From: ian at ianshome.com
> To: openindiana-discuss at openindiana.org
> Subject: Re: [OpenIndiana-discuss] Question about disk space usage on iSCSI volumes
> 
> Randy S wrote:
> > Hi,
> >
> > although I am still trying to fix my multipath problem mentioned in another post I also have the following matter which maybe one of you guys can explain.
> >
> > I have created a zpool and a volume which has been exported via iSCSI. I want te create a script which shows me the exact free space on that particular volume. (OI 7)
> 
> Sparse provisioned?
> 
> > Using zfs get reservation,volsize,usedbydataset,written,usedbysnapshots <name of volume> you get all these nice numbers while filling up the drive from a client machine.
> >
> > As long as you are filling up the drive, calculations seem to be parallel with the actual situation.
> > As soon as you start deleting files and snapshots, it all becomes fuzzy, at least to me.
> >
> > Example, when you delete a snapshot, or all snapshots , the usedbysnapshots drops to 0 as it should.
> > When you delete files from the iscsi volume with the client, the "usedbydataset" number stays the same, rendering the calculation:
> 
> That is correct.  Freeing space on the client filesystem (unless it 
> implements SCSI UNMAP) does not free space the volume.  The volume has 
> no way of knowing the space has been freed.
> 
> > Now I read somewhere (a long time ago) that zfs has a certain mechanism to release free space to the system, I just cannot find the article anywhere now.
> >
> > So that is why I want to ask anybody here to explain to me how I could go about this.
> 
> The easiest(!) way is a follows:
> 
>   - Make sure the zvol has compression enabled.
>   - Create a filesystem on the client with compression off.
>   - Within that filesystem, fill the free space with a file of zeros 
> (this will compress to nothing on the volume):
> 
> dd if=/dev/zero of=dummy bs=1048576 &
> unlink dummy
> 
> When the dd finishes, you will have the same free space on the client 
> and server.  The unlink makes sure the dummy file disappears when the dd 
> fills the client.
> 
> -- 
> Ian.
> 
> 
> _______________________________________________
> OpenIndiana-discuss mailing list
> OpenIndiana-discuss at openindiana.org
> http://openindiana.org/mailman/listinfo/openindiana-discuss
 		 	   		  


More information about the OpenIndiana-discuss mailing list