sfdisk: setting default geometry values
The cfdisk and fdisk set defaults for heads and sectors in order to handle a situation when the get_geometry() ends up with zeroes for the disk geometry for device-mapper devices. This patch add same functionally to sfdisk. You know that a dmsetup setgeometry of the the dm device can be used to circumvent the issue but users may not immediately realize they need to do that.
This commit is contained in:
parent
9f70f8b143
commit
653872612c
|
@ -469,8 +469,8 @@ get_cylindersize(char *dev, int fd, int silent) {
|
|||
|
||||
R = get_geometry(dev, fd, silent);
|
||||
|
||||
B.heads = (U.heads ? U.heads : R.heads);
|
||||
B.sectors = (U.sectors ? U.sectors : R.sectors);
|
||||
B.heads = (U.heads ? U.heads : R.heads ? R.heads : 255);
|
||||
B.sectors = (U.sectors ? U.sectors : R.sectors ? R.sectors : 63);
|
||||
B.cylinders = (U.cylinders ? U.cylinders : R.cylinders);
|
||||
|
||||
B.cylindersize = B.heads * B.sectors;
|
||||
|
|
Loading…
Reference in New Issue