{"id":172,"date":"2011-02-14T00:06:22","date_gmt":"2011-02-14T04:06:22","guid":{"rendered":"http:\/\/blogs.tulsalabs.com\/?p=172"},"modified":"2025-11-12T02:24:50","modified_gmt":"2025-11-12T06:24:50","slug":"os-x-will-create-sparse-files-across-nfs-or-does-it","status":"publish","type":"post","link":"http:\/\/blogs.tulsalabs.com\/?p=172","title":{"rendered":"OS X will create sparse files across NFS, or does it?"},"content":{"rendered":"<pre>\r\nKinMage:src thomas$ sudo mount -o vers=3,intr 172.16.1.129:\/fooper \/mnt\r\nKinMage:src thomas$ ls -la \/mnt\r\ntotal 8\r\ndrwxrwxrwx   2 root  wheel  4096 Feb 13 21:50 .\r\ndrwxrwxr-t  24 root  admin  1224 Feb 13 21:54 ..\r\n<\/pre>\n<p>Where 172.16.1.129 is snakey, the Linux VM I am using for testing.<\/p>\n<p>And then:<\/p>\n<pre>\r\nKinMage:mnt thomas$ python punch.py \r\nKinMage:mnt thomas$ ls -la p*out\r\n-rw-r--r--  1 thomas  staff    1023 Feb 13 21:54 p1023.out\r\n-rw-r--r--  1 thomas  staff    1024 Feb 13 21:54 p1024.out\r\n-rw-r--r--  1 thomas  staff    1025 Feb 13 21:54 p1025.out\r\n-rw-r--r--  1 thomas  staff   10250 Feb 13 21:54 p10250.out\r\n-rw-r--r--  1 thomas  staff  102500 Feb 13 21:54 p102500.out\r\n-rw-r--r--  1 thomas  staff      64 Feb 13 21:54 p64.out\r\nKinMage:mnt thomas$ du -sh p*out\r\n1.0K\tp1023.out\r\n1.0K\tp1024.out\r\n1.5K\tp1025.out\r\n 10K\tp10250.out\r\n100K\tp102500.out\r\n512B\tp64.out\r\n<\/pre>\n<p>So it creates sparse files across NFS!<\/p>\n<p>Well, yes and no. It will only send a block of data across and then the<br \/>\nserver OS decides to create the sparse file or not.<\/p>\n<p>Another thing to note is that the size reported is flexible in the sense<br \/>\nthat the underlying file system interface determines how much space<br \/>\nis being reported:<\/p>\n<pre>\r\n[thomas@snakey fooper]$ du -sh p*out\r\n4.0K\tp1023.out\r\n4.0K\tp1024.out\r\n4.0K\tp102500.out\r\n4.0K\tp10250.out\r\n4.0K\tp1025.out\r\n4.0K\tp64.out\r\n<\/pre>\n<p>Ideally we would like the sizes to match, but since we are pulling a fast one, we get what we see.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>KinMage:src thomas$ sudo mount -o vers=3,intr 172.16.1.129:\/fooper \/mnt KinMage:src thomas$ ls -la \/mnt total 8 drwxrwxrwx 2 root wheel 4096 Feb 13 21:50 . drwxrwxr-t 24&#46;&#46;&#46;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,17,25],"tags":[],"class_list":["post-172","post","type-post","status-publish","format-standard","hentry","category-macs","category-nfs","category-python"],"_links":{"self":[{"href":"http:\/\/blogs.tulsalabs.com\/index.php?rest_route=\/wp\/v2\/posts\/172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blogs.tulsalabs.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blogs.tulsalabs.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blogs.tulsalabs.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blogs.tulsalabs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=172"}],"version-history":[{"count":3,"href":"http:\/\/blogs.tulsalabs.com\/index.php?rest_route=\/wp\/v2\/posts\/172\/revisions"}],"predecessor-version":[{"id":365,"href":"http:\/\/blogs.tulsalabs.com\/index.php?rest_route=\/wp\/v2\/posts\/172\/revisions\/365"}],"wp:attachment":[{"href":"http:\/\/blogs.tulsalabs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blogs.tulsalabs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=172"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blogs.tulsalabs.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}