1

Is it possible to specify the sizes of the partions, and their ranges too, based on sectors. I have an image of a an entire disk, made by CloneZilla. Apparently CloneZilla, in this case, is not able to restore the partitios, so I have to do that manually (see this post).

In the image, which is just a folder, there are a few files in a human readable format, describing the partitioning of the disk. The most detailed file is sda-gpt.sgdisk, and is shown below:

Disk /dev/sda: 976773168 sectors, 465.8 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): B493156A-8540-46F9-A3EB-E08346125E6F
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 976773134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2029 sectors (1014.5 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
  1            2048          616447   300.0 MiB   EF00  EFI system partition
  2          616448         2459647   900.0 MiB   2700  Basic data partition
  3         2459648         2721791   128.0 MiB   0C01  Microsoft reserved part
  4         2721792       393431039   186.3 GiB   0700  Basic data partition
  5       393431040       934809599   258.1 GiB   0700  Basic data partition
  6       934809600       976773119   20.0 GiB    2700  Basic data partition

I tried creating this partitioning with GParted, using the sizes, but I guess megabytes/mebibytes/gigabytes/gibibytes can be counted in different ways, and maybe I need more decimals than above. After several tries, I keep make one or more partitions just a tad too small, and CloneZilla fails because they are not big enough. I can't simply make them bigger, since then they won't fit on the disk.

But I guess, if I could specify the partitions using sectors (the numbers shown above) that should work. So how do I do that?

3
  • And hey, if my question does not make sense, tell me how and why! I have asked a few questions about CloneZilla and GParted the last few days, and I don't get any help. And I wonder if my questions are stupid or if nobody knows anything about this, which means I will stay away from this cloning c***. It's more than two full work days spent now :( – Mads Skjern Oct 31 '14 at 10:11
  • As you show an sgdisk output listing, why not use sgdisk to create the partitions? According to the man page you can do --new=partnum:start:end where you can specify those as sectors. So something like sgdisk --new=1:2048:616447 ... – wurtel Oct 31 '14 at 10:26
  • I didn't even know there was a tool called sgdisk, but I will check that out now. Thanks :) – Mads Skjern Oct 31 '14 at 10:36
1

It is a deliberate choice by the gparted team:

https://bugzilla.gnome.org/show_bug.cgi?id=622150

You may use parted by specifying 'unit sector' ; or other partitioning tools such as cfdisk , where you can specify sizes in sectors

See also fdisk, sfdisk, sgdisk....

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.