0

I created two partitions using the following commands.

parted /dev/sda --script -- mkpart primary 1 50001
parted /dev/sda --script -- mkpart primary 1948001 1998001

Each partition should have 50001 MB. However, when I use "partclone" trying to copy from the first partition to the second, it complains that these two partitions are not the same size. The second one is 50000 MB.

When I do "fdisk -l", below is the output.

Disk /dev/sda: 1999.3 GB, 1999307276288 bytes
255 heads, 63 sectors/track, 243068 cylinders, total 3904897024 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: 0x000d3669

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048    97658879    48828416   83  Linux
...
/dev/sda4      3804690432  3902345215    48827392   83  Linux

It shows the difference of the number of blocks.

So if I want to create two partitions with exactly the same size, what should I do?

Nidal
  • 187
  • 4
  • 11
user180574
  • 225
  • 1
  • 3
  • 12

1 Answers1

0

I haven't used parted, but with fdisk, if I want to be exact i have to change the units to cylinders or sectors (assuming same disk geometry). How about trying that and seeing if you get closer?

You should be able to put a suffix on your number to indicate unit type. According to the man page it is "s" for sectors and "cyl" for cylinders.

ben
  • 101
  • 5