[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#474698: partman-base: Inconsistent output if sector size != 512 bytes



Hi,

Looks like parted_devices gets it wrong:

~ # parted_devices 
/dev/md0	4161536	Unknown
~ # fdisk -l /dev/md0
Note: sector size is 1024 (not 512)

Disk /dev/md0: 8 MB, 8323072 bytes
2 heads, 4 sectors/track, 1016 cylinders
Units = cylinders of 8 * 1024 = 8192 bytes

I can imagine that the following patch would fix this issue:

Index: packages/partman/partman-base/parted_devices.c
===================================================================
--- packages/partman/partman-base/parted_devices.c	(revision 52428)
+++ packages/partman/partman-base/parted_devices.c	(working copy)
@@ -52,7 +52,7 @@
 		return;
 	printf("%s\t%lli\t%s\n",
 	       dev->path,
-	       dev->length * PED_SECTOR_SIZE_DEFAULT,
+	       dev->length * dev->sector_size,
 	       dev->model);
 }
 

Unfortunately I don't yet have the Sid system necessary for building
the D-I, so can't test it, but would be grateful if somebody could
send me an updated parted_devices binary (if the above compiles at
all :).  I will try to catch up...
-- 
Regards,
Feri.



Reply to: