Page 2 of 2
Posted: Sat 17 Oct 2015, 08:39
by greengeek
Hi Scottman, I am trying to understand this better - would you say that the main purpose of a scratch file is to create a "virtual space" on a FAT or NTFS drive (which cannot normally retain Linux permissions) within which the permissions (and symlinks?) CAN be maintained correctly?
Are there other benefits you have found?
cheers!
Posted: Sat 17 Oct 2015, 09:38
by amigo
Yeah, that's right. What he called a scratch file is simply a file which is mounted via the kernels loopback device -created explicitly with 'losetup' or with 'mount -t loop). This works with any file system. The file (formatted with a filesystem) resides on the 'host' filesystem as a a single item -the direntry function doesn't know anything about the content.
This all work fine on NTFS -even without ntfs-3g. The native read-write mode of the kernels ntfs driver could even handle this. The difficult thing is getting the file created on the NTFS in a sane way -which means that it will pass checkdisk. Of course, creating the file under windows would be best -but not really what we want. The kernel-native RW ntfs driver will not work nicely for this, ntfs-3g would be better for creating the new file on NTFS -and for mounting the device for later access to and mounting of the file with the loopback device. The file can be formatted to whatever you like.