Changeset 2290 in MondoRescue for branches/2.2.9/mondo/src/common/libmondo-cli.c
- Timestamp:
- Jul 22, 2009, 2:03:44 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.9/mondo/src/common/libmondo-cli.c
r2241 r2290 362 362 363 363 log_msg(5, "dsf: %s", dsf); 364 364 365 365 /******** 366 366 * See if a device special file was passed in (i.e. it must start with /dev/ … … 386 386 } 387 387 log_msg(5, " %s device special file exists", dsf); 388 388 389 389 /* Get a list of the mounted file systems */ 390 390 if (create_list_of_non_NFS_mounted_file_systems()) { … … 398 398 * Either way, it's an error. 399 399 ********/ 400 mr_asprintf(&command, 401 "parted2fdisk -l %s 2>/dev/null|grep -E \"^/dev/\"|awk '{printf(\"%%s \", $1)}END{print \"\"}'", dsf); 400 mr_asprintf(&command, "parted2fdisk -l %s 2>/dev/null|grep -E \"^/dev/\"|awk '{printf(\"%%s \", $1)}END{print \"\"}'", dsf); 402 401 log_msg(4, "Executing: %s", command); 403 402 mr_asprintf(&partition_list, "%s", call_program_and_get_last_line_of_output(command)); … … 452 451 log_msg(4, "Processing partition: %s", partitions[i]); 453 452 /* See if it's swap. If it is, ignore it. */ 454 mr_asprintf(&command, 455 "parted2fdisk -l %s 2>/dev/null | awk '{if(($1==\"%s\")&&(toupper($0) ~ \"SWAP\")){print $1;exit}}'", 453 mr_asprintf(&command, "parted2fdisk -l %s 2>/dev/null | awk '{if(($1==\"%s\")&&(toupper($0) ~ \"SWAP\")){print $1;exit}}'", 456 454 dsf, partitions[i]); 457 455 log_msg(4, " Running: %s", command); … … 490 488 if (strlen(tmp)) { 491 489 log_msg(4, " Partition ID: %s", tmp); 492 if (!strcasecmp(tmp, "8e")) { 490 if (!strcasecmp(tmp, "8e")) { 493 491 /* It's LVM: Find the VG it's in */ 494 492 log_msg(4, " It's LVM: Find the VG it's in..."); … … 501 499 /* Found the Volume Group. Now find all of the VG's mount points */ 502 500 log_msg(4, " Found the Volume Group. Now find all of the VG's mount points"); 503 mr_asprintf(&command, 504 "mount 2>/dev/null|grep -E \"/dev/mapper/%s-|/dev/%s/\"|awk '{printf(\"%%s \",$3)}END{print \"\"}'", 505 VG, VG); 501 mr_asprintf(&command, "mount 2>/dev/null|grep -E \"/dev/mapper/%s-|/dev/%s/\"|awk '{printf(\"%%s \",$3)}END{print \"\"}'", VG, VG); 506 502 log_msg(4, " Running: %s", command); 507 503 mr_asprintf(&mount_list, "%s", call_program_and_get_last_line_of_output(command)); … … 525 521 *******/ 526 522 paranoid_free(mount_list); 527 mr_asprintf(&command, "%s", 528 "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'"); 523 mr_asprintf(&command, "%s", "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'"); 529 524 log_msg (5, "Running: %s", command); 530 525 mr_asprintf(&mount_list, "%s", call_program_and_get_last_line_of_output(command)); 531 526 paranoid_free(command); 532 log_msg(4, " Software raid device list: %s", mount_list); 527 log_msg(4, " Software raid device list: %s", mount_list); 533 528 lastpos = 0; 534 529 while ((token = mr_strtok(mount_list, token_chars, &lastpos)) != NULL) { 535 mr_asprintf(&command, "mdadm --detail %s 2>/dev/null | grep -c %s", token, VG); 530 mr_asprintf(&command, "mdadm --detail %s 2>/dev/null | grep -c %s", token, VG); 536 531 log_msg (5, "Running: %s", command); 537 532 paranoid_free(tmp); … … 579 574 log_msg (5, " UUID: %s", tmp); 580 575 /* Get the Software raid device list */ 581 mr_asprintf(&command, "%s", 582 "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'"); 576 mr_asprintf(&command, "%s", "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'"); 583 577 log_msg (5, " Running: %s", command); 584 578 mr_asprintf(&mount_list, "%s", call_program_and_get_last_line_of_output(command)); 585 579 paranoid_free(command); 586 log_msg(4, " Software raid device list: %s", mount_list); 580 log_msg(4, " Software raid device list: %s", mount_list); 587 581 /* Loop through the software raid device list to see if we can find the partition */ 588 582 lastpos = 0; … … 767 761 strcat(bkpinfo->include_paths, " "); 768 762 } 769 763 770 764 mr_asprintf(&tmp1, "%s", flag_val['I']); 771 765 p = tmp1; … … 1514 1508 if (flag_set[opt]) { 1515 1509 bad_switches = TRUE; 1516 mr_asprintf(&tmp, "Switch -%c previously defined as %s\n", opt, 1517 flag_val[opt]); 1510 mr_asprintf(&tmp, "Switch -%c previously defined as %s\n", opt, flag_val[opt]); 1518 1511 log_to_screen(tmp); 1519 1512 paranoid_free(tmp); … … 1531 1524 if (strchr(flag_val[opt], '/') 1532 1525 && flag_val[opt][0] != '/') { 1533 mr_asprintf(&tmp, 1534 "-%c flag --- must be absolute path --- '%s' isn't absolute", 1535 opt, flag_val[opt]); 1526 mr_asprintf(&tmp, "-%c flag --- must be absolute path --- '%s' isn't absolute", opt, flag_val[opt]); 1536 1527 log_to_screen(tmp); 1537 1528 paranoid_free(tmp); … … 1604 1595 case SIGABRT: 1605 1596 mr_asprintf(&tmp, "SIGABRT"); 1606 mr_asprintf(&tmp2, 1607 "Abort - probably failed assertion. I'm sleeping for a few seconds so you can read the message."); 1597 mr_asprintf(&tmp2, "Abort - probably failed assertion. I'm sleeping for a few seconds so you can read the message."); 1608 1598 break; 1609 1599 default:
Note:
See TracChangeset
for help on using the changeset viewer.