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?
views:
2001answers:
6/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.
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.
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.