Jose Luis Lopez Campoy
2008-Oct-30 15:40 UTC
[zfs-discuss] Managing low free space and snapshots
Good evening! Here at work we are considering switching our linux-based NAS systems to OpenSolaris because of ZFS, but I have some doubts. Imagine we have a 500Gb hard disk full of data. We do an snapshot of the data, for backup or whatever, then we delete those files and try to save another 500 gigs of info there. How does the copy-on-write manage the free space? What would happen in that case? Would it look like the hard disk is empty to the network users when in fact is full because of the snapshot? Would the snapshot be overwritten or the system would warn there is no free space? Thanks in advance. -- This message posted from opensolaris.org
Hello, In the situation you have described, if i understood well, you would not have any space. When you take a snapshot, your snapshot is referencing the blocks older than it... Ex.: You have a 500gb disk, and create a 5gb file, you got 495gb free space. So you delete the file, you have 500gb again. But if you take a snapshot *before* delete the file, that file is still there (in the snap), and using space (5gb)... ;-) Leal [http://www.posix.brte.com.br/blog] -- This message posted from opensolaris.org
Michael Schuster
2008-Oct-30 22:32 UTC
[zfs-discuss] Managing low free space and snapshots
Jose Luis Lopez Campoy wrote:> Good evening! > > Here at work we are considering switching our linux-based NAS systems to > OpenSolaris because of ZFS, but I have some doubts. > > Imagine we have a 500Gb hard disk full of data. We do an snapshot of the > data, for backup or whatever, then we delete those files and try to save > another 500 gigs of info there.that won''t work - the snapshot is will cause the data to be retained *as it was at the time of taking the snapshot*.> How does the copy-on-write manage the free space?the space isn''t free as long as there''s a snapshot referencing it.> Would the snapshot be overwritten or the system would warn there is no > free space?I''d expect you''d get "no free space" or something like that. Michael -- Michael Schuster http://blogs.sun.com/recursion Recursion, n.: see ''Recursion''
As others have said, ZFS works a little differently to a standard file system. Basically remember that you don''t get anything for free. I think of snapshots as an efficient way of storing backups. You have a copy of all your data, but it''s still a copy that''s stored on the disk. The real benefit is when you realise how little data changes. At work we have around 500GB of live data, but our rate of change is only around 50GB per year. That means a 1TB drive can store all our live data, and potentially around ten years worth of snapshot backups too. The biggest downside to snapshots is that you can''t easily free up space. So long as you are aware of that, and plan accordingly, the benefits are well worth it. -- This message posted from opensolaris.org