Assigning a Volume Name to a Solaris disk
We generally use the Solaris format
command to manage disks. But we can also use it to assign a Volume Name (volname) to any disk allowing for sysadmins to administer the disks easier.
FORMAT MENU: disk - select a disk type - select (define) a disk type partition - select (define) a partition table current - describe the current disk format - format and analyze the disk repair - repair a defective sector label - write label to the disk analyze - surface analysis defect - defect list management backup - search for backup labels verify - read and display labels save - save new disk/partition definitions inquiry - show vendor, product and revision volname - set 8-character volume name !<cmd> - execute <cmd> then return quit
volname — menu option to instruct labelling
Note: The volname
is a non-destructive command. It will not destroy data on a disk. Even if the disk has partitions that are mounted.
Warning: Do not use the label to write a volume name to the disk. The label
command will write a new VTOC to the disk and not the volume name.
To assign a volume name to a specific disk we can perform the following:
- Run
format
and select the desired disk# format Searching for disks...done AVAILABLE DISK SELECTIONS: 0. c0t0d0 /pci@1c,600000/scsi@1/sd@0,0 1. c0t1d0 /pci@1c,600000/scsi@1/sd@1,0 2. c0t2d0 /pci@1c,600000/scsi@1/sd@2,0 3. c0t3d0 /pci@1c,600000/scsi@1/sd@3,0 Specify disk (enter its number): 1
- The Format Menu is shown
selecting c0t1d0: [disk formatted] FORMAT MENU: disk - select a disk type - select (define) a disk type partition - select (define) a partition table current - describe the current disk format - format and analyze the disk repair - repair a defective sector label - write label to the disk analyze - surface analysis defect - defect list management backup - search for backup labels verify - read and display labels save - save new disk/partition definitions inquiry - show vendor, product and revision volname - set 8-character volume name !<cmd> - execute <cmd>, then return quit format>
- Enter volname at the
format>
prompt and enter the volume name you want to assign (remember quotes), and enter y when prompted to label the diskformat> volname Enter 8-character volume name (remember quotes) [""]:"OSmirror" Ready to label disk, continue? y
- Now select disks again to confirm label
format> disk AVAILABLE DISK SELECTIONS: 0. c0t0d0 /pci@1c,600000/scsi@1/sd@0,0 1. c0t1d0 OSmirror /pci@1c,600000/scsi@1/sd@1,0 2. c0t2d0 /pci@1c,600000/scsi@1/sd@2,0 3. c0t3d0 /pci@1c,600000/scsi@1/sd@3,0 Specify disk (enter its number):
From the above we can see that the disk label is shown against the disk. - Selecting the disk also shows the volume name (label)
Specify disk (enter its number): 1 selecting c0t1d0: OSmirror [disk formatted]
Type quit at theformat>
prompt to exit the format utility.