All times are UTC - 5 hours [ DST ]


Switch to mobile style


Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: img - disk size discrepency on flash drives
PostPosted: February 20th, 2014, 0:13 
Offline
User avatar

Joined: December 4th, 2012, 1:35
Posts: 3779
Location: Adelaide, Australia
hi,
Possibly a dumb question that I havent thought about enough.

1. I write a pattern to the whole disk.
2. I tak an image of that disk with Partition Find and Mount.
3. I run HxD as administrator, and open both the image file and the physical Flash Disk that is still plugged in.
4. Tile both windows and scroll them both to the end.

Why is there a size difference?

in every instance there has been a huge size difference. sometimes drive shows bigger sometimes image.

Whats going on?

on case and below some others..
Attachment:
R009 - 77_v_Image.jpg
R009 - 77_v_Image.jpg [ 556.7 KiB | Viewed 7742 times ]

Attachment:
sizes2.jpg
sizes2.jpg [ 510.4 KiB | Viewed 7741 times ]


Attachments:
sizes.jpg
sizes.jpg [ 516.29 KiB | Viewed 7742 times ]
Top
 Profile  
 
 Post subject: Re: img - disk size discrepency on flash drives
PostPosted: February 20th, 2014, 2:06 
Offline
User avatar

Joined: September 8th, 2009, 18:21
Posts: 14945
Location: Australia
AIUI, PF&M would be taking an image of the partition (logical drive) rather than the physical drive.

I would examine sector 0 in each case. Is it an MBR or is it a boot sector? Does the capacity reported in sector 0 match the size of the PF&M image?

_________________
A backup a day keeps DR away.


Top
 Profile  
 
 Post subject: Re: img - disk size discrepency on flash drives
PostPosted: February 20th, 2014, 2:55 
Offline
User avatar

Joined: December 4th, 2012, 1:35
Posts: 3779
Location: Adelaide, Australia
I am writing the pattern with SC Pattern Writer app. I don't believe it writes a partition as after it is written, windows wants to format it.


Top
 Profile  
 
 Post subject: Re: img - disk size discrepency on flash drives
PostPosted: February 20th, 2014, 4:13 
Offline
User avatar

Joined: September 8th, 2009, 18:21
Posts: 14945
Location: Australia
The capacity of the flash drive is being rounded down to the nearest whole cylinder.

63 sectors per track
255 heads per cylinder

15197490 = 946 x 255 x 63
(15 204 351 - 15 197 490) / (255 x 63) = 0.427

16209585 = 1009 x 255 x 63
16214016

31262490 = 1946 x 255 x 63
31277056

15101100 = 940 x 255 x 63
15100256

15502725 = 965 x 255 x 63
15515648

_________________
A backup a day keeps DR away.


Top
 Profile  
 
 Post subject: Re: img - disk size discrepency on flash drives
PostPosted: February 22nd, 2014, 5:38 
Offline

Joined: October 24th, 2009, 15:22
Posts: 843
Location: Poland
@fzabkar: if HaQue write pattern on flash, there is only pattern. No MBR, no FAT etc. Only 77 pattern sector.

Haque: make dump image with DMDE for example, but choose physical device, not partition.

_________________
Odzyskiwanie danych


Top
 Profile  
 
 Post subject: Re: img - disk size discrepency on flash drives
PostPosted: February 22nd, 2014, 5:54 
Offline
User avatar

Joined: December 4th, 2012, 1:35
Posts: 3779
Location: Adelaide, Australia
OK will try it and report.


Top
 Profile  
 
 Post subject: Re: img - disk size discrepency on flash drives
PostPosted: February 24th, 2014, 21:49 
Offline
User avatar

Joined: December 4th, 2012, 1:35
Posts: 3779
Location: Adelaide, Australia
So the DMDE image shows the same last sector as the Physical Disk as I think it should. For some reason the Partition Find and Mount image is different. I don't know it the PFaM people have a different take on what to image, or if it is a bug. I will send of a question to them with my results and ask if that is by design, or if they have any insight. It is possible they don't support what I am doing, as the software is about finding partitions, not working in the absence of one. Or that the do something along the lines of what fzabkar has said. The do have a caveat after all..
Quote:
When Find & Mount tool does not work
Partition Find & Mount software is designed to find lost or deleted partitions in the most convenient way, however, it may not work if the file system on a partition or hard drive itself is severely damaged.



This is the Physical disk opened in HxD Hex Editor, and the next pic is a comparison of the 2 images I took, first PFaM and secon DMDE.

Attachment:
HxD-PhysicalDiskView.jpg
HxD-PhysicalDiskView.jpg [ 88.78 KiB | Viewed 7627 times ]


Attachment:
PFaM-Vs-DMDE.jpg
PFaM-Vs-DMDE.jpg [ 568.73 KiB | Viewed 7627 times ]


some other info:

Attachment:
DMDE-3.jpg
DMDE-3.jpg [ 57 KiB | Viewed 7627 times ]


Attachment:
DMDE-4.jpg
DMDE-4.jpg [ 54.26 KiB | Viewed 7627 times ]


Top
 Profile  
 
 Post subject: Re: img - disk size discrepency on flash drives
PostPosted: February 24th, 2014, 22:47 
Offline
User avatar

Joined: September 8th, 2009, 18:21
Posts: 14945
Location: Australia
Size of physical drive = 3 913 344 LBAs

Using DMDE's two CHS combinations ...

243 x 255 x 63 = 3 903 795
970 x 64 x 63 = 3 911 040

It appears that PF&M is using the first set of CHS values. IIUC these values are coming from the SCSI driver.

_________________
A backup a day keeps DR away.


Top
 Profile  
 
 Post subject: Re: img - disk size discrepency on flash drives
PostPosted: February 25th, 2014, 1:26 
Offline
User avatar

Joined: December 4th, 2012, 1:35
Posts: 3779
Location: Adelaide, Australia
Thanks franc, yes I agree with that, and also agree with the rounding down of the cylinder. Actually, looks like a FLOOR operation, which just strips anything after the decimal point. I was unable to track down any proper specifications that show it, but was able to find a few references to rounding, enough to say that this is probably the cause. It would make sense for reasons such as wanting an integer value, not a float when coding drivers, BIOS and software interfaces.

Many many many supposedly technical manuals have words like "may" might" "could" "depends" etc when talking about LBA / CHS, including this hilarious Gem :)
Code:
What is the real geometry? The easiest answer is that there is no such thing. And if there were, you wouldn't want to know, and certainly NEVER, EVER tell fdisk or LILO or the kernel about it. It is strictly a business between the SCSI controller and the disk. Let me repeat that: only silly people tell fdisk/LILO/kernel about the true SCSI disk geometry.



pages like this http://code.google.com/p/beagleboard/wiki/LinuxBootDiskFormat
Code:
•Now Calculate the number of Cylinders for your SD Card.
#cylinders = FLOOR (the number of Bytes on the SD Card (from above) / 255 / 63 / 512 )So for this example:  2021654528 / 255 / 63 / 512 = 245.79.  So we use 245 (i.e. truncate, don't round).


and
http://eab.abime.net/showthread.php?p=938496

Code:
Next to get how many cylinders this is we should do first calculation from above in reverse

cylinders = bytes / (heads * blocks * 512) = 524288000 / (16 * 63 * 512) = 1015,873

from what I saw in practice it should be rounded down so


which, coincidentaly, was quite an interesting tangent

I think this puts the solved moniker on this


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group