Changeset 3647 in MondoRescue
- Timestamp:
- Jan 13, 2017, 5:35:12 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi/mr-parted2fdisk
r3631 r3647 170 170 } 171 171 172 # Create a device var which will be the devi de or partition on which to work172 # Create a device var which will be the device or partition on which to work 173 173 # whatever the option used. 174 174 $device = $ARGV[0] if (defined $opts{'l'}); … … 243 243 $min =~ s/[a-z]+// if (defined $min); 244 244 245 # fdisk has a bug when handling more than 1024 disks, seen on RHEL 246 # so in that case we want to use parted instead 247 # # Cf: http://trac.mondorescue.org/ticket/805 248 my $use_parted = 0; 249 open(CMD,"LANGUAGE=C $fdisk -l |") || die "Unable to execute $fdisk"; 250 my $lines = 0; 251 while (<CMD>) { 252 $lines++ if ($_ =~ /^Disk \//); 253 } 254 close(CMD); 255 # More than 1000 is a lot of disks so may triggers the issue 256 $use_parted = 1 if ($lines >= 1000); 257 245 258 # Check partition table type 246 259 $type = mr_disk_type($device); 247 260 # Replacement code only for GPT disks 248 if ((( $v == 1) || (($v == 2) && ($maj < 22))) && ($type ne "MBR")) {261 if (((($v == 1) || (($v == 2) && ($maj < 22))) && ($type ne "MBR")) || ($use_parted == 1)) { 249 262 pb_log(1,"This distribution uses an old fdisk, activating replacement code for GPT disk label...\n"); 250 263 my $parted = pb_check_req("parted",0);
Note:
See TracChangeset
for help on using the changeset viewer.