handling image on ntfs: "Error 38 when determining sector size! Setting sector size to 512"
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-
dd if=/dev/zero bs=1M count=10 of=/tmp2/
sgdisk -og /tmp/test_ntfs.dd -U EBD0A0A2-
#This gives 29 times: "Error 38 when determining sector size! Setting sector size to 512"
md5sum /tmp/test_ext.dd /tmp2/test_ntfs.dd
f90b33efcce9385
f90b33efcce9385
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-
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"
Changed in gdisk (Ubuntu): | |
status: | New → Triaged |
importance: | Undecided → Low |
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.")