Welcome, Guest. Please login or register.

Author Topic: Help needed with DiskImage  (Read 3159 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Help needed with DiskImage
« on: August 28, 2006, 10:40:35 AM »
Hi all

I've given up with XFS as it doesn't let me assign to drawers within the disk image. No matter what I do, the assign points to the root of the image.

I decided to give DiskImage a try. I created the image with this command:

CreateImage drive=hd0: DIUNIT 0 Mark:OS39

I then mounted it with this command:

mount DIHD0: from OS39.mountlist

I got an error that Keyword 'CONTROL' requires a string, so I commented out the line and it seemed to mount ok. I then inserted the image in to the device with this command:

DiskImageCtrl unit 0 insert Mark:OS39

The device was then reported as not being a valid DOS disk, so I tried to format it and got format failure "bad number".

For some reason the volume is reported as being 281MB, whereas the partition is just over 1GB and the data on it is about 30MB. I don't know where this size of 281MB has come from, and whether that is anything to do with it not working.

Any help would be much appreciated!

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Thomas

Re: Help needed with DiskImage
« Reply #1 on: August 28, 2006, 10:52:24 AM »

Why didn't you use the HDF you already created for XFS ?

What does the DIHD0 mountlist look like ?

How big is the image file ?

The geometry you specified in DIHD0 should match the image size.

(HighCyl + 1) * BlocksPerTrack * Surfaces * BlockSize = image size

Bye,
Thomas

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Help needed with DiskImage
« Reply #2 on: August 28, 2006, 10:55:50 AM »
I did try the HDF I created for XFS, but the same problem occurred (non-dos disk). I'm just powering my Amiga back on so I can get the mountlist. Do you have any idea why assigning doesn't work properly with XFS?

--
moto

-EDIT
Here's the mountlist:

DIHD0:
   Device              = diskimage.device
   Unit                = 0
   Flags               = 0
   FileSystem          = L:FastFileSystem
   Surfaces            = 4
   BlockSize           = 128
   SectorsPerBlock     = 1
   BlocksPerTrack      = 246
   Reserved            = 2
   Interleave          = 0
   LowCyl              = 2
   HighCyl             = 2341
   Buffers             = 80
   BufMemType          = 1
   MaxTransfer         = 0x00ffffff
   Mask                = 0x7ffffffe
   DosType             = 0x53465300
   GlobVec             = -1
   StackSize           = 4096
#   Control             = 0
   Mount               = 1
#
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Help needed with DiskImage
« Reply #3 on: August 28, 2006, 10:59:56 AM »
The equation you gave me comes out at about 280MB. So do you think the mountlist was created incorrectly by CreateImage?

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Thomas

Re: Help needed with DiskImage
« Reply #4 on: August 28, 2006, 11:29:40 AM »
Yes, the mountlist is not correct. The value for BlockSize is wrong. It should be 512. In memory the block size is stored as number of longwords, but the mountlist has to specify the number of bytes (four times the number of longwords; 128 longwords are 512 bytes).

Also if the image is only one partition, you should change
LowCyl to 0 and HighCyl to 2339.

Finally you should not use FFS with the DosType for SFS.

Bye,
Thomas

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Help needed with DiskImage
« Reply #5 on: August 28, 2006, 11:33:04 AM »
Thomas you're amazing - it works :-) Any thoughts in why the mountlist was incorrect? Bug in CreateImage? Someting weird about my partition layout on HDD?

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Thomas

Re: Help needed with DiskImage
« Reply #6 on: August 28, 2006, 11:41:50 AM »

Yes, the BlockSize mistake is obviously a bug in CreateImage, so the other problems probably are bugs, too.

Bye,
Thomas

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Help needed with DiskImage
« Reply #7 on: August 28, 2006, 11:44:28 AM »
Do you have much experience with DiskImage? I am wondering if it is possible to specify the size of the image when you create it? I have a 16GB partition with not much on it, and would prefer for the image to be the size of the data, not the size of the partition.

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Thomas

Re: Help needed with DiskImage
« Reply #8 on: August 28, 2006, 11:50:57 AM »
Quote
I have a 16GB partition with not much on it, and would prefer for the image to be the size of the data, not the size of the partition.


That's not possible. But you can create an empty HDF, format it and copy the data to it.

I am not very experienced with the tools which come with DiskImage. I only use diskimage.device and (because I cannot avoid it) DiskImageCtrl. I even don't remember which program I used to create my HDFs, probably WinUAE.

Bye,
Thomas


Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Help needed with DiskImage
« Reply #9 on: August 28, 2006, 11:54:47 AM »
Ok, that's fine. I can create a disk image with WinUAE and format it. But how do I then create the mountlist in order to mount the device in to which I insert the image? Sorry for all the questions about this but I'm not very experienced when it comes to drive geometry and such.

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Thomas

Re: Help needed with DiskImage
« Reply #10 on: August 28, 2006, 12:47:46 PM »
Try

Surfaces = 1
BlockSize = 512
BlocksPerTrack = 1
LowCyl = 0
HighCyl =

or

Surfaces = 1
BlockSize = 512
BlocksPerTrack = 32
LowCyl = 0
HighCyl =

The calculation is always the same as above:

(HighCyl + 1) * Surfaces * BlocksPerTrack * BlockSize = image size

Bye,
Thomas

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Help needed with DiskImage
« Reply #11 on: August 28, 2006, 03:51:07 PM »
That makes sense after seeing your equation - seems to be cheating the filesystem by setting all but two values 1 so they do not increase the image size, and then making sure the other two values give the correct image size when multiplied together. Thanks again.

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Thomas

Re: Help needed with DiskImage
« Reply #12 on: August 28, 2006, 04:01:42 PM »

If you look at the "add hardfile" panel in WinUAE, you'll see that it uses the values from my second suggestion. So if you format the HDF with WinUAE, a mountlist following this suggestion should work.

Bye,
Thomas

Offline motorollinTopic starter

  • Hero Member
  • *****
  • Join Date: Nov 2005
  • Posts: 8669
    • Show only replies by motorollin
Re: Help needed with DiskImage
« Reply #13 on: August 28, 2006, 04:04:14 PM »
I'll try creating one in WinUAE and then mount it. I'm hoping I don't need to format it in WinUAE first as this means keeping an installation of OS3.9 on the laptop. If I can just create it with the WinUAE executable and then format it once mounted on the Amiga I will be very happy :-)

--
moto
Code: [Select]
10  IT\'S THE FINAL COUNTDOWN
20  FOR C = 1 TO 2
30     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NAAAA
40     DA-NA-NAAAA-NAAAA DA-NA-NA-NA-NA-NA-NAAAAA
50  NEXT C
60  NA-NA-NAAAA
70  NA-NA NA-NA-NA-NA-NAAAA NAAA-NAAAAAAAAAAA
80  GOTO 10
 

Offline Thomas

Re: Help needed with DiskImage
« Reply #14 on: August 28, 2006, 04:52:25 PM »

If you only want to create an empty file for use as an image with DiskImage, you can as well use a simple Rexx program like this:

Code: [Select]

/* rexx */


size = 10 * 1024 * 1024   /* size in bytes (10 mb) */
file = "ram:hdf"          /* file name (will be overwritten if it exists */


buffsize = 32768
buffer = left("",buffsize,'00'x)

if Open(out,file,write) then do

do while (size >= buffsize)
call WriteCh(out,buffer)
size = size - buffsize
end
if size > 0 then
call WriteCh(out,left(buffer,size))

call Close(out)
end


Bye,
Thomas