{"id":461,"date":"2012-04-06T14:50:59","date_gmt":"2012-04-06T12:50:59","guid":{"rendered":"http:\/\/lallafa.de\/blog\/?p=461"},"modified":"2012-04-06T14:50:59","modified_gmt":"2012-04-06T12:50:59","slug":"cf-card-rdbtool","status":"publish","type":"post","link":"https:\/\/lallafa.de\/blog\/2012\/04\/cf-card-rdbtool\/","title":{"rendered":"CF card partitioning with rdbtool"},"content":{"rendered":"<p>Here is my little easter present for you: I finished the first release of <a title=\"rdbtool\" href=\"http:\/\/lallafa.de\/blog\/amitools\/rdbtool\/\">rdbtool<\/a>. &#8220;What&#8217;s that?&#8221; you may ask. It&#8217;s a new member of <a title=\"amitools\" href=\"http:\/\/lallafa.de\/blog\/amitools\/\">amitools<\/a>, a family of cross-platform Classic Amiga tools I am developing. rdbtool is a command line utility that allows you to inspect, change or create new disk images or even real disks with Amiga&#8217;s RDB partitioning format. Its a companion tool to <a title=\"xdftool\" href=\"http:\/\/lallafa.de\/blog\/amitools\/xdftool\/\">xdftool<\/a> that handles Amiga&#8217;s file system in disk images or on the RDB partitions.<\/p>\n<p>I had the idea for this tool while changing the CF flash card of my A1200. I removed the old card, had look at the files found there and wanted to retrieve files from there and then set up a new shiny card and build up partitions there. The current way to accomplish this, is to dump the card&#8217;s raw data from the block device and use this image as a RDB hard disk image in UAE to retrieve the files from there. Same thing with partitioning the new card: mount the block device or an empty image in UAE, run HDToolBox there, format partitions and copy files around in the virtual Amige environment&#8230; This works, but its a roundabout way. I wanted to have a nifty tool the works directly on my Mac&#8217;s Terminal&#8230; \ud83d\ude42<\/p>\n<p>Read on to see how this task (and lots more!) can be achieved with rdbtool&#8230;<\/p>\n<h4><!--more-->Inspecting an old CF Card<\/h4>\n<p>Ok, here we go: I unmount the CF card from the A1200 and insert it into my CF card USB reader on my Mac. Mac OS X tells me that it can&#8217;t find a valid file system on it (and that&#8217;s true for osx :)) &#8211; we ignore this and cancel the request to initalize (= format) it. First thing is now to find out the block device for this disk. On OS X I call a:<\/p>\n<pre>&gt; diskutil list<\/pre>\n<p>and it gives me:<\/p>\n<pre>\/dev\/disk2\r\n #:\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 TYPE NAME\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 SIZE\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 IDENTIFIER\r\n 0:\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 *4.0 GB\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 disk2<\/pre>\n<p>The empty Type Name gives you the hint that the partioning format is not recognized by OS X! So, it&#8217;s <strong>\/dev\/disk2<\/strong>&#8230; On Linux or other Posix systems the naming of raw block devices is slighty different (e.g. \/dev\/sd?). Just have a look at your system manuals (or dmesg) for details&#8230;<\/p>\n<p>Now I use rdbtool to list the partition setup directly on the card:<\/p>\n<pre>&gt; rdbtool \/dev\/disk2 info\r\nPhysicalDisk:\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 7817\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 7880544\u00c2\u00a0 3.8Gi\u00c2\u00a0 heads=16 sectors=63\r\nLogicalDisk:\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 2\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 7817\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 7878528\u00c2\u00a0 3.8Gi\u00c2\u00a0 rdb_blks=[0:2015,#2016] used=[hi=60,#61] cyl_blks=1008\r\nPartition: #0 'CDH0'\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 2\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 103\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 102816\u00c2\u00a0\u00c2\u00a0 50Mi\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1.31%\u00c2\u00a0 DOS3 bootable pri=0\r\nPartition: #1 'DH0'\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 104\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 205\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 102816\u00c2\u00a0\u00c2\u00a0 50Mi\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1.31%\u00c2\u00a0 DOS3\r\nPartition: #2 'DH1'\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 206\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 2035\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1844640\u00c2\u00a0 900Mi\u00c2\u00a0\u00c2\u00a0 23.41%\u00c2\u00a0 DOS3\r\nPartition: #3 'DH2'\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 2036\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 3763\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1741824\u00c2\u00a0 850Mi\u00c2\u00a0\u00c2\u00a0 22.11%\u00c2\u00a0 DOS3\r\nPartition: #4 'DH3'\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 3764\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 3909\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 147168\u00c2\u00a0\u00c2\u00a0 71Mi\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1.87%\u00c2\u00a0 DOS3\r\nPartition: #5 'CDH1'\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 3910\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 3971\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 62496\u00c2\u00a0\u00c2\u00a0 30Mi\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 0.79%\u00c2\u00a0 DOS3\r\nPartition: #6 'DH4'\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 3972\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 4124\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 154224\u00c2\u00a0\u00c2\u00a0 75Mi\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1.96%\u00c2\u00a0 DOS3\r\nPartition: #7 'DH5'\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 4125\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 5953\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1843632\u00c2\u00a0 900Mi\u00c2\u00a0\u00c2\u00a0 23.40%\u00c2\u00a0 DOS3\r\nPartition: #8 'DH6'\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 5954\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 7817\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1878912\u00c2\u00a0 917Mi\u00c2\u00a0\u00c2\u00a0 23.85%\u00c2\u00a0 DOS3\r\nFileSystem #0 DOS1 version=40.1 size=24588 seg_list_blk=0xb global_vec=0xffffffff<\/pre>\n<p>Wow! Got a lot of partitions there&#8230; With the drive names (DH0, &#8230;) at hand you use xdftool to access the file system on each partition (I use -r option here to enable read-only mode &#8211; just for safety reasons):<\/p>\n<pre>&gt; xdftool -r \/dev\/disk2 open part=DH1 + list\r\nGames 1\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 VOLUME\u00c2\u00a0 --------\u00c2\u00a0 29.03.1993 11:35:33 t46\u00c2\u00a0 \r\n  Disk.info\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 364\u00c2\u00a0 ----rw-d\u00c2\u00a0 29.03.1993 11:35:33 t47\r\n...<\/pre>\n<p>With the unpack command of <a title=\"xdftool\" href=\"http:\/\/lallafa.de\/blog\/amitools\/xdftool\/\">xdftool<\/a> I was able to easily recover all files of a partition into a directory structure on my Mac.<\/p>\n<p>The info output also showed that a file system driver was also embedded in the RDB structure. You can use the <strong>fsget<\/strong> command to retrieve the Amiga loadSeg()able binary:<\/p>\n<pre>&gt; rdbtool \/dev\/disk2 fsget 0 ffs<\/pre>\n<p>0 is the number of the first and only file system driver on this disk and &#8220;ffs&#8221; is the local Mac file name for the binary:<\/p>\n<pre>&gt; ls -la ffs\r\n-rw-r--r--\u00c2\u00a0 1 chris\u00c2\u00a0 staff\u00c2\u00a0 24588\u00c2\u00a0 6 Apr 13:48 ffs\r\n<\/pre>\n<p>You can also have a closer look of the internals of the RDB structure with the <em>map<\/em> and <em>show<\/em> commands. Map shows the contents of the RDB area and describes the contents of each block (see rdbtool page for details) while show dumps all blocks describing the RDB:<\/p>\n<pre>&gt; rdbtool \/dev\/disk2 map\r\n000000:\u00c2\u00a0 RD P0 P1 P2 P3 P4 P5 P6 P7 P8 F0 F0 F0 F0 F0 F0\r\n000016:\u00c2\u00a0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0\r\n000032:\u00c2\u00a0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0\r\n000048:\u00c2\u00a0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 F0 -- -- --\r\n...<\/pre>\n<pre>&gt; rdbtool \/dev\/disk2 show\r\nRigidDiskBlock(0):\r\n types:\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 5244534b\/0 (valid: 5244534b\/0)\r\n chksum:\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 0x7471bb06 (got) 0x7471bb06 (calc)\r\n valid:\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 True\r\n size:\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 64\r\n host_id:\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 7\r\n block_size:\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 512\r\n flags:\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 0x00000017\r\n badblk_list:\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 none\r\n part_list:\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1\r\n fs_list:\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 10\r\n init_code:\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 none\r\n...<\/pre>\n<p>While working on a real disk you do not want to alter, it is advisable to either use the -r switch to enable <strong>read-only mode<\/strong> in rdbtool or simply copy the whole disk into a <strong>disk image<\/strong> and work on the image (if you have the disk space available, of course!):<\/p>\n<pre>&gt; dd if=\/dev\/disk2 of=disk.rdb bs=512\r\n&gt; rdbtool disk.rdb list<\/pre>\n<p>That&#8217;s it for inspecting an existing RDB disk. Now let&#8217;s create an own, new one&#8230;<\/p>\n<h5>Partitioning a new Disk<\/h5>\n<p>Insert a shiny new CF card into your card reader. Typically some FAT file system already resides on a partition of the card. First thing is to remove the existing partioning layout. On OSX I do (for \/dev\/disk1):<\/p>\n<pre>&gt; diskutil partitionDisk disk1 free none 100%<\/pre>\n<p>Now rdbtool can access the disk. The first command we will issue is an<strong> init<\/strong>, it will create an empty RDB block on the disk. The info will show an empty layout:<\/p>\n<pre>&gt; rdbtool \/dev\/disk1 init + info\r\nPhysicalDisk:\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 61999\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1984000\u00c2\u00a0 968Mi\u00c2\u00a0 heads=1 sectors=32\r\nLogicalDisk:\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 61999\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1983968\u00c2\u00a0 968Mi\u00c2\u00a0 rdb_blks=[0:31,#32] used=[hi=0,#1] cyl_blks=32<\/pre>\n<p>A logical RDB disk is created automatically but no partition exist yet. So let&#8217;s add some! The <strong>add<\/strong> command adds a partition and only requires a size given either in percent (20%), bytes (2Mb), KiBytes (2Mib), or cylinders (20). If no start is given then the next free region on the logical disk is chosen:<\/p>\n<pre>&gt; rdbtool \/dev\/disk1 add size=50Mib + add size=100Mib + fill + info\r\nPhysicalDisk:\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 61999\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1984000\u00c2\u00a0 968Mi\u00c2\u00a0 heads=1 sectors=32\r\nLogicalDisk:\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 61999\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1983968\u00c2\u00a0 968Mi\u00c2\u00a0 rdb_blks=[0:31,#32] used=[hi=3,#4] cyl_blks=32\r\nPartition: #0 'DH0'\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 3200\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 102400\u00c2\u00a0\u00c2\u00a0 50Mi\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 5.16%\u00c2\u00a0 DOS3\r\nPartition: #1 'DH1'\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 3201\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 9600\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 204800\u00c2\u00a0 100Mi\u00c2\u00a0\u00c2\u00a0 10.32%\u00c2\u00a0 DOS3\r\nPartition: #2 'DH2'\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 9601\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 61999\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1676768\u00c2\u00a0 818Mi\u00c2\u00a0\u00c2\u00a0 84.52%\u00c2\u00a0 DOS3\r\n<\/pre>\n<p>Note the <strong>fill<\/strong> command: It will create a partition to fill the remaining space on the logical disk.<\/p>\n<p>You can alter settings of a partition with the <strong>change<\/strong> command: I use it to make the first partition bootable and set its priority:<\/p>\n<pre>&gt; rdbtool \/dev\/disk1 change DH0 bootable pri=10 + info\r\n...\r\nPartition: #0 'DH0'\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 3200\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 102400\u00c2\u00a0\u00c2\u00a0 50Mi\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 5.16%\u00c2\u00a0 DOS3 bootable pri=10\r\n...<\/pre>\n<p>(See <a title=\"rdbtool\" href=\"http:\/\/lallafa.de\/blog\/amitools\/rdbtool\/\">rdbtool manual page<\/a> for more options). You can also pass these options to the add command in the previous step for a more compact usage of the tool.<\/p>\n<p>The partition layout is already finished, the only thing I&#8217;d like to add to my RDB is the FFS file system driver restored from the old card (see above):<\/p>\n<pre>&gt; rdbtool \/dev\/disk1 fsadd ffs + info\r\nERROR adding filesystem! (no space in RDB left)<\/pre>\n<p>Oops! There is not enough space left for the file system. I have to recreate the RDB with more space reserved for the filesystem (see rdb_cyls = reserve a number of cylinders for RDB usage):<\/p>\n<pre>&gt; rdbtool \/dev\/disk1 init rdb_cyls=2 + add size=50Mib bootable pri=10 + add size=100Mib + fill + fsadd ffs + info\r\nPhysicalDisk:\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 61999\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1984000\u00c2\u00a0 968Mi\u00c2\u00a0 heads=1 sectors=32\r\nLogicalDisk:\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 2\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 61999\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1983936\u00c2\u00a0 968Mi\u00c2\u00a0 rdb_blks=[0:63,#64] used=[hi=54,#55] cyl_blks=32\r\nPartition: #0 'DH0'\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 2\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 3201\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 102400\u00c2\u00a0\u00c2\u00a0 50Mi\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 5.16%\u00c2\u00a0 DOS3 bootable pri=10\r\nPartition: #1 'DH1'\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 3202\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 9601\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 204800\u00c2\u00a0 100Mi\u00c2\u00a0\u00c2\u00a0 10.32%\u00c2\u00a0 DOS3\r\nPartition: #2 'DH2'\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 9602\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 61999\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 1676736\u00c2\u00a0 818Mi\u00c2\u00a0\u00c2\u00a0 84.52%\u00c2\u00a0 DOS3\r\nFileSystem #0 DOS1 version=40.1 size=24588<\/pre>\n<p>Voila! Everything set up in a single command \ud83d\ude09<\/p>\n<p>RDB work is done now! (See <a title=\"rdbtool\" href=\"http:\/\/lallafa.de\/blog\/amitools\/rdbtool\/\">rdbtool page<\/a> for lots of more commands available in this tool). Now let&#8217;s head over to <a title=\"xdftool\" href=\"http:\/\/lallafa.de\/blog\/amitools\/xdftool\/\">xdftool<\/a> and format the partitions:<\/p>\n<pre>&gt; xdftool \/dev\/disk1 open part=dh0 + format System\r\n&gt; xdftool \/dev\/disk1 open part=dh1 + format Work\r\n&gt; xdftool \/dev\/disk1 open part=dh2 + format Data<\/pre>\n<p>Now everything is partitioned and formatted for AmigaDOS use. Typically, you want to boot from the first partition, so its advisable to fill it now. In my case I used the pack command of xdftool to restore the Workbench files I recovered with unpack from my old card&#8230;<\/p>\n<p>With this approach, setting up an Amiga disk drive on your Mac is done in seconds with rdbtool and xdftool. No need to boot up an emulator, just plain native tools \ud83d\ude09 I hope you enjoyed this little introduction and find the tools as useful as I do&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here is my little easter present for you: I finished the first release of rdbtool. &#8220;What&#8217;s that?&#8221; you may ask. It&#8217;s a new member of amitools, a family of cross-platform Classic Amiga tools I am developing. rdbtool is a command &hellip; <a href=\"https:\/\/lallafa.de\/blog\/2012\/04\/cf-card-rdbtool\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[11,14,6,9],"tags":[],"class_list":["post-461","post","type-post","status-publish","format-standard","hentry","category-amiga","category-amitools","category-mac-stuff","category-software"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/piBMF-7r","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/posts\/461","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/comments?post=461"}],"version-history":[{"count":11,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/posts\/461\/revisions"}],"predecessor-version":[{"id":472,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/posts\/461\/revisions\/472"}],"wp:attachment":[{"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/media?parent=461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/categories?post=461"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/tags?post=461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}