I dont know who needs this, but I have found many places and forums where the question has been asked but not satisfactory answered.

How to correctly reformat a Compact Flash-Card(CF-Card)

for the Psion 5(mx) without windows XP or prior, i.e on Linux.

This will work if you accidentally, reformated it to the wrong file system or renamed it from a computer and not on the Psion it self. Why this is an issue I don’t know, there are other interesting quirks with the psion and the CF-Card filesystem but we will get to that after the guide.

Note:

The CF-Card can be no larger than 2GB. All commands in this guide will be preceded by Command: , and example of the output from that command will be preceded by Output:

You can do this whole operation on a live USB disk, in case you don’t want or have Linux installed.

Open a terminal if you haven’t already, now would be a good time to plug your CF-Card into your computer, through an adapter or directly into your CF-Card reader.

Now we want to identify our CF-Card and make a note of the name it has in /dev.

Type:

Command: lsblk

Output:

NAME        MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
			sda           8:0    1   16M  0 disk 
			└─sda1        8:1    1   16M  0 part /media/user/USB-DRIVE
			sdb           8:16   1    0B  0 disk 
			sdc           8:32   1    0B  0 disk 
			nvme0n1     259:0    0  1,9T  0 disk 
			├─nvme0n1p1 259:1    0    1M  0 part 
			├─nvme0n1p2 259:2    0  513M  0 part /boot/efi
			└─nvme0n1p3 259:3    0  1,9T  0 part /

So as long as you know the size of you CF-Card its easy to identify what device it is. In this case it is sda. sda1 is a partition on the device, we will be removing this and or any pre-existing partitions in the comming steps. First we need to unmount any partition on our CF-Card that is, or has been, mounted. We can refer to the output above to identify the partition we need to unmount. Under the column MOUNTPOINTS we can see all mounted partitions on our system and their mountpoints, hence the name of the column. so in this case it is “sda1”, that is under “sda”. because it is mounted at /media/user/USB-DRIVE.

Type:

Command: sudo umount /dev/sda1

You will now be asked to type in your password, do that and press ENTER. Unless you typed the command or password wrong you should just get a new line with:

yourusername@yourcomputer:~$

Next we are going to use “fdisk”. Type:

Command: sudo fdisk /dev/sda

Output:

Welcome to fdisk (util-linux 2.39.3).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help):

we are now “in” the fdisk program and can ask it to do things by giving it commands. for example press “m” followed by ENTER, to see a list of possible commands. First we want to remove any pre existing partitions.

Type:

Command: d

Output:

Command (m for help): d
Selected partition 1
Partition 1 has been deleted.

Command (m for help):

Then we have to create a new empty MBR(DOS) partition table

Type: Command: o

Output:

Command (m for help): o
Created a new DOS (MBR) disklabel with disk identifier 0x9f0e8a9c.


Command (m for help):

And now we are ready to create a new partition that can be read by the Psion.

Type: Command: n

Output:

Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p):

Choose primary, ENTER to continue

Output:

Uses the default answer p.
Partition number (1-4, default value 1):

Type: 1 and press enter. this will create the partition sda1

Output:

First sector (2048-XXXXXXXXX, default value 2048):

Press enter to continue, cause we want the partition to start at the first sector.

Output:

Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-XXXXXXXXX, default value XXXXXXXXX):

Now we will choose the size of out partition, unless you want to make more than one partition you can just press ENTER here as well. otherwise you can specify the size my typing + followed by the size and lastly if it is in K(Kilobytes), M(Megabytes), etc. something like this +16M and then ENTER.

Output:

Created a new partition 1 of type "Linux" with size 16 MB.
Partition #1 contains a vfat signature.

Do you want to remove the signature? [Y]es/[N]o:

We are goint to specify that it is a FAT16 in the next step so I don’t think the answer to this question really matters, but choose No and press ENTER.

But before we specify the filesystem as FAT16, we need to make it Bootable.

Type:

Command: a

Output:

Command (m for help): a

Selected partition 1
The bootability flag for partition 1 is now enabled.

Command (m for help):

Now its time to make this partition FAT16, wich is what the Psion 5 and Psion 5mx requires.

Type:

Command: t

Output:

Command (m for help): t
Selected partition 1
Hex code or alias (type L to list all):

Type: 4 and press ENTER

Output:

Changed partition type "Linux" to "FAT16 <32M".

Command (m for help):

We can now type p to check that everything looks correct or w(followed by ENTER of course) to write the partition table to the disk. and q to quit fdisk.

