tags:

views:

2001

answers:

6

I need to figure out the hard drive name for a solaris box and it is not clear to me what the device name is. On linux, it would be something like /dev/hda or /dev/sda, but on solaris I am getting a bit lost in the partitions and what the device is called. I think that entries like /dev/rdsk/c0t0d0s0 are the partitions, how is the whole hard drive referenced?

+6  A: 

/dev/rdsk/c0t0d0s0 means Controller 0, SCSI target (ID) 0, and s means Slice (partition) 0.

Typically, by convention, s2 is the entire disk. This partition overlaps with the other partitions.

prtvtoc /dev/rdsk/c0t0d0s0 will show you the partition table for the disk, to make sure.

JBB
thanks. I found this also.http://initialprogramload.blogspot.com/2008/07/how-solaris-disk-device-names-work.html
Dan Littlejohn
Indeed! The real fun is when you start trying to translate the REAL device names. Do an 'ls -l /dev/dsk/c0t0d0s0' and look at the hideous path through the "real" device tree. Once upon a time I could translate that for specific CPU/IO boards in larger servers. Uuuuugly!
JBB
A: 

c0t0d0s0 is the entire drive. The breakdown is:

/dev/[r]dsk/c C t A d0s S

...where C is the controller number, A is the SCSI address, and S is the "slice". Slice 0 is the whole disk; the other slices are the partition numbers.

See this for more info.

raldi
A: 

cXtYdZs2 is the whole drive. period.

+1  A: 

What do you want to do to the whole disk? Look at the EXAMPLES section of the man page for the command in question to see how much of a disk name the command requires.

zpool doesn't require a partition, as in: c0t0d0 newfs does: c0t0d0s0 dd would use the whole disk partition: c0t0d0s2

Note: s2 as the entire disk is just a convention. A root user can use the Solaris format command and change the extent of any of the partitions.

tpgould
A: 

The comments about slice 2 are only correct for drives with an SMI label.

If the drive is greater than 1TB, or if the drive has been used for ZFS, the drive will have an EFI label and slice 2 will NOT be the entire disk. With an EFI label, slice 2 is "just another slice". You would then refer to the whole disk by using the device name without a slice, e.g. c0t0d0.

A: 

sorry .. how to change the device name, ex : c1t2 to c1t1 ..thank U