From: Karel Zak Date: Mon, 2 Aug 2021 08:40:10 +0000 (+0200) Subject: Merge branch 'chs' of https://github.com/pali/util-linux X-Git-Tag: v2.38-rc1~327 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8ad22184b5cdc2c81d61b9f6b283d08e588fcb08;p=thirdparty%2Futil-linux.git Merge branch 'chs' of https://github.com/pali/util-linux * 'chs' of https://github.com/pali/util-linux: fdisk: Add support for fixing MBR partitions CHS values libfdisk: (dos) Add function fdisk_dos_fix_chs() for fixing CHS values for all partitions libfdisk: (dos) Add function dos_partition_sync_chs() for updating CHS values --- 8ad22184b5cdc2c81d61b9f6b283d08e588fcb08 diff --cc libfdisk/src/dos.c index 2e89c01c73,e72b644f2e..1eb3ec53bc --- a/libfdisk/src/dos.c +++ b/libfdisk/src/dos.c @@@ -2657,13 -2732,9 +2727,14 @@@ int fdisk_dos_move_begin(struct fdisk_c dos_partition_set_size(p, sects); dos_partition_set_start(p, new); + dos_partition_sync_chs(p, pe->offset, cxt->geom.sectors, cxt->geom.heads); partition_set_changed(cxt, i, 1); + + if (new == 0) + fdisk_info(cxt, _("The new beginning of the partition overlaps the disk " + "label area. Be very careful when using the partition. " + "You can lose all your partitions on the disk.")); } return rc;