Changeset 2291 in MondoRescue for branches/2.2.10/mondo/src/common/libmondo-cli.c
- Timestamp:
- Jul 22, 2009, 2:11:26 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2.10/mondo/src/common/libmondo-cli.c
r2273 r2291 364 364 365 365 log_msg(5, "dsf: %s", dsf); 366 366 367 367 /******** 368 368 * See if a device special file was passed in (i.e. it must start with /dev/ … … 388 388 } 389 389 log_msg(5, " %s device special file exists", dsf); 390 390 391 391 /* Get a list of the mounted file systems */ 392 392 if (create_list_of_non_NFS_mounted_file_systems()) { … … 400 400 * Either way, it's an error. 401 401 ********/ 402 mr_asprintf(&command, 403 "parted2fdisk -l %s 2>/dev/null|grep -E \"^/dev/\"|awk '{printf(\"%%s \", $1)}END{print \"\"}'", dsf); 402 mr_asprintf(&command, "parted2fdisk -l %s 2>/dev/null|grep -E \"^/dev/\"|awk '{printf(\"%%s \", $1)}END{print \"\"}'", dsf); 404 403 log_msg(4, "Executing: %s", command); 405 404 mr_asprintf(&partition_list, "%s", call_program_and_get_last_line_of_output(command)); … … 454 453 log_msg(4, "Processing partition: %s", partitions[i]); 455 454 /* See if it's swap. If it is, ignore it. */ 456 mr_asprintf(&command, 457 "parted2fdisk -l %s 2>/dev/null | awk '{if(($1==\"%s\")&&(toupper($0) ~ \"SWAP\")){print $1;exit}}'", 455 mr_asprintf(&command, "parted2fdisk -l %s 2>/dev/null | awk '{if(($1==\"%s\")&&(toupper($0) ~ \"SWAP\")){print $1;exit}}'", 458 456 dsf, partitions[i]); 459 457 log_msg(4, " Running: %s", command); … … 492 490 if (strlen(tmp)) { 493 491 log_msg(4, " Partition ID: %s", tmp); 494 if (!strcasecmp(tmp, "8e")) { 492 if (!strcasecmp(tmp, "8e")) { 495 493 /* It's LVM: Find the VG it's in */ 496 494 log_msg(4, " It's LVM: Find the VG it's in..."); … … 503 501 /* Found the Volume Group. Now find all of the VG's mount points */ 504 502 log_msg(4, " Found the Volume Group. Now find all of the VG's mount points"); 505 mr_asprintf(&command, 506 "mount 2>/dev/null|grep -E \"/dev/mapper/%s-|/dev/%s/\"|awk '{printf(\"%%s \",$3)}END{print \"\"}'", 507 VG, VG); 503 mr_asprintf(&command, "mount 2>/dev/null|grep -E \"/dev/mapper/%s-|/dev/%s/\"|awk '{printf(\"%%s \",$3)}END{print \"\"}'", VG, VG); 508 504 log_msg(4, " Running: %s", command); 509 505 mr_asprintf(&mount_list, "%s", call_program_and_get_last_line_of_output(command)); … … 527 523 *******/ 528 524 paranoid_free(mount_list); 529 mr_asprintf(&command, "%s", 530 "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'"); 525 mr_asprintf(&command, "%s", "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'"); 531 526 log_msg (5, "Running: %s", command); 532 527 mr_asprintf(&mount_list, "%s", call_program_and_get_last_line_of_output(command)); 533 528 paranoid_free(command); 534 log_msg(4, " Software raid device list: %s", mount_list); 529 log_msg(4, " Software raid device list: %s", mount_list); 535 530 lastpos = 0; 536 531 while ((token = mr_strtok(mount_list, token_chars, &lastpos)) != NULL) { 537 mr_asprintf(&command, "mdadm --detail %s 2>/dev/null | grep -c %s", token, VG); 532 mr_asprintf(&command, "mdadm --detail %s 2>/dev/null | grep -c %s", token, VG); 538 533 log_msg (5, "Running: %s", command); 539 534 paranoid_free(tmp); … … 581 576 log_msg (5, " UUID: %s", tmp); 582 577 /* Get the Software raid device list */ 583 mr_asprintf(&command, "%s", 584 "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'"); 578 mr_asprintf(&command, "%s", "cat /proc/mdstat|grep -iv Personal|awk '{if($0~\"^.*[ ]+:\"){printf(\"/dev/%s \", $1)}}END{print \"\"}'"); 585 579 log_msg (5, " Running: %s", command); 586 580 mr_asprintf(&mount_list, "%s", call_program_and_get_last_line_of_output(command)); 587 581 paranoid_free(command); 588 log_msg(4, " Software raid device list: %s", mount_list); 582 log_msg(4, " Software raid device list: %s", mount_list); 589 583 /* Loop through the software raid device list to see if we can find the partition */ 590 584 lastpos = 0; … … 770 764 strcat(bkpinfo->include_paths, " "); 771 765 } 772 766 773 767 mr_asprintf(&tmp1, "%s", flag_val['I']); 774 768 p = tmp1; … … 1534 1528 if (flag_set[opt]) { 1535 1529 bad_switches = TRUE; 1536 mr_asprintf(&tmp, "Switch -%c previously defined as %s\n", opt, 1537 flag_val[opt]); 1530 mr_asprintf(&tmp, "Switch -%c previously defined as %s\n", opt, flag_val[opt]); 1538 1531 log_to_screen(tmp); 1539 1532 paranoid_free(tmp); … … 1551 1544 if (strchr(flag_val[opt], '/') 1552 1545 && flag_val[opt][0] != '/') { 1553 mr_asprintf(&tmp, 1554 "-%c flag --- must be absolute path --- '%s' isn't absolute", 1555 opt, flag_val[opt]); 1546 mr_asprintf(&tmp, "-%c flag --- must be absolute path --- '%s' isn't absolute", opt, flag_val[opt]); 1556 1547 log_to_screen(tmp); 1557 1548 paranoid_free(tmp); … … 1624 1615 case SIGABRT: 1625 1616 mr_asprintf(&tmp, "SIGABRT"); 1626 mr_asprintf(&tmp2, 1627 "Abort - probably failed assertion. I'm sleeping for a few seconds so you can read the message."); 1617 mr_asprintf(&tmp2, "Abort - probably failed assertion. I'm sleeping for a few seconds so you can read the message."); 1628 1618 break; 1629 1619 default:
Note:
See TracChangeset
for help on using the changeset viewer.