Changeset 1791 in MondoRescue


Ignore:
Timestamp:
Nov 13, 2007, 3:33:28 PM (16 years ago)
Author:
Bruno Cornec
Message:

Do not mount /boot if it's already mounted - avoids ESX hang

Location:
branches/2.2.5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mindi/mindi

    r1790 r1791  
    31983198    /usr/sbin/esxcfg-module -l >> $LOGFILE
    31993199    MODULES="$MODULES `/usr/sbin/esxcfg-module -l | awk '{print $1}'`"
    3200     DF="/bin/vdf"
     3200    #DF="/usr/sbin/vdf"
    32013201fi
    32023202echo "-------------" >> $LOGFILE
  • branches/2.2.5/mondo/src/common/libmondo-tools.c

    r1749 r1791  
    14361436    if (tmp[0]) {
    14371437        log_it("/boot is at %s according to /etc/fstab", tmp);
    1438         if ((strstr(tmp, "LABEL=") || strstr(tmp,"UUID="))) {
    1439             if (!run_program_and_log_output("mount /boot", 5)) {
    1440                 strcpy(g_boot_mountpt, "/boot");
    1441                 log_msg(1, "Mounted /boot");
     1438        strcpy(command, "mount | grep -Ew '/boot'");
     1439        strcpy(tmp, call_program_and_get_last_line_of_output(command));
     1440        if (strcmp(tmp,"")) {
     1441            /* Found something */
     1442            strcpy(g_boot_mountpt, "/boot");
     1443        } else {
     1444            if ((strstr(tmp, "LABEL=") || strstr(tmp,"UUID="))) {
     1445                if (!run_program_and_log_output("mount /boot", 5)) {
     1446                    strcpy(g_boot_mountpt, "/boot");
     1447                    log_msg(1, "Mounted /boot");
     1448                } else {
     1449                    log_it("...ignored cos it's a label or uuid :-)");
     1450                }
    14421451            } else {
    1443                 log_it("...ignored cos it's a label or uuid :-)");
    1444             }
    1445         } else {
    1446             sprintf(command, "mount | grep -E '^%s'", tmp);
    1447             log_msg(3, "command = %s", command);
    1448             if (run_program_and_log_output(command, 5)) {
    1449                 strcpy(g_boot_mountpt, tmp);
    1450                 sprintf(tmp,
    1451                         "%s (your /boot partition) is not mounted. I'll mount it before backing up",
    1452                         g_boot_mountpt);
    1453                 log_it(tmp);
    1454                 sprintf(tmp, "mount %s", g_boot_mountpt);
    1455                 if (run_program_and_log_output(tmp, 5)) {
    1456                     g_boot_mountpt[0] = '\0';
    1457                     log_msg(1, "Plan B");
    1458                     if (!run_program_and_log_output("mount /boot", 5)) {
    1459                         strcpy(g_boot_mountpt, "/boot");
    1460                         log_msg(1, "Plan B worked");
    1461                     } else {
    1462                         log_msg(1,
     1452                sprintf(command, "mount | grep -E '^%s'", tmp);
     1453                log_msg(3, "command = %s", command);
     1454                if (run_program_and_log_output(command, 5)) {
     1455                    strcpy(g_boot_mountpt, tmp);
     1456                    sprintf(tmp,
     1457                            "%s (your /boot partition) is not mounted. I'll mount it before backing up",
     1458                            g_boot_mountpt);
     1459                    log_it(tmp);
     1460                    sprintf(tmp, "mount %s", g_boot_mountpt);
     1461                    if (run_program_and_log_output(tmp, 5)) {
     1462                        g_boot_mountpt[0] = '\0';
     1463                        log_msg(1, "Plan B");
     1464                        if (!run_program_and_log_output("mount /boot", 5)) {
     1465                            strcpy(g_boot_mountpt, "/boot");
     1466                            log_msg(1, "Plan B worked");
     1467                        } else {
     1468                            log_msg(1,
    14631469                                "Plan B failed. Unable to mount /boot for backup purposes. This probably means /boot is mounted already, or doesn't have its own partition.");
     1470                        }
    14641471                    }
    14651472                }
Note: See TracChangeset for help on using the changeset viewer.