keirvt
Posts: 3
Joined: Tue Apr 15, 2014 3:04 am

Unusual partition 2014-0107

Tue Apr 15, 2014 3:56 am

I Downloaded 2014-01-07-wheezy-raspbian.img and wish to mount

Running fdisk- l to get the partition start blocks it doesn't look right and produces an error message

Code: Select all

fdisk -l 2014-01-07-wheezy-raspbian.img
You must set cylinders.
You can do this from the extra functions menu.

Disk 2014-01-07-wheezy-raspbian.img: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000981cb

Device Boot Start End Blocks Id System
2014-01-07-wheezy-raspbian.img1 1 8 57344 c W95 FAT32 (LBA)
Partition 1 does not end on cylinder boundary.
2014-01-07-wheezy-raspbian.img2 8 361 2831360 83 Linux
Partition 2 does not end on cylinder boundary.


The image won't mount either

Code: Select all

mount -o loop,offset=$(( 512 * 8))    2014-01-07-wheezy-raspbian.img    ./mnt
mount: you must specify the filesystem type

User avatar
rpdom
Posts: 17275
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Unusual partition 2014-0107

Tue Apr 15, 2014 5:59 am

Your download must have failed. I get

Code: Select all

Disk 2014-01-07-wheezy-raspbian.img: 2962 MB, 2962227200 bytes
255 heads, 63 sectors/track, 360 cylinders, total 5785600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000981cb

                         Device Boot      Start         End      Blocks   Id  System
2014-01-07-wheezy-raspbian.img1            8192      122879       57344    c  W95 FAT32 (LBA)
2014-01-07-wheezy-raspbian.img2          122880     5785599     2831360   83  Linux
What is the size of your (unzipped) file, and what is its MD5 checksum?

Code: Select all

rpdom@home:ls -l 2014-01-07-wheezy-raspbian.img 
-rw-r--r-- 1 rpdom rpdom 2962227200 Jan  7 23:42 /tmp/2014-01-07-wheezy-raspbian.img
rpdom@home:$ md5sum 2014-01-07-wheezy-raspbian.img 
6d8e5a48ff7c6bdc0bc0983bc32f75b8  2014-01-07-wheezy-raspbian.img

User avatar
jojopi
Posts: 3274
Joined: Tue Oct 11, 2011 8:38 pm

Re: Unusual partition 2014-0107

Tue Apr 15, 2014 7:01 am

keirvt wrote:Units = cylinders of 16065 * 512 = 8225280 bytes
Your version of fdisk has defaulted to cylinders instead of sectors. Try "fdisk -lu".

It is normal for partitions neither to begin nor end on a cylinder boundary these days, so a cylinder-based listing does not allow you to calculate accurate mount offsets. The modern practice is to use multiples of 1MiB or more, because traditional tracks of 63 sectors do not align properly on drives where the hardware block size is bigger than 512 bytes.

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: Unusual partition 2014-0107

Tue Apr 15, 2014 7:07 am

Or you can just use "file" instead of "fdisk"…
(If the goal is to get the startsector info, in order to "mount" the image file)
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

Return to “Raspberry Pi OS”