2

I have 2 physically identical disks. Each with 1 partition:

| Disk     | FS   | Size     | Comment                          |
|----------+------+----------+----------------------------------|
| /dev/sdb | NTFS | 468.8 GB | Partition created long           |
|          |      |          | ago with Partition magic, Win XP |
|----------+------+----------+----------------------------------|
| /dev/sdc | ext4 | 458.5 GB | Partition created last           |
|          |      |          | week with Linux fdisk v. 2.21.2  |
|----------+------+----------+----------------------------------|

Here is fdisk info for each of them:

sdb

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 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: 0x3765c6b7

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *          63   976768064   488384001    7  HPFS/NTFS/exFAT

sdc

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
81 heads, 63 sectors/track, 191411 cylinders, total 976773168 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: 0xe84f8200

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048   976773167   488385560   83  Linux

Despite they are identical, fdisk gives different info:

| Disk | heads | cylinders |
|------+-------+-----------|
| sdb  |   255 |     60801 |
| sdc  |    63 |    191411 |

Questions

  1. Why does this difference exist?
  2. Why does sdb1 end with block #68064, while sdc with #73167?

    Space at the end: 976773167 - 976768064 = 5103 blocks

    Space at the beginning: 63 - 2048 = -1985 blocks

    Total: 5103 - 1985 = 3118 blocks

sdc1 must have 3118 more blocks. While in reality the partition is smaller. Why?

  1. I heard, that it is better to start the partition from block #2048, then 63. So, sdc filesystem must work faster, then sdb. Is it true?
  • 1) 2) It's a difference in partitioning only. 3) applies if the disk has a physical sector size != 512. – frostschutz Oct 7 '15 at 15:33
  • @frostschutz My size is 512 bytes for both drives, so should I start from sertor 63 on the second drive? It's empty, so I can recreate the partition there. – user4035 Oct 7 '15 at 15:36
  • @adonis Yes, they were. – user4035 Oct 7 '15 at 15:37
  • @user4035 2048s = 1MiB alignment is the current standard way of doing things so if you have the choice you should pick 2048 over 63, even if it does not make a difference on your current hardware. – frostschutz Oct 7 '15 at 15:39
3
  1. Cylinder/head/sector addressing is horrendously obsolete, but some old disk tools still use it by default, and Linux fdisk supports it in emulation. The CHS values it's giving do not refer to any physical reality of the disk, but are guesses based on (I'd guess) the current partition table. They can probably be safely ignored.

  2. sdc1 runs right up to the end of the disk, as per fdisk default; sdb1 stops somewhere short, leaving free space at the end, for some probably-inscrutable purpose (maybe Windows uses this?) Meanwhile, sdc1 starts at sector 2048, meaning it's 1MB aligned; this ensures decent performance on modern disks, and also causes there to be plenty of space before the first partition for bootloaders, GPT if desired, and so on. sdb1 is using an older standard for first starting partition, which will still work on modern hardware, but may cause alignment issues and boot loading problems.

    The reason why sdb1 scans as bigger than sdc1, even though the latter is more sectors long? If you got those numbers out of a filesystem checker, I'd guess it's due to the differing FSs, and code not treating them identically. (It's possible, for instance, that the NTFS FS code is reporting something more like the raw partition size, while ext* is subtracting filesystem overhead.) Without more details here, it's hard to say.

  3. Whether the partition start sector matters depends somewhat sensitively on your setup. Old disks were fine so long as everything was 512-byte aligned; newer ones switched to 4k physical sectors, and so they want things aligned to that granularity (and enacted a hefty performance penalty if they weren't). Starting from 1M allows easier use of some various (mostly Linux/Unix) device-mapper techniques, which add disk overhead at the beginning of a device, while still ensuring 4k alignment. It's hard to say whether this will matter in your case, but 1M alignment is probably good form.

  • @adonis Mine is Windows XP, updated the question. – user4035 Oct 7 '15 at 15:45
  • CHS addressing is horrendously obsolete. Windows XP is horrendously obsolete. They go together! :P – Tom Hunt Oct 7 '15 at 15:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.