Are dot files write protected in FAT FS?

Post here to share useful tips and tricks, to ask questions about using your DM42 or to report software-related problems
Post Reply
minimuck
Posts: 17
Joined: Thu Feb 04, 2021 5:14 pm

Are dot files write protected in FAT FS?

Post by minimuck »

Hi,

the first thing I usually do is to bring a relevant file system under git control. The first few git commits
of the FAT FS worked like a charm until I detached/attached the DM42 again.
New git commits caused git to crash because .git is not writable anymore, only a hard FAT reformat helped.
Can you confirm this, and if so why is that? Any chance to remove this? I really like to track the changes
and want to be able to pull/rebase from/to the DM.

Regards, Joachim
rprosperi
Posts: 1709
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

Re: Are dot files write protected in FAT FS?

Post by rprosperi »

Wow, you live under serious control...

It's possible the FAT implementation in the library doesn't support this, as it seems to be legal on actual FAT drives.

We'll have to wait to hear back from SM.
--bob p

DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
minimuck
Posts: 17
Joined: Thu Feb 04, 2021 5:14 pm

Re: Are dot files write protected in FAT FS?

Post by minimuck »

nah, I am not ;) That whole DM42/41x thing is so new to me that I don't want to accidentially remove or modify files that I would regret later on.
And git is so common to me that I don't even think about it. It is perfect to track any FS activity and keeping record of any changes you have made.
reavy
Posts: 101
Joined: Tue Feb 06, 2018 9:08 pm
Location: Phoenix, AZ

Re: Are dot files write protected in FAT FS?

Post by reavy »

Git doesn’t typically meddle with or care about any permissions flags on files. However, Git can be very sensitive to file system sync times, caching, and consistency. For an extreme example, try working with a Git repository on a floppy drive. I would personally recommend not running Git directly from the mounted DM storage but keeping a copy of a repo on your local machine and then using a script to copy changes to and from the DM’s storage. You’ll save yourself a lot of headache this way.
rprosperi
Posts: 1709
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

Re: Are dot files write protected in FAT FS?

Post by rprosperi »

I didn't know anything about git's timing sensitivity, but this does make perfect sense as the Flash FAT drive definitely is fairly slow for writing, so this probably is the cause. Given all that, I agree with reavy's suggestion, use git to manage a mirror of the FAT's content on the machine you use to manage stuff and you get the advantages of managed content in a way that isn't hindered but the FAT timing.
--bob p

DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
minimuck
Posts: 17
Joined: Thu Feb 04, 2021 5:14 pm

Re: Are dot files write protected in FAT FS?

Post by minimuck »

All good now, I think the reason was that the FS was not completely written back on DM's exit (I should have used umount or sync instead).
Easily to be verified:

mount the DM
mkdir xxx
EXIT from the DM
remount => xxx gone

same thing with sync or umount => xxx survives

Thanks for helping me :)
User avatar
akaTB
Posts: 794
Joined: Tue May 02, 2017 1:56 pm
Location: Milan, Italy

Re: Are dot files write protected in FAT FS?

Post by akaTB »

minimuck wrote:
Sun Mar 28, 2021 10:40 am
All good now, I think the reason was that the FS was not completely written back on DM's exit (I should have used umount or sync instead).
Easily to be verified:

mount the DM
mkdir xxx
EXIT from the DM
remount => xxx gone

same thing with sync or umount => xxx survives

Thanks for helping me :)
DM42 User Manual
v3.18a, Mar 2021
5.2.3.

Or just read that message on the display...
;)
Greetings,
    Massimo
ajcaton
-+×÷ left is right and right is wrong :twisted: Casted in gold
reavy
Posts: 101
Joined: Tue Feb 06, 2018 9:08 pm
Location: Phoenix, AZ

Re: Are dot files write protected in FAT FS?

Post by reavy »

I should have asked, because properly unmounting the DM’s storage is so important. I assumed the user was already doing that ;)

You might be able to add a Git hook to the various operations you’re using to force a sync every time. You’re back into floppy performance territory, but at least things shouldn’t break unexpectedly on you.

Edited to add: see Linus Torvalds’s various screeds on how messed up drive caching and file system syncing is in general these days.
Post Reply