Ensure 1 MiB reserved when moving partition to start of disk
The 1 MiB is required for the partition table stored at the beginning of the disk device.
This commit is contained in:
parent
5abd69cfc0
commit
ceab9bde57
|
@ -132,7 +132,12 @@ void Dialog_Partition_Resize_Move::Resize_Move_Normal( const std::vector<Partiti
|
|||
if ( previous <= 0 )
|
||||
MIN_SPACE_BEFORE_MB = 0 ;
|
||||
else
|
||||
MIN_SPACE_BEFORE_MB = Dialog_Base_Partition::MB_Needed_for_Boot_Record( selected_partition ) ;
|
||||
{
|
||||
if ( START <= (MEBIBYTE / selected_partition .sector_size) )
|
||||
MIN_SPACE_BEFORE_MB = 1 ;
|
||||
else
|
||||
MIN_SPACE_BEFORE_MB = Dialog_Base_Partition::MB_Needed_for_Boot_Record( selected_partition ) ;
|
||||
}
|
||||
total_length = previous + selected_partition .get_sector_length() + next;
|
||||
TOTAL_MB = Utils::round( Utils::sector_to_unit( total_length, selected_partition .sector_size, UNIT_MIB ) ) ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue