handling image on ntfs: "Error 38 when determining sector size! Setting sector size to 512"

Bug #1431178 reported by Aapo Rantalainen
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gdisk (Ubuntu)
Triaged
Low
Unassigned

Bug Description

Creating two similar images, with empty GPT. First image in ext-filesystem, second in NTFS.

/tmp = ext4
/tmp2 = ntfs

dd if=/dev/zero bs=1M count=10 of=/tmp/test_ext.dd
sgdisk -og /tmp/test_ext.dd -U EBD0A0A2-B9E5-4433-87C0-68B6B72699C7

dd if=/dev/zero bs=1M count=10 of=/tmp2/test_ntfs.dd
sgdisk -og /tmp/test_ntfs.dd -U EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
#This gives 29 times: "Error 38 when determining sector size! Setting sector size to 512"

md5sum /tmp/test_ext.dd /tmp2/test_ntfs.dd
f90b33efcce9385f6bc2d13d9cb62365 /tmp/test_ext.dd
f90b33efcce9385f6bc2d13d9cb62365 /tmp2/test_ntfs.dd

gdisk -l /tmp2/test_ntfs.dd

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /tmp2/test_ntfs.dd: 20480 sectors, 10.0 MiB
Logical sector size: 512 bytes
Disk identifier (GUID): EBD0A0A2-B9E5-4433-87C0-68B6B72699C7
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 20446
Partitions will be aligned on 2048-sector boundaries
Total free space is 20413 sectors (10.0 MiB)

Shows 19 times: "Error 38 when determining sector size! Setting sector size to 512"

Revision history for this message
Rod Smith (rodsmith) wrote :

GPT fdisk relies on OS calls to determine the sector size, which is vitally important for interpreting GPT data structures. It appears that the NTFS-3g driver that Ubuntu uses is not returning that data, which means that sgdisk can only make a guess that the sector size is 512. (In fact, when dealing with disk image files, it would probably be better to provide a manual override for the sector size. I'll add that to the GPT fdisk "wish list.")

Changed in gdisk (Ubuntu):
status: New → Triaged
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.