ZFS vs MDADM (Space used)

Notice: Page may contain affiliate links for which we may earn a small commission through services like Amazon Affiliates or Skimlinks.

djh82uk

New Member
Oct 10, 2011
2
0
0
Hi Guys

I have a query.

My exisiting storage server (used for media) has 10.7TB usable space (7 x 2TB drives in Raid5 via MDADM, formatted as EXT4, running in Ubuntu Server)

My Backup storage server (exact copy of main server above) has 10.9TB usable space (9 x 1.5TB drives in Raid-Z via Openindiana).

I have copied 9.04Tb from Main server to the ZFS backup server, where it only takes up 8.52TB. The file count is the same, hidden files are viewable.

Now is this that ZFS is that much more efficient? Could it be the ZFS de-duplication, or is there a problem with mdadm or do I have orphan files somewhere?

Im trying to get a solid answer to help me decide which route to take in the future as I am nearing upgrade time.

Im wondering if there are any tools that will help, can you tell what zfs has deduplicated?

Is there anyway to see where that space is being used up (only have CLI or web interface as option)?

Any advice would be appreciated
 

djh82uk

New Member
Oct 10, 2011
2
0
0
Actually, as I was typing my last message I was checking something.

On the root of my two server shares I have 2 folders on each. If I check the space of them individually they pretty much match up with their equivalent on the ZFS server (tho is slightly out). So it's as if the ubuntu server is using up 500GB for something.

DJH
 

Patrick

Administrator
Staff member
Dec 21, 2010
12,511
5,792
113
Very interesting. I have not tried this myself. Any screenshots by chance?
 

john4200

New Member
Jan 1, 2011
152
0
0
I am having a hard time making sense of your post. What do you mean you copied "9.04Tb" and it only takes up "8.52TB"? Be specific. How exactly did you measure those numbers? And did you actually mean TiB rather than TB? A 7 x 2TB RAID 5 should have 6 x 2TB = 12TB available, which is about 10.9TiB.

If you meant that you have 10.7TiB available, then you are missing about 1% of the 10.9TiB you should have. Maybe your ext4 filesystem has 1% reserved space? That would be about 234,000,000 blocks (512B each). Check it with:

# tune2fs -l /dev/sd_ | grep -i "reserved block count"

If you have reserved blocks and you want to reclaim the space:

# tune2fs -m 0 /dev/sd_

Regardless, if you copy data from one volume to another, it should take up about the same amount of space. If it does not, then things to check:

1) Are the units the same on each side? TB vs TiB

2) Is one filesystem doing any compression or de-duplication?

3) Do you have many thousands of very small files? I think linux defaults to a filesystem block size of 4KiB with ext4. That means that you will have wasted space approximately equal to 2KiB times the number of files in the filesystem, since each file will, on average, waste half a filesystem block. Well, unless you have a lot of exceedingly small files, less than 2KiB in size, in which case each file will waste more than half a filesystem block.