You can use lsblk to double check that the CF-Card is not mounted before removing it from computer, but it shouldn’t be. Or why not mount it and copy over PsionDoom(https://github.com/doomhack/PsionDoom/releases/tag/0.2) and frag some monsters.

Some interesting discoveries: So apparently if you write any changes to the CF-Card from the Psion, like editing and saving a text file or creating a new folder on the Psion. All the files and folders will be “write protected” the next time you mount the CF-Card on your Linux system. But the same issue does not occur if you mount it on WinXP, I don’t know why, yet. but at least now you can move files to your Psion 5mx and use your additional storage space.

Hope you found this guide helpful and easy to follow along with.

Edit: Fixed some minor spelling mistakes, probably more that I didn’t find.

Edit 2: Ok turns out I’m an idiot. Indeed the Psion makes changes to the CF-Card when initializing it. It creates a hidden (only hidden on the psion, visible on linux) System folder. But that wasn’t the issue with the “write protection”. /u/infeeeee you beautiful bastard got me set off in the right direction.

Story Time

Although I figured that i was a permission issue I thought that the psion did something. Well it didn’t, I quickly figured out that it had something to do with the filesystems handling of permission, and went off to find answers on setting file ownership on FAT16, looking at documentation on the filesystem structure, most of which was comparisons to FAT32 - the successor. FAT16 is archaic, so finding useful information was not the easiest. Eventually I ended up on an old Redhat mailing list from 1998 and… no you can’t just mount a FAT16 drive and expect permissions. FAT16/32 does not handle permissions in the way that UNIX-Like systems does. FAT16 doesn’t handle them at all, as far as i can tell. This is also why I didn’t have this issue on my T30 Thinkpad with WinXP on it. So the problem was FAT16 all along. I only thought it was the psion because I never unmounted and mounted it with files added, without first plugging it in to my psion in between.

After this wild goose chase you might think; so nothing more to do? Well I also figured out a solution. We can use dmask!

first make sure the FAT16 partition isn’t mounted Make sure it is still /dev/sda1 with lsblk before unmounting.

Command:

sudo umount /dev/sda1

Then create a place for it to be mounted, in my case I will use " /media/user/", I’m running linux mint and if its located there I will be able to see it and access it from my file managers sidebar without any additional steps. otherwise you can use /mnt/

Command:

sudo mkdir /media/user/USB-DRIVE

Then we can use dmask to set default read write and execute permissions for the whole drive.

FAT16 does not support individual files or folders to have different ones.

Command:

sudo mount -t vfat -o dmask=000 /dev/sda1 /media/user/USB-DRIVE

Now you can move it back and forth as much as you want, no permission issues anymore. You might see a lock on the folder if you have auto mount but that disappears once you have opened a folder. cause now when the partition is mounted your system will “emulate” the non UNIX permission.

  • supersquirrel@sopuli.xyz
    link
    fedilink
    arrow-up
    13
    ·
    edit-2
    3 days ago

    I dont know who needs this, but I have found many places and forums where the question has been asked but not satisfactory answered.

    I have no clue, maybe nobody, but also… maybe lots of people! The great thing about the “threadiverse” is that this post can now float around bouncing off different servers and it gives your writeup the best chance of finding people who will find it useful.

    • foliumcreations@lemmy.worldOP
      link
      fedilink
      arrow-up
      11
      ·
      3 days ago

      Ohh you… That’s very nice of you to say.

      No I don’t work with writing documentation, but I’ve found that often times the "how to’s " miss the explanation part between steps, or don’t show enough examples for novices. Understanding what you are doing is sort of the point, and not adding context will make it harder for the reader to navigate any roadblocks that they may encounter. A step by step instruction shouldn’t leave you stuck on a step because the writer expects that you know how to navigate or find a specific menu. Unless it is explicitly stated of course. I don’t expect expert level documentation to also go through all the basics.

  • Empricorn@feddit.nl
    link
    fedilink
    English
    arrow-up
    4
    ·
    3 days ago

    It’s… beautiful! I loved my Psions. This would have definitely helped me if I still had them!

  • SW42@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    3 days ago

    I sadly don’t need it, but I remember seeing these things when they came out and I lusted for one so badly. Amazing tech for the time. Thank you very much for sharing this with us.

  • infeeeee@lemmy.zip
    link
    fedilink
    arrow-up
    3
    ·
    3 days ago

    All the files and folders will be “write protected” the next time you mount the CF-Card on your Linux system.

    How do you mount it? Maybe you just have to add an rw flag somewhere.

    • foliumcreations@lemmy.worldOP
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      2 days ago

      I’m an idiot, Indeed it was a permission issue, but the issue was FAT16. It does not handle permission the same way as UNIX systems. You got me on the right track, cause the solution was to use dmask to set default permissions to rwx for the whole partition on mount

    • foliumcreations@lemmy.worldOP
      link
      fedilink
      arrow-up
      3
      ·
      3 days ago

      I’ll check the read and write permission, but still a little odd if its that. Cause in only happens after the psion has written to the CF-Card.