mpxio-upgrade revision bd93c05dbd9b8f1e8d2edf48c777bc881f927608
18861N/A# The contents of this file are subject to the terms of the 18861N/A# Common Development and Distribution License (the "License"). 18861N/A# You may not use this file except in compliance with the License. 18861N/A# See the License for the specific language governing permissions 18861N/A# and limitations under the License. 18861N/A# When distributing Covered Code, include this CDDL HEADER in each 18861N/A# If applicable, add the following below this CDDL HEADER, with the 18861N/A# fields enclosed by brackets "[]" replaced with your own identifying 18861N/A# information: Portions Copyright [yyyy] [name of copyright owner] 18861N/A# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 18861N/A# Copyright 2015 Nexenta Systems, Inc. All rights reserved. 18861N/A# Make sure that the essential libraries can be found. 18861N/A # display recovery instructions - the first call logs to the service 18861N/A # log and the second call displays on the console. # root ("/") is already mounted read only by the kernel. # Remount the root read-write. # In single-user maintenance mode, we don't have a writable # root partition, so we _cannot_ use devlinks. Therefore we # have to do some dancing - first mount the physical path # read-write, then re-run $STMSBOOTUTIL to get the real # devlink mapping, and then re-mount the root slice. Of course, # if we all used ZFS this wouldn't be such a pain! # ZFS root environments should _not_ have an entry for / # sanity check for ZFSRoot _and_ / in /etc/vfstab # ERROR - this would cause a failure later # so let root know about it now and provide cecho "stmsboot: System has ZFS Root *and* an entry for / in /etc/vfstab\nstmsboot: Please remove the / entry from /etc/vfstab and then run\n# svcadm clear mpxio-upgrade" # this is a bad state to be in, exit cecho "Error: Your root device is not mapped." # if we've got active-active paths to our rootvp and # the first path returned by $STMSBOOTUTIL is not the # same as the one we booted from, then we need some # handwaving due to restrictions in the ufs module # (see the remountfs() function in # now re-run $STMSBOOTUTIL to get the real # mapping for this device cecho "Error: Unable to remount your root device" cecho "stmsboot: Error: your root slice is invalid" cecho "stmsboot: Root is on ZFS" # Must use -o largefiles here to ensure the read-only # mount does not fail as a result of having a large if [ "$option" != "largefiles" ]; then # Requesting logging on a read-only mount # causes errors to be displayed, so remove # "logging" from the list of options. # In case of a manual restart of the service, mount # will emit messages if /usr is already mounted. # So redirect the output to /dev/null. # update system dump configuration # Disable device-in-use checking (done in libdiskmgt). # Without disabling this check, the configuration of dump device # would fail as the device-in-use code incorrectly concludes that # the device is in use and hence prevents configuration of the dump cecho "stmsboot: dump configuration \ # make sure we can get to it, force zfs to load fully cecho "stmsboot: dump on ZFS, no dumpadm update required" # Update bootpath for x86 here when we are enabling mpxio on root cecho "stmsboot: ERROR! Unable to retrieve bootpath property\n" # Since on x64 platforms the eeprom command doesn't update the # bootpath variable have a good chance of differing. We do some # extra handwaving to get the correct bootpath variable setting. if [ "$mapped" != "NOT_MAPPED" ]; then # now strip off leading and trailing space chars cecho "stmsboot: bootpath has been updated" # NOTE: If the first attempt to run the service has failed due to an # expected error, users should be able to manually rerun the service. # First mount /usr read only. This must be done to run # utilities such as fsck and devfsadm. # In the case of a manual rerun of the service, mounting of /usr here # fails if /usr already happens to be mounted. It is better that we # do not mount /usr if already mounted, but there seems to be no # apparent way to check whether /usr is mounted or not as we mount # /usr without making an entry into /etc/mnttab. So instead of # explicitly checking for mount failures, we just do a sanity check # by looking for some file (in this case devfsadm) in /usr. cecho "stmsboot: configuring devices" # update /etc/vfstab to reflect device name changes # handle active-active paths, where the probe order # for the hba reports a different path to what the # boot-device variable gives us # we got a different path for root cecho "stmsboot: vfstab has been updated" # update svm configuration to reflect new names if [ "$MACH" = "i386" ]; then # only update bootpath here for x86 cecho "stmsboot: now regenerating boot archive" cecho "stmsboot: rebooting the system now."