English Amiga Board


Go Back   English Amiga Board > Support > support.FS-UAE

 
 
Thread Tools
Old 01 February 2024, 00:08   #1
danboid
Registered User
 
Join Date: Sep 2023
Location: England
Posts: 28
Question Mounting rdb affs .hdf files under Linux

If I dd my rdb .hdf (WB 3.1, ffs formatted) onto an SD card, I can mount it rw under Linux but I have not had any luck mounting the .hdf without dd'ing onto a SD card first. I've spent most of tonight messing with mount (with and without using a -o offset value in bytes that I got from parted) and losetup with no success. Most of the guides I've found online only cover mounting a physical disk under Linux and don't cover how to mount a (rdb) .hdf file.

Also, what is the correct procedure to backup and restore an affs formatted SD card under Linux? I tried doing it with dd but my restored SD card failed to boot on my A600.

I'd like to see the answers to these questions get added to the FS-UAE FAQ, I'm surprised they aren't covered already.

Thanks Amigans!

Last edited by danboid; 01 February 2024 at 00:35.
danboid is offline  
Old 01 February 2024, 00:58   #2
danboid
Registered User
 
Join Date: Sep 2023
Location: England
Posts: 28
Here's one guide that claims to do what I want but it doesn't work for me

http://www.andremiller.net/content/m...ns-using-linux

Where's the script to automate this process, the working process that is?
danboid is offline  
Old 01 February 2024, 01:47   #3
giantclam
Registered User
 
giantclam's Avatar
 
Join Date: Jan 2015
Location: australia
Posts: 486
Quote:
Originally Posted by danboid View Post
Here's one guide that claims to do what I want but it doesn't work for me

http://www.andremiller.net/content/m...ns-using-linux

Where's the script to automate this process, the working process that is?

That has nothing to do with amiga drives/partitions... try this -> https://gareth.halfacree.co.uk/2013/...es-under-linux
giantclam is offline  
Old 01 February 2024, 08:13   #4
danboid
Registered User
 
Join Date: Sep 2023
Location: England
Posts: 28
Quote:
Originally Posted by giantclam View Post
That has nothing to do with amiga drives/partitions... try this -> https://gareth.halfacree.co.uk/2013/...es-under-linux

Yep, I found that and you'll note that it only deals with mounting a physical disk. I want to mount a rdf format .hdf file, formatted with affs. Those steps do not work for me under Debian Linux but I can mount a SD card using the same format.

Because my .hdf only has one partition, I do not even need to specify an offset to mount it after dd'ing it onto a SD card but I want to cut that step out so that I can customize my install. I want to install fat95, the compact flash drivers, lha, whdload and xfs mainly. I'm sick of re-installing them every time my disk gets trashed which happens all too easily.

I'm sure there will be a way to duplicate my SD card under AmigaOS once I've customized it but I want to know how to do that bit under Linux which would seem like the better way to do it to me. dd didn't work for me but I probably didn't use the correct options when creating or restoring my disk image, if we can use Linux dd for this?

Last edited by danboid; 01 February 2024 at 08:43.
danboid is offline  
Old 01 February 2024, 08:52   #5
giantclam
Registered User
 
giantclam's Avatar
 
Join Date: Jan 2015
Location: australia
Posts: 486
Doh!.... my bad, forgot all about hardfile..... https://github.com/captain-amygdala/...g-a-shared-HDF

...about step 15 onwards is where I walked in on it, using debian12 amd64 (presuming parted is installed)... works, just tested it...

Code:
(parted) u b                                                              
(parted) p                                                                
Model:  (file)
Disk /home/gcb/Amiberry/hdf/workbench-135.hdf: 3145728B
Sector size (logical/physical): 512B/512B
Partition Table: amiga
Disk Flags: 

Number  Start     End       Size      File system  Name  Flags
 1      1034240B  3102719B  2068480B  affs1        DH0   boot

(parted) quit
root@gallah:/home/gcb/Amiberry/hdf# mount -t affs -o offset=1034240,sizelimit=2068480,setuid=1000,setgid=1000 workbench-135.hdf /tmp/1
root@gallah:/home/gcb/Amiberry/hdf# ls /tmp/1
AmigaBASIC	 BasicDemos.info  Disk.info   Expansion       FD1.3.info  libs	       Prefs	   Shell       System.info  Tools.info	   Utilities
AmigaBASIC.info  c		  Empty       Expansion.info  fonts	  PCUtil       Prefs.info  Shell.info  t	    Trashcan	   Utilities.info
BasicDemos	 devs		  Empty.info  FD1.3	      l		  PCUtil.info  s	   System      Tools	    Trashcan.info
...I mowed the lawn in penance =)
giantclam is offline  
Old 01 February 2024, 21:37   #6
danboid
Registered User
 
Join Date: Sep 2023
Location: England
Posts: 28
Thanks giantclam!

Yes, that mount command works with my rdb .hdf file. None of the posts or guides I found yesterday mentioned having to use the sizelimit mount option. I shall see if I can get the fs-uae maintainers to put that command somewhere where its easier to find because its very useful and I didn't come across that guide you linked in your previous post, plus it was buried quite deep within it.

I will have to have another go at using dd to try backing up my Amiga SD card. I reckon it will be a similar procedure where I'll have to specify the exact size of the partition to dd instead of just backing up and restoring the whole disk, although I'm unsure why that didn't work for me last time I tried it.
danboid is offline  
Old 01 February 2024, 22:05   #7
danboid
Registered User
 
Join Date: Sep 2023
Location: England
Posts: 28
I have sent this email to the FS-UAE maintainer:

Hi Frode

I would like to see the process for mounting (affs) .hdf files under Linux documented somewhere thats easy to find on the FS-UAE site because its not at all obvious how to do it but its very useful.

I never owned a HD for any of my Amigas back in the 90's but I've started using the Amiga again recently and now I have a IDE SD card adapter and I've been disappointed to see how easy it is to trash AmigaOS so that it becomes unbootable, leading to frequent re-installs.

I got sick of having to install all of the libraries and tools required to use my SD card and load and run software (lha, xfs, WHDload, fat95, dopus, cfd etc etc) over and over and so it seemed the best way to fix this was to mount my WB .hdf, copy the programs into it, set them all up and then I can easily backup and restore the fully configured .hdf file but I could not find the correct mount command after hours of searching last night. Thankfully EAB came to my rescue:

https://eab.abime.net/showthread.php?t=116826

I would suggest we add the instructions to mount a (affs formatted) .hdf file under Linux to either:

https://fs-uae.net/docs/linux

Which is totally empty at present so that seems like an ideal place to put this info or:

https://fs-uae.net/docs/faq

If you would like me to take those instructions from the forum and rewrite it in an easier to read manner for your site I'm happy to do that.

Thanks
danboid is offline  
Old 14 February 2024, 15:24   #8
Jope
-
 
Jope's Avatar
 
Join Date: Jul 2003
Location: Helsinki / Finland
Age: 43
Posts: 9,863
You could do it much easier without looking up any offsets. losetup -P asks the kernel to probe the partition table of whatever image you are mounting via loop.

Code:
jope@o790:/tmp$ sudo losetup -Pf tero.hdf
jope@o790:/tmp$ losetup -l
NAME       SIZELIMIT OFFSET AUTOCLEAR RO BACK-FILE     DIO LOG-SEC
/dev/loop0         0      0         0  0 /tmp/tero.hdf   0     512
jope@o790:/tmp$ sudo dmesg | grep loop0
[17288785.602481] loop0: detected capacity change from 0 to 2059140
[17288785.603033]  loop0: RDSK (512) p1 (DOS^A)(res 2 spb 1) p2 (DOS^A)(res 2 spb 1) p3 (DOS^A)(res 2 spb 1) p4 (DOS^A)(res 2 spb 1) p5 (DOS^A)(res 2 spb 1)
jope@o790:/tmp$ lsblk /dev/loop0
NAME      MAJ:MIN RM    SIZE RO TYPE MOUNTPOINTS
loop0       7:0    0 1005.4M  0 loop 
??loop0p1 259:0    0   40.7M  0 part 
??loop0p2 259:1    0   70.2M  0 part 
??loop0p3 259:2    0  291.7M  0 part 
??loop0p4 259:3    0  300.2M  0 part 
??loop0p5 259:4    0  301.3M  0 part
jope@o790:/tmp$ sudo mount -t affs -o ro /dev/loop0p1 /mnt
jope@o790:/tmp$ ls /mnt
C          Expansion        L             Preferences.info  Snap.pic      T              Utilities       side
Classes    Expansion.info   Libs          Prefs             Storage       Tools          Utilities.info
Data2      FileMaster       Locale        Prefs.info        Storage.info  Tools.info     WBStartup
Devs       FileMaster.info  MonitorStore  Rexxc             System        Trashcan       Wbstartup.info
Devs.info  Fonts            Preferences   S                 System.info   Trashcan.info  disk.info
jope@o790:/tmp$ sudo umount /mnt
jope@o790:/tmp$ sudo losetup -d /dev/loop0
Jope is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting AmigaOS 3.1 FFS partitions on Linux Polom support.Other 10 23 September 2021 06:32
Mounting .hdf files from Linux side? How? Hercules support.OtherUAE 5 13 January 2020 10:48
Do the LITE or FULL HDF files require RDB Mode? Foebane project.ClassicWB 11 28 April 2018 18:19
Mounting HDF with RDB in GNU/Linux Gaula92 support.Other 0 25 August 2016 12:04
FFS, RDB and autobooting questions mark_k Coders. System 2 19 February 2013 13:59

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 19:14.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07771 seconds with 13 queries