5

I tried to backup my partition using dd on another disk and I created a partition of the same size.

When I finished the copy I had problems mounting the partition since I got bad geometry: block count .

I noticed that in order to create a correct backup (avoid bad geometry error) not only the two partitions must have the same size in MB but also the same number of blocks (The number in blocks you can check using fdisk -l). I also noticed that the number of blocks varies if I create the partition starting from the beginning or starting from the end . Can someone explain me the behaviour and how to create two partition with the exact the same block size?

Joseph R.
  • 38,849
  • 7
  • 107
  • 143
Panciz
  • 180
  • 5
  • 2
    The partition size is usually the only thing that matters. What filesystem is on the partition, where exactly did the error message appear, and was that really the complete message? – frostschutz Dec 24 '13 at 11:19
  • 1
    Please add the **exact** command you have used - my hunch is it hasn't been entirely correct. – peterph Dec 24 '13 at 13:16
  • 1
    It doesn't have to be the exact same size - it just has to be at least as big – Jonas Berlin Feb 22 '14 at 16:40
  • [Please **don't** use `dd` for backups.](http://unix.stackexchange.com/questions/140991/is-it-safe-to-take-the-drive-image-of-the-current-working-drive/140992#140992) – goldilocks Jul 12 '14 at 14:23

1 Answers1

0

The partition size must be at least as big, not precisely as big, as before.

The problem you were encountering here is that the fdisk utility you used rounded the partition size to the next multiple of its units – these used to be cylinders (heads * sectors); in modern times, we ignore the old rotation units from MFM HDD age and just assign whole Mebibytes to partitions, but older utilities do not yet recognise that and try to be “helpful” and round to whole cylinders…

Which utility did you use to create the target partition? Linux command-line fdisk needs both the c and u commands to change between those behaviours; I think yours was just old.

mirabilos
  • 1,723
  • 15
  • 33