smallbusiness.itworld.com
  Search  
Small Business Home Page Small Business Webcasts Small Business White Papers Small Business Newsletters Small Business News Small Business Topic Map Careers ITworld Voices ITwhirled The site for Small and Medium Business from ITworld.com

Unix Tip: Making a device alias for your root mirror

ITworld.com 10/04/2006

Sandra Henry-Stocker, 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.

On this topic

 

Sandra Henry-Stocker has been administering Unix systems for more than 18 years. She describes herself as "USL" (Unix as a second language) but remembers enough English to write books and buy groceries. She currently works for TeleCommunication Systems, a wireless communications company, in Annapolis, Maryland, where no one else necessarily shares any of her opinions. She lives with her second family on a small farm on Maryland's Eastern Shore. Send comments and suggestions to bugfarm@gmail.com.




Sponsored Links

Used and Refurbished Cisco Routers
Purchase Your Routers From Network Liquidators. Savings of Up to 90% with a Lifetime Warranty!
Sony Entry-Level Data Projectors With HDMI!
Universally Seen As The Perfect Choice For Education & Business. Bright, Stylish, Easy To Use!
Intel® Technology’s Impact On Mobile IT Efficiency
Check Out How Centrino® With vPro™ Technology Is Cost Effectively Keeping PC Fleets Productive.
FREE SECURITY AUDIT RESOURCES
Take a Risk Assessment, get White Papers on the Latest Threats, listen to Malware Expert Webcasts.
TAKE CONTROL OF REMOTE COMPUTERS
Support, configure and install applications and updates remotely for greater efficiency.
» Buy a link now

Advertisements
Sponsored links
Locate Hidden Software on business PCs with this free tool
Top 5 Reasons to Combine App Performance and Security
Bring harmony to your mix of UNIX-Linux-Windows computing environments
KODAK i1400 Series Scanners stand up to the challenge
 Home   Development, collaboration, innovation  Open source
www.itworld.com    open.itworld.com     security.itworld.com     smallbusiness.itworld.com
storage.itworld.com     utilitycomputing.itworld.com     wireless.itworld.com

 
Contact Us   About Us   Privacy Policy    Terms of Service   Reprints  

CIO   Computerworld   CSO   GamePro   Games.net   IDG Connect   IDG World Expo   Infoworld   ITworld   JavaWorld   LinuxWorld  MacUser   Macworld   Network World   PC World   Playlist  

Copyright © Computerworld, Inc. All rights reserved

Reproduction in whole or in part in any form or medium without express written permission of Computerworld Inc. is prohibited. Computerworld and Computerworld.com and the respective logos are trademarks of International Data Group Inc.