Dan Littlejohn
Dan Littlejohn

Reputation: 579

Hard drive device name on Solaris

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?

Upvotes: 8

Views: 16446

Answers (8)

Kim.K.H
Kim.K.H

Reputation: 39

C0 - Controller T0 - Target D0 - Disk S- - Slice

Upvotes: 0

jlliagre
jlliagre

Reputation: 30803

If you run Solaris on non SPARC hardware and don't use EFI, the whole hard drive is not c0t0d0s2 but c0t0d0p0, s2 is in that case just the Solaris primary partition.

Upvotes: 3

user2983806
user2983806

Reputation: 11

There are two types for disk label, one is SMI(vtoc), the other is GPT(EFI).

On X86 platform and the disk is SMI labeled(default behavior): cXtXdXp0 is the whole physical disk cXtXdXp1-cXtXdXp4 are primary partitions, included the solaris partitions.

cXtXdXs0-cXtXdXs8 are the partitions(slices) of the activate Solaris partitions. cXtXdXs2 is the whole activate Solaris partition, maybe not the whole disk.

Hope I am clear.

/Meng

Upvotes: 1

TLS
TLS

Reputation:

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.

Upvotes: 1

tpgould
tpgould

Reputation: 1756

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.

Upvotes: 2

frozentin
frozentin

Reputation:

cXtYdZs2 is the whole drive. period.

Upvotes: -2

raldi
raldi

Reputation: 22160

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.

Upvotes: -2

JBB
JBB

Reputation: 4841

/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.

Upvotes: 12

Related Questions