English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   support.Other (https://eab.abime.net/forumdisplay.php?f=74)
-   -   Mounting AmigaOS 3.1 FFS partitions on Linux (https://eab.abime.net/showthread.php?t=108302)

Polom 20 September 2021 18:55

Mounting AmigaOS 3.1 FFS partitions on Linux
 
Hi everybody!

I'm not too sure about the right place for my question, therefore it put it here :D

I just formatted 4Gb CF on my Amiga 500 (Wicher 500i's IDE controller) and installed AmigaOS 3.1. It works fine.

Now I want to mount these partitions on my Linux system (Manjaro, if it matters).

I tried all that came to mind, then I searched for tutorials but so far, nothing works :guru

Here are some information and tests:

>sudo fdisk -l

Disk /dev/sdb: 3,92 GiB, 4204118016 bytes, 8211168 sectors
Disk model: USB CARD READER
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

> sudo parted /dev/sdb

(parted) p


Model: FNK TECH USB CARD READER (scsi)
Disk /dev/sdb: 4204118016B
Sector size (logical/physical): 512B/512B
Partition Table: amiga
Disk Flags:

Number Start End Size File system Name Flags
1 1032192B 68640767B 67608576B DH0 boot
2 68640768B 4204118015B 4135477248B DH1

(nothing in the File System column)



> mkdir amiga

> sudo mount -t affs -o offset=1032192 /dev/sdb /amiga


mount: /amiga: wrong fs type, bad option, bad superblock on /dev/loop40, missing codepage or helper program, or other error.


Sure, that's helpful, thanks! :D


> sudo dmesg


[60152.099618] affs: No valid root block on device loop40


I also tried the various steps described in this post, without success =>

https://gareth.halfacree.co.uk/2013/...es-under-linux

At this stage, some help would be very welcome! :)

Thanks!

thomas 20 September 2021 19:11

You need to specify the size as well as the offset. Try -o offset=1032192,sizelimit=67608576.

Polom 20 September 2021 19:23

Quote:

Originally Posted by thomas (Post 1507685)
You need to specify the size as well as the offset. Try -o offset=1032192,sizelimit=67608576.


Thank. It's better since there's no error message, however no partition appears to be mounted :banghead


>ls -la /dev/sd*
brw-rw---- 1 root disk 8, 0 20 sept. 19:15 /dev/sda
brw-rw---- 1 root disk 8, 2 20 sept. 19:15 /dev/sda2
brw-rw---- 1 root disk 8, 5 20 sept. 19:15 /dev/sda5
brw-rw---- 1 root disk 8, 6 20 sept. 19:15 /dev/sda6
brw-rw---- 1 root disk 8, 16 20 sept. 19:15 /dev/sdb

thomas 20 September 2021 19:29

You are not mounting a Linux partition, you mount a loop device on a file / block device.

Try ls -l /amiga

Polom 20 September 2021 19:36

Quote:

Originally Posted by thomas (Post 1507688)
You are not mounting a Linux partition, you mount a loop device on a file / block device.

Try ls -l /amiga


I'll have to read more about mount and loop devices. it works! :great


Now I have a read only access, is there anything to do about it? I read somewhere it was a limitation of this FFS implementation on Linux but it's better to ask :)



Ultimately my goal is to move stuff from/to this partition. I still need a "to".


Thanks!

Polom 21 September 2021 23:27

Follow up time!

In the Linux Kernel documentation I found the following:


-----
https://www.kernel.org/doc/html/late...tems/affs.html

Overview of Amiga Filesystems

Not all varieties of the Amiga filesystems are supported for reading and writing. The Amiga currently knows six different filesystems:

DOS0
The old or original filesystem, not really suited for hard disks and normally not used on them, either. Supported read/write.
DOS1
The original Fast File System. Supported read/write.
DOS2
The old “international” filesystem. International means that a bug has been fixed so that accented (“international”) letters in file names are case-insensitive, as they ought to be. Supported read/write.
DOS3
The “international” Fast File System. Supported read/write.
DOS4
The original filesystem with directory cache. The directory cache speeds up directory accesses on floppies considerably, but slows down file creation/deletion. Doesn’t make much sense on hard disks. Supported read only.
DOS5
The Fast File System with directory cache. Supported read only.
-----


Knowing that, I changed my partition type with HDInstTool to DOS3.

Now I can mount, read and write from Linux! Goal achieved? Almost.

One problem remains: when I copy files inside FS-UAE from a RDB file disk to the /amiga mount point (my compact flash), I loose the Execute attribute. Since I copied all my AmigaOS system partition that way, my startup-sequence was interrupted at... Setpatch! :D

I used "protect #? all +e" on the partition and after that it was booting fine but of course, Execute attributes are now spread where they shouldn't be, it would probably never be a problem but still, it's messy.

On https://www.kernel.org/doc/html/late...tems/affs.html I see more information about all attributes but tbh at this stage I don't understand "Why?".

If you guys could shed light on that little mystery, it would be most welcome! :)

thomas 22 September 2021 05:08

There is much more to lose than just the x bit. AmigaOS has eight protection bits and each file can have a comment. Linux has three bits and no comments. So you always lose information if you go through Linux. Additionally UAE does not know that you are accessing an Amiga partition, so it might well be UAE who removes the x bit because the files used by UAE are not executable on Linux.

You can mount a data partition on Linux to transfer downloaded lha files and such, but you should not mount your system partition on Linux.

You can rather use /dev/sdb as a hardfile in UAE. It's so much easier to access harddrives as files on Linux than on Windows for example, so why not use this feature. You might need to run UAE as superuser to get the required access, though.

admiral 22 September 2021 07:15

Linux supports RDB partition tables.

You'll need to build your kernel with that support enabled, as distributions generally do not enable it.

It's possible to use partx to force Linux to scan partitions and create block devices for them, should you setup a loop device and forget to do it with losetup itself.

FFS filesystems will mount fine, with write support.

Of course, if all you need is to move data around, remember amigaXfer is a thing, runs on Linux, and basic null-modem serial cables are trivial to make (RX<>TX and GND<->GND). AmigaXfer will only use the three wires.

Polom 23 September 2021 00:37

Quote:

Originally Posted by admiral (Post 1508011)
Linux supports RDB partition tables.

You'll need to build your kernel with that support enabled, as distributions generally do not enable it.


What is the name of that module? Thanks!

thomas 23 September 2021 05:23

Quote:

Originally Posted by admiral (Post 1508011)
Linux supports RDB partition tables.

This makes mounting easier but it does not change the limits of the AFFS implementatIon.

admiral 23 September 2021 06:32

Quote:

Originally Posted by Polom (Post 1508111)
What is the name of that module? Thanks!

https://www.kernelconfig.io/config_amiga_partition

No idea if it can even be built as a module.

Code:

zgrep CONFIG_AMIGA_PARTITION /proc/config.gz
If not set, it's time to build a kernel.


All times are GMT +2. The time now is 16:01.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.04411 seconds with 11 queries