You are not logged in.

#1 2018-12-01 02:41:39

SlickBlackCadillac
Member
Registered: 2015-09-10
Posts: 15

[SOLVED] How do I "re-Unixfy" files from NTFS

I'm pretty good with Linux but I am lacking in knowledge of how files are stored in various filesystems.

I recently (and stupidly) moved files off of a Arch ext4 2TB drive to a Windows NTFS drive to hold them temporarily to reformat the 2TB drive. In doing so, I guess I somehow mucked up what makes a Unix file "magic" with it's permissions and such (in the inode i suppose?) and now the files take up way more space when I moved them back.

Those files on the Windows NTFS reads:

Size: 678GB
Size on disk: 678Gb

Those files moved to the newly formatted btrfs 2TB drive reads

Size: 678GB
Size on disk: 856GB

I know for a fact that before I moved them, they took up closer to 678. I also tried moving to XFS and EXT4 systems and I get very similar results!!

I really suspect that Windows mucked up the files and Linux is keeping them in their mucked up form. How do I get them back to being kosher so they stop taking up so much disk space???

Last edited by SlickBlackCadillac (2018-12-01 04:23:14)

Offline

#2 2018-12-01 03:10:46

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,532
Website

Re: [SOLVED] How do I "re-Unixfy" files from NTFS

You have at least two entirely different questions here.  First, on the permissions and ownership of files, that was not saved when transferred to NTFS.  It's lost, there is no way of getting it back other tha chown/chmodding each file appropriately.

As for the size, that would not result from such a transfer.  But more importantly, you've not really described that symptom well.  You list some "Size" and "Size on disk" values; what are these, where are they from?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2018-12-01 03:17:42

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,681

Re: [SOLVED] How do I "re-Unixfy" files from NTFS

Its possible there were some softlinks that were lost when the files were copied from unix fs to ntfs. That would be a possible explanation for the increased size

Offline

#4 2018-12-01 04:21:47

SlickBlackCadillac
Member
Registered: 2015-09-10
Posts: 15

Re: [SOLVED] How do I "re-Unixfy" files from NTFS

I do not mind losing the permissions. I can easily do those manually.

I did not have any symbolic links in that folder. Is that what you mean by softlinks?

Also, I got those numbers from the Windows Properties utility. First one was from the copies on the NTFS system which shows the 678GB only takes up 678GB on disk, and the other is the BTRFS copies of the data over Samba that show 678GB that taeks up 856GB on disk. I did a df -h on that disk and a du -h to confirm that it is indeed taking up 856GB of disk which is super frustrating. I know for a fact it can take up less space since that's all it took up before I moved it in the first place. The NTFS is outperforming it for crying out loud!

---------------


Ok so before posting this. I tried one more thing. I copied the data to an XFS volume where it did the same thing.....took up 856GB. But then I used to cp to move it to the BTRFS volume like I had intended. Magically its only taking up 680GB again. So yes, I did SOLVE this. But can someone please explain to me why this worked? Why would copying from NTFS to XFS/BTRFS/EXT4 cause the files to take up way too much space....but then moving it again to another XFS/BTRFS/EXT4 system magically solve this issue? Is there a process of fixing this on a volume in place without having to move the data back and forth between Unix filesystems? such as a fschk or defrag of some sort?

thanks!

Last edited by SlickBlackCadillac (2018-12-01 04:24:24)

Offline

#5 2018-12-01 04:58:51

headkase
Member
Registered: 2011-12-06
Posts: 2,004

Re: [SOLVED] How do I "re-Unixfy" files from NTFS

SlickBlackCadillac wrote:

Ok so before posting this. I tried one more thing. I copied the data to an XFS volume where it did the same thing.....took up 856GB. But then I used to cp to move it to the BTRFS volume like I had intended. Magically its only taking up 680GB again. So yes, I did SOLVE this. But can someone please explain to me why this worked? Why would copying from NTFS to XFS/BTRFS/EXT4 cause the files to take up way too much space....but then moving it again to another XFS/BTRFS/EXT4 system magically solve this issue? Is there a process of fixing this on a volume in place without having to move the data back and forth between Unix filesystems? such as a fschk or defrag of some sort?

Technically your thread isn't "solved" but rather you've found a work-around.  wink

Offline

#6 2018-12-01 15:17:06

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,715

Re: [SOLVED] How do I "re-Unixfy" files from NTFS

Are there a bunch of small files? ext does not support subblock allocation (A process in which partially used blocks at the end of files are shared by multiple files.)  Consider if the block size were 4k, and you had 1000 or so 1K files.  Without subblock allocation, those 1000 1K files won't take on the order of 1MB, they would take on the order of 4MB.   BTRS does support subblock allocation, and NTFS has partial support.   As to why you can go NTFS->BTRS->EXT, I have not a clue.   Other files systems that support it include Reiser and JFS.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB