Giter Club home page Giter Club logo

Comments (15)

relan avatar relan commented on August 11, 2024

Could you try the following patch?

diff --git a/mkfs/fat.c b/mkfs/fat.c
index c70dc86..0e9e4b0 100644
--- a/mkfs/fat.c
+++ b/mkfs/fat.c
@@ -28,7 +28,7 @@

 static off_t fat_alignment(void)
 {
-       return (off_t) 128 * get_sector_size();
+       return (off_t) 2048 * get_sector_size();
 }

 static off_t fat_size(void)

This will make FAT begin at 1 MB offset.

Actually first cluster sector is also different and this may be important for Zalman's implementation of exFAT. Let's check it if the patch above does not help.

from exfat.

Thermionix avatar Thermionix commented on August 11, 2024

Ok, now I'm reasonably confused.

I applied the patch and compiled, reformatted with and created the _ISO folder - still not detected by the firmware.

So, I re-ran the original script (128 first sector)
Unmounted, plugged the drive into windows, created the _ISO folder, unmounted, plugged into linux, mounted with fuse and copied in ISOs into the _ISO folder and it's now detected.

So seems to be related to folder creation under fuse.

I've now reproduced this;

Create _ISO folder at end of format.sh:

sudo mount ${DSK}1 /mnt
sudo mkdir /mnt/_ISO
sudo umount /mnt

Copy in some files to _ISO
_ISO not detected by firmware
Delete folder
Create _ISO folder on windows
Copy in clonezilla.iso to _ISO on linux
_ISO folder is detected by firmware

lin-created _ISO :
$ ls -la _ISO/
total 178560
drwx------ 1 thermionix users    131072 Sep  9 16:34 .
drwx------ 1 thermionix users    131072 Jan  1  1970 ..
-rwx------ 1 thermionix users 182452224 Aug  5 09:53 clonezilla-live-2.4.2-32-i686-pae.iso
-rwx------ 1 thermionix users        72 Aug 27 17:43 clonezilla-live-2.4.2-32-i686-pae.iso.md5

win-created _ISO :
$ ls -la
total 178560
drwx------ 1 thermionix users    131072 Sep  9 16:44 .
drwx------ 1 thermionix users    131072 Jan  1  1970 ..
-rwx------ 1 thermionix users 182452224 Aug  5 09:53 clonezilla-live-2.4.2-32-i686-pae.iso
-rwx------ 1 thermionix users        72 Aug 27 17:43 clonezilla-live-2.4.2-32-i686-pae.iso.md5

ls output is the same

anything further I can do to debug the folder diff?

from exfat.

relan avatar relan commented on August 11, 2024

anything further I can do to debug the folder diff?

Yes, it would be useful to compare root directories with the _ISO subdirectory created by Windows and by fuse-exfat. Please dump both using this command:

hexdump -C /dev/sdX | grep -A 32 '^.....000  [08]3 '

from exfat.

Thermionix avatar Thermionix commented on August 11, 2024

format.sh, create folder _ISO using fuse:
hex.lin.dump

00240000  83 09 6d 00 75 00 6c 00  74 00 69 00 70 00 61 00  |..m.u.l.t.i.p.a.|
00240010  73 00 73 00 00 00 00 00  00 00 00 00 00 00 00 00  |s.s.............|
00240020  81 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00240030  00 00 00 00 02 00 00 00  7e ee 00 00 00 00 00 00  |........~.......|
00240040  82 00 00 00 0d d3 19 e6  00 00 00 00 00 00 00 00  |................|
00240050  00 00 00 00 03 00 00 00  cc 16 00 00 00 00 00 00  |................|
00240060  05 02 f1 4d 30 00 00 00  6f bd 29 47 6f bd 29 47  |...M0...o.)Go.)G|
00240070  6f bd 29 47 00 00 00 00  00 00 00 00 00 00 00 00  |o.)G............|
00240080  40 03 00 0f 93 f2 00 00  00 00 02 00 00 00 00 00  |@...............|
00240090  00 00 00 00 05 00 00 00  00 00 02 00 00 00 00 00  |................|
002400a0  41 00 75 00 6e 00 74 00  69 00 74 00 6c 00 65 00  |A.u.n.t.i.t.l.e.|
002400b0  64 00 20 00 66 00 6f 00  6c 00 64 00 65 00 72 00  |d. .f.o.l.d.e.r.|
002400c0  85 02 fb 75 30 00 00 00  6f bd 29 47 6f bd 29 47  |...u0...o.)Go.)G|
002400d0  6f bd 29 47 00 00 00 00  00 00 00 00 00 00 00 00  |o.)G............|
002400e0  c0 03 00 04 34 e6 00 00  00 00 02 00 00 00 00 00  |....4...........|
002400f0  00 00 00 00 05 00 00 00  00 00 02 00 00 00 00 00  |................|
00240100  c1 00 5f 00 49 00 53 00  4f 00 00 00 00 00 00 00  |.._.I.S.O.......|
00240110  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

format.sh, create folder _ISO using windows:
hex.win.dump

00240000  83 09 6d 00 75 00 6c 00  74 00 69 00 70 00 61 00  |..m.u.l.t.i.p.a.|
00240010  73 00 73 00 00 00 00 00  00 00 00 00 00 00 00 00  |s.s.............|
00240020  81 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00240030  00 00 00 00 02 00 00 00  7e ee 00 00 00 00 00 00  |........~.......|
00240040  82 00 00 00 0d d3 19 e6  00 00 00 00 00 00 00 00  |................|
00240050  00 00 00 00 03 00 00 00  cc 16 00 00 00 00 00 00  |................|
00240060  85 02 8f 17 10 00 00 00  48 be 29 47 48 be 29 47  |........H.)GH.)G|
00240070  48 be 29 47 b5 b5 a8 a8  a8 00 00 00 00 00 00 00  |H.)G............|
00240080  c0 03 00 04 34 e6 00 00  00 00 02 00 00 00 00 00  |....4...........|
00240090  00 00 00 00 05 00 00 00  00 00 02 00 00 00 00 00  |................|
002400a0  c1 00 5f 00 49 00 53 00  4f 00 00 00 00 00 00 00  |.._.I.S.O.......|
002400b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

from exfat.

relan avatar relan commented on August 11, 2024

The only difference I see is the archive bit. Please try this patch:

diff --git a/libexfat/node.c b/libexfat/node.c
index 6e18c09..f3d10e0 100644
--- a/libexfat/node.c
+++ b/libexfat/node.c
@@ -973,7 +973,7 @@ int exfat_mkdir(struct exfat* ef, const char* path)
        int rc;
        struct exfat_node* node;

-       rc = create(ef, path, EXFAT_ATTRIB_ARCH | EXFAT_ATTRIB_DIR);
+       rc = create(ef, path, EXFAT_ATTRIB_DIR);
        if (rc != 0)
                return rc;
        rc = exfat_lookup(ef, &node, path);

from exfat.

Thermionix avatar Thermionix commented on August 11, 2024

Yep, Thanks! that works

for prosterity hex.lin2.dump:

00240000  83 09 6d 00 75 00 6c 00  74 00 69 00 70 00 61 00  |..m.u.l.t.i.p.a.|
00240010  73 00 73 00 00 00 00 00  00 00 00 00 00 00 00 00  |s.s.............|
00240020  81 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00240030  00 00 00 00 02 00 00 00  7e ee 00 00 00 00 00 00  |........~.......|
00240040  82 00 00 00 0d d3 19 e6  00 00 00 00 00 00 00 00  |................|
00240050  00 00 00 00 03 00 00 00  cc 16 00 00 00 00 00 00  |................|
00240060  05 02 20 72 10 00 00 00  ad 4d 2a 47 ad 4d 2a 47  |.. r.....M*G.M*G|
00240070  ad 4d 2a 47 64 64 00 00  00 00 00 00 00 00 00 00  |.M*Gdd..........|
00240080  40 03 00 0f 93 f2 00 00  00 00 02 00 00 00 00 00  |@...............|
00240090  00 00 00 00 05 00 00 00  00 00 02 00 00 00 00 00  |................|
002400a0  41 00 75 00 6e 00 74 00  69 00 74 00 6c 00 65 00  |A.u.n.t.i.t.l.e.|
002400b0  64 00 20 00 66 00 6f 00  6c 00 64 00 65 00 72 00  |d. .f.o.l.d.e.r.|
002400c0  85 02 2a 9a 10 00 00 00  ad 4d 2a 47 ad 4d 2a 47  |..*......M*G.M*G|
002400d0  ad 4d 2a 47 64 64 00 00  00 00 00 00 00 00 00 00  |.M*Gdd..........|
002400e0  c0 03 00 04 34 e6 00 00  00 00 02 00 00 00 00 00  |....4...........|
002400f0  00 00 00 00 05 00 00 00  00 00 02 00 00 00 00 00  |................|
00240100  c1 00 5f 00 49 00 53 00  4f 00 00 00 00 00 00 00  |.._.I.S.O.......|
00240110  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|

from exfat.

relan avatar relan commented on August 11, 2024

Fine! Thanks for spending your time for this investigation. I've pushed the fix into issue4 branch, will close this issue when I make a release.

from exfat.

Thermionix avatar Thermionix commented on August 11, 2024

Much appreciated for the help!

Another quick question, the FAT first sector is that of the partition or of the disk? (i.e. if I embed grub2, could there be any collision?)

from exfat.

relan avatar relan commented on August 11, 2024

the FAT first sector is that of the partition or of the disk?

It's relative to the beginning of the partition.

if I embed grub2, could there be any collision?

I have no idea how grub2 works, sorry.

from exfat.

teknoraver avatar teknoraver commented on August 11, 2024

Hi,

I'm finding the archive bit in newly created files, how can this be possible?

from exfat.

relan avatar relan commented on August 11, 2024

Hi,

I'm finding the archive bit in newly created files, how can this be possible?

This is possible because fuse-exfat code does so, see exfat_mknod().

from exfat.

teknoraver avatar teknoraver commented on August 11, 2024

Hi,

I'm finding the archive bit in newly created files, how can this be possible?

This is possible because fuse-exfat code does so, see exfat_mknod().

I see. How can I remove the archive bit? Some devices refuses to read the files with such bit.

from exfat.

relan avatar relan commented on August 11, 2024

How can I remove the archive bit?

You can modiy fuse-exfat source code. There's no option to manage the archive bit.

Some devices refuses to read the files with such bit.

I don't think that archive bit per se is a problem because Windows also sets it.

from exfat.

teknoraver avatar teknoraver commented on August 11, 2024

How can I remove the archive bit?

You can modiy fuse-exfat source code. There's no option to manage the archive bit.

Every time? Can't we add the possibility to change the but eg. via XATTRS?

Some devices refuses to read the files with such bit.

I don't think that archive bit per se is a problem because Windows also sets it.

Yes, but Windows also allows to clear it.

from exfat.

relan avatar relan commented on August 11, 2024

Can't we add the possibility to change the but eg. via XATTRS?

This would be nice to have. Patches are welcome.

from exfat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.