topics that matter; ideas worth sharing

share a tip, submit a link, add something new

Unix Tip: Making a device alias for your root mirror

October 4, 2006, 04:03 PM —  ITworld.com — 


Digg!


Send in your Unix questions today! |
See additional Unix tips and tricks


Once you have mirrored your root partition, you may still need to create a device alias for the mirror so that you can boot from it if the primary mirror ever fails. To prepare for this, you should first generate a long listing of the partition on which the mirror resides. It will look something like this:

lrwxrwxrwx   1 root     root          43 Feb  3  2004 /dev/dsk/c1t0d0s0
-> ../../devices/pci@8,600000/SUNW,qlc@4/fp@0,0/disk@1,0

Print the portion of this path that follows the word "devices". Have this information on hand when you go to define your new alias. In the example above, this would look like this:

pci@8,600000/SUNW,qlc@4/fp@0,0/disk@1,0

This is the physical device name for your alternate root partition. You might need this information when you create your device alias at the open boot prompt.



Once you have copied this information, use the init 0 command to bring your server down to single user mode.

# init 0

Use the devalias command to view the device aliases that are already defined on your system. You might find that your mirror is already defined with an alias such as "disk2".



Use the show-disks command to display a list for disk selections:

ok show-disks
a) /pci@8,600000/SUNW,qlc@4/fp@0,0/disk
b) /pci@8,700000/pci@3/scsi@5/sd
c) /pci@8,700000/pci@3/scsi@4/sd
d) /pci@8,700000/scsi@6,1/disk
e) /pci@8,700000/scsi@6/disk
q) NO SELECTION
Enter Selection, q to quit: 

At this point, you can select a device and re-use it to define an alias for your mirror. First, type the letter corresponding to the device you want to use. This stores the device address in memory.

Enter Selection, q to quit: a
/pci@8,600000/SUNW,qlc@4/fp@0,0/disk has been selected.
Type ^Y ( Control-Y ) to insert it in the command line.
e.g. ok nvalias mydev ^Y
         for creating devalias mydev for
/pci@8,600000/SUNW,qlc@4/fp@0,0/disk

Next, type "nvalias" followed by the name you want to use for your root mirror (e.g., "nvalias rootmirror") and then control-Y (as was indicated in the system prompts shown above) to past the contents of the buffer into your command line.

ok nvalias rootmirror ^Y

When you type ^Y, the stored path will be filled in and the line will look something like this:

ok nvalias rootmirror /pci@8,600000/SUNW,qlc@4/fp@0,0/disk

Notice that the line is truncated. You'll need to add "@target,0" to the end of what you see. In this case, "@1,0" to match the new device.

ok nvalias rootmirror /pci@8,600000/SUNW,qlc@4/fp@0,0/disk

You can display the devices in your boot devices list by typing "printenv boot-device" at the ok prompt. Then, type the following command to add the rootmirror to the list. Notice how we are adding it after the primary root mirror and before the option to boot off the network.

ok setenv boot-device disk rootmirror net

Display your boot device list again and verify that your change has taken effect:

ok printenv boot-device
boot device=	disk	rootmirror	net

At this point, it's a good idea to boot off your root mirror and make sure that everything works as expected. If your system complains that it cannot open the boot device, you need to check your spelling. Make sure the listing you collected earlier matches your new rootmirror alias.

 

ITworld.com

I like it!
Post a comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
Resources
White Paper

Symantec Backup Exec 12 and Backup Exec System Recovery 8 deliver industry leading Windows data protection and system recovery. Download this whitepaper to find out the top reasons to upgrade and how to get continuous data protection and complete system recovery.

Webcast

Data and system loss — from a hard drive failure, malicious attack, natural disaster, or simple human error — can happen anytime. Don’t leave your business vulnerable. Make sure you have a secure recovery strategy in place. Symantec's latest backup and system recovery technology can efficiently restore critical applications, individual emails and documents and even restore your entire system in minutes in the event of a loss.

White Paper

Businesses face a growing challenge to ensure that the IT environment is properly protected. Backup Exec 12 integrates with other applications in the Symantec family of products, to complement your current data protection strategy, keep your data securely backed up and make it recoverable when you need it most.

Free stuff
Featured Sponsor

AISO founders envisioned a Web hosting company that was environmentally friendly. While the company employed energy-efficient innovations like solar panels, its infrastructure produced unacceptable power and cooling requirements. Find out how AISO leveraged AMD technology to overcome their challenge in this case study white paper.

In this whitepaper, Scalar explores the opportunity to change the landscape with respect to mission critical databases built around Oracle. Leveraging technologies such as Linux, high-end commodity processing power and Oracle RAC technology to architect, design, build and maintain database infrastructure that delivers maximum availability, reliability and performance at a fraction of traditional cost.

On a typical day, weather.com, the Web site for The Weather Channel in Atlanta, serves up between 15 million and 20 million page views. But in September 2004, when back-to-back hurricanes ransacked Florida, the peak traffic on one day more than tripled: over 70 million page views by more than 7 million unique visitors. Read the full success story now.

More Resources