Your message dated Tue, 08 Jan 2013 12:13:54 -0500
with message-id <[email protected]>
and subject line 
has caused the Debian Bug report #491511,
regarding off-by-one: parted should consider cylinders one-indexed rather than 
zero-indexed
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
491511: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=491511
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: parted
Version: 1.8.8.git.2008.03.24-7
Severity: normal

While trying to manually copy a few entries of the partition table on one drive
to another drive, I run into the following problem, which is likely related to
some discrepancy in how parted sets and/or displays cylinders.

fdisk says:
###############################################################################
#fdisk -l /dev/hda

Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1        1216     9767488+  83  Linux
/dev/hda2           14532       14593      498015    5  Extended
/dev/hda3            1217        2432     9767520   83  Linux
/dev/hda4            2433       14531    97185217+  83  Linux
/dev/hda5           14532       14544      104391   83  Linux
/dev/hda6           14545       14593      393561   82  Linux swap / Solaris

Partition table entries are not in disk order
###############################################################################


Note that when displaying, all of the cylinder numbers are shifted toward 0 by
1 cylinder.

###############################################################################
01:28:44> [root{perl}@~]
#parted /dev/hda unit cyl print
Model: WDC WD1200JB-00EVA0 (ide)
Disk /dev/ide/host0/bus0/target0/lun0/disc: 14593cyl
Sector size (logical/physical): 512B/512B
BIOS cylinder,head,sector geometry: 14593,255,63.  Each cylinder is 8225kB.
Partition Table: msdos

Number  Start     End       Size      Type      File system  Flags
 1      0cyl      1215cyl   1215cyl   primary   xfs          boot 
 3      1216cyl   2431cyl   1216cyl   primary   xfs               
 4      2432cyl   14530cyl  12099cyl  primary   xfs               
 2      14531cyl  14592cyl  62cyl     extended                    
 5      14531cyl  14543cyl  12cyl     logical   ext2              
 6      14544cyl  14592cyl  48cyl     logical   linux-swap        


01:28:54> [root{perl}@~]
#parted /dev/sdc unit cyl print
Model: ATA MAXTOR STM332062 (scsi)
Disk /dev/scsi/host3/bus0/target0/lun0/disc: 38913cyl
Sector size (logical/physical): 512B/512B
BIOS cylinder,head,sector geometry: 38913,255,63.  Each cylinder is 8225kB.
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags


01:29:06> [root{perl}@~]
#parted /dev/sdc unit cyl mkpart
Partition type?  primary/extended? p                                      
File system type?  [ext2]? xfs                                            
Start? 0                                                                  
End? 1215                                                                 
Information: You may need to update /etc/fstab.                           


01:29:26> [root{perl}@~]
#parted /dev/sdc unit cyl print
Model: ATA MAXTOR STM332062 (scsi)
Disk /dev/scsi/host3/bus0/target0/lun0/disc: 38913cyl
Sector size (logical/physical): 512B/512B
BIOS cylinder,head,sector geometry: 38913,255,63.  Each cylinder is 8225kB.
Partition Table: msdos

Number  Start  End      Size     Type     File system  Flags
 1      0cyl   1214cyl  1214cyl  primary                    
###############################################################################

However, looking at the partition table with fdisk again shows what really
happened: gparted assumes that cylinder numbers entered by the user are not
shifted by a cylinder, and thus sets the boundary in a way that (I imagine) is
compatible with fdisk.  The start cylinder is likely clamped to a reasonable
value (namely, "1") somewhere during the write process.

###############################################################################
#fdisk -l /dev/sdc

Disk /dev/sdc: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000385a6

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1        1215     9759456   83  Linux
###############################################################################



The most likely solution to this discrepancy is for gparted to stop pretending
that cylinders are zero-indexed


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.25 (PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages parted depends on:
ii  libc6             2.7-11                 GNU C Library: Shared libraries
ii  libncurses5       5.6+20071124-1         Shared libraries for terminal hand
ii  libparted1.8-9    1.8.8.git.2008.03.24-7 The GNU Parted disk partitioning s
ii  libreadline5      5.2-3                  GNU readline and history libraries

parted recommends no packages.

Versions of packages parted suggests:
pn  parted-doc                    <none>     (no description available)

-- no debconf information



--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Cylinders are actually zero indexed, not one, so this is not a bug.

Technically fdisk is in the wrong here, since logical sector 63 lies
on cylinder 0, track 1.  Seeing as how it has been like that forever,
and chs addressing is obsolete anyhow, I don't think it will be fixed.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQEcBAEBAgAGBQJQ7FPSAAoJEJrBOlT6nu75zakH/RBTGFRtqjtHMandWbDu7h+p
BeD2/DiultOlZZ0IAPHhzzNDw0ON8Ev8Q89suQnJ07jwjbO9vPYTh4DK6WtPN3+z
lmAUv0YVG6DJ8vVoIEhKSFEwL3WpZgdLL7/r+zdOIHDJQQjtD+4nlPRR2hhb/wHB
Dui0Kr6pLpqBr9XXJ2DPu6Ptl7UvkaaefL03uJ37dJSno7UmqGLHJMUHyZ6ibqXx
gk1AIuTsJg+o/VChpCXenDPP6e6SF2KJ/NlmcTG9tcHi1HyvgedDUR9gbCrcA4SA
uoRHH3vLs1n3aiupQxLXpZ0jDOfgnk3Ad4+CdY6YR4J+zOzYNmshOma8k+3O7Zo=
=kB3/
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to