# After formating a sata disk, all disk names change from /dev/ad0# to /dev/ad#p1



## bbmak0 (Oct 16, 2011)

Why does that happen? Is there any way to change back to /dev/ad0#?


----------



## wblock@ (Oct 16, 2011)

Please show exactly what you mean.


----------



## bbmak0 (Oct 17, 2011)

wblock@ said:
			
		

> Please show exactly what you mean.



I have a Western Digital 2TB drive, and it has the advanced format feature. I try to follow the instruction to format the drive to 4k align.


```
dd if=/dev/zero of=/dev/ad8 bs=1M count=10
gpt create ad8
gpt add -b 64 -s 3907029056 -t ufs /dev/ad8
newfs -S 4096 -b 32768 -f 4096 -O 2 -U -m 1 -o space -L Storage5 /dev/ad8p1
```

Before I format the drive, all the drives have disk name like this:
/dev/ad2
/dev/ad4
/dev/ad6

after I format it with the above command lines, the disk name change to 
/dev/ad2p1
/dev/ad4p1
/dev/ad6p1

I want to change back to /dev/ad#. Is there any way to do it?


----------



## phoenix (Oct 17, 2011)

/dev/adX refers to the (unformatted) disk, the complete disk device.

Once you create a partition via gpart(1), then a new device node is created to point to that partition:  /dev/adXpY

The original device node (/dev/adX) is still there.

IOW, everything is working correctly, and the system is doing exactly what you told it to.


----------



## bbmak0 (Oct 18, 2011)

phoenix said:
			
		

> /dev/adX refers to the (unformatted) disk, the complete disk device.
> 
> Once you create a partition via gpart(1), then a new device node is created to point to that partition:  /dev/adXpY
> 
> ...



Thank you for clearing my confusion.


----------



## fluca1978 (Oct 21, 2011)

Just a curiosity: why are gpt partitions named after a 'p' and not the usual 's' of slice?


----------



## mix_room (Oct 21, 2011)

Probably because they are partitions and not slices.


----------



## fluca1978 (Oct 21, 2011)

Of course they are partitions, but after all slices are not partitions? As far as I know slices are what in the bios terminology are partitions. Is there an architecture where slices are something really different from a partition intended in the bios way?


----------



## Beastie (Oct 21, 2011)

BSD slices are BIOS partitions. They contain BSD partitions, which are similar to DOS/Windows extended-logical partitions.

GPT partitions are more or less the "modern" equivalent of BIOS partitions/BSD slices.


----------



## fluca1978 (Oct 21, 2011)

Beastie said:
			
		

> BSD slices are BIOS partitions. They contain BSD partitions, which are similar to DOS/Windows extended-logical partitions.
> 
> GPT partitions are more or less the "modern" equivalent of BIOS partitions/BSD slices.



Yes I know. My former question was about a naming conflict. Having gpt the partition names like 'a', 'b'. 'c' loose their meaning.


----------



## Beastie (Oct 21, 2011)

fluca1978 said:
			
		

> My former question was about a naming conflict. Having gpt the partition names like 'a', 'b'. 'c' loose their meaning.


And I was answering that question: GPT partitions - /dev/adXpY - are the equivalent of BIOS partitions/BSD slices - /dev/adXsY. See the difference (*p* VS *s*)?


----------



## wblock@ (Oct 21, 2011)

GPT allows (typically) up to 128 partitions on a disk, so bsdlabel and the letter partition names are not needed.


----------



## phoenix (Oct 24, 2011)

fluca1978 said:
			
		

> Yes I know. My former question was about a naming conflict. Having gpt the partition names like 'a', 'b'. 'c' loose their meaning.



BSD slices (sX) are sub-divided into partitions ([a-h]).  There's a finite number of partitions (originally 8; DFlyBSD does 16, not sure what FreeBSD supports).  Hence, device nodes look like ada0*sX[a-h]*.

GPT partitions are not sub-divided.  And you can have 128 of them, way more than there letters in the English alphabet.  Hence, the new naming scheme of *pX*.  Device nodes are simpler, just ada0*pX*.  And you access them directly.


----------

