Disk Partitioning problem with fdisk.
Posted
by MA1
on Super User
See other posts from Super User
or by MA1
Published on 2010-04-01T10:59:55Z
Indexed on
2010/04/01
11:03 UTC
Read the original article
Hit count: 326
Currently i am using fdisk to create/resize windows partitions. Following is a sample input script to fdisk to create/resize windows partitions:
fdisk /dev/sda < partInput
the contents of partInput are as follows:
d #delete the partition
3 #partition number to be deleted
n #add a new partition
p #primary: type of new partition
3 #new partition number
18804 #start cylinder of new partition
77433 #end cylinder of new partition
t #change the type of partition
3 #partition number whose type(filesystem) is to be changed
7 #HPFS/NTFS: partition type(filesystem)
n #add a new partition
p #primary: type of partition
77434 #first cylinder of new partition
77825 #end cylinder new partition
w #write all the above changes
As you see in the above input we are using cylinders for start and end.
Earlier i am using sectors as unit and everything is working fine but getting problems when partitioning a 1.5TB hard drive. Then i changed the unit to cylinders but it is working on some machines not all. On some machines fdisk failed to create the partition table correctly. So, i am thinking to move to parted if there is no way to do the above using fdisk.
Please also tell me how to correctly convert sectors to cylinders?
How to perform all the above steps using parted without losing the data OR how to use fdisk correctly?
© Super User or respective owner