Discussion:
Sparse files and Linux
Steve French
2014-08-08 21:07:47 UTC
Permalink
Tried a simple test to see about sparse file creation to Samba from Linux.

Results:
Local (ext4): both file1 and file2 are sparse
Remote over cifs to samba (unix extensions): file1 not sparse, file2 is
sparse
Remote over cifs to samba (unix extensions disabled): file1 and file2 not
sparse
Remove over smb3 to samba: file1 and file2 not sparse

Presumably can fix it with explicit set sparse.

#!/usr/bin/env python
#
# Test sparse file support

import os, struct, stat, sys

file1 = open("test_file1", "w")
file1.seek(200000000L)
file1.write("Hello")
file1.close

file2 = open("test_file2", "w")
file2.truncate(205000000L)
file2.write("Hello")
file2.close
--
Thanks,

Steve
Steve French
2014-08-08 21:31:32 UTC
Permalink
---------- Forwarded message ----------
From: Steve French <smfrench-***@public.gmane.org>
Date: Fri, Aug 8, 2014 at 4:07 PM
Subject: Sparse files and Linux
To: "linux-cifs-***@public.gmane.org" <linux-cifs-***@public.gmane.org>,
samba-technical <samba-technical-w/***@public.gmane.org>


Tried a simple test to see about sparse file creation to Samba from Linux.

Results:
Local (ext4): both file1 and file2 are sparse
Remote over cifs to samba (unix extensions): file1 not sparse, file2 is sparse
Remote over cifs to samba (unix extensions disabled): file1 and file2 not sparse
Remove over smb3 to samba: file1 and file2 not sparse

Presumably can fix it with explicit set sparse.

#!/usr/bin/env python
#
# Test sparse file support

import os, struct, stat, sys

file1 = open("test_file1", "w")
file1.seek(200000000L)
file1.write("Hello")
file1.close

file2 = open("test_file2", "w")
file2.truncate(205000000L)
file2.write("Hello")
file2.close
--
Thanks,

Steve
--
Thanks,

Steve
Loading...