Numbering and renumbering of drives

Status
Not open for further replies.

-fun-

Contributor
Joined
Oct 27, 2015
Messages
171
I have a question regarding the way how drives are numbered and renumbered which I cannot resolve from the FreeBSD manual as well as forum search.

I have the following situation: I have a SATA disk (ada0, refered to as 'Anna' for purposes of this post) in my system connected to the SATA port 1. I now added a second SATA drive to the SATA port 5 (named 'Bert' for a reference). This was named 'ada1'. I created a pool and zvol on Bert.

Now some questions:

1. If I would remove Anna from my system, would Bert still be ada1 or would it be ada0? If it is known as ada0 would FreeNAS be able to seamlessly work with zvol and datasets on Bert?

2. If I kept Anna, removed Bert, and added another disk ('Carol') to the system to SATA port 2, would Carol then be known as ada1? (Or would FreeNAS somehow remember 'ada1' was already assigned to Bert once and call Carol 'ada2' instead?)

3. If I kept Anna and Bert and added Carol to SATA port 2, would Carol be known as ada1 or ada2 and what would Bert be known as? Also in this situation, would zvol and dataset on Bert continue to work?
 

ethereal

Guru
Joined
Sep 10, 2012
Messages
762
freenas does't care how the hard drives are connected as long as the disks are there. during booting the disks are recognised and imported
 

zambanini

Patron
Joined
Sep 11, 2013
Messages
479
if you move the drives, merkel will be overrun by the afd ; ) driveIDs from the controller do not matter. the system will mount your volumes. more information should be within the freenas documentation.
 

BigDave

FreeNAS Enthusiast
Joined
Oct 6, 2013
Messages
2,479
I'm going to answer based on the assumption that you are not hot swapping drives, but performing
a proper shutdown before pulling or adding drives to the controller and then booting back up...
1. If I would remove Anna from my system, would Bert still be ada1 or would it be ada0?
The drive
"Bert" would now be ada0.
If it is known as ada0 would FreeNAS be able to seamlessly work with zvol and datasets on Bert?
Yes.

2. If I kept Anna, removed Bert, and added another disk ('Carol') to the system to SATA port 2, would Carol then be known as ada1?
Yes.
(Or would FreeNAS somehow remember 'ada1' was already assigned to Bert once and call Carol 'ada2' instead?)
No, FreeNAS would not.
HOWEVER, if Bert was to be placed back (after Carol became ada1, FreeNAS would recognize it as "previously known as ada1"
IF it ever contained meta data;) (which it would, because it was a recognized volume).

3. If I kept Anna and Bert and added Carol to SATA port 2, would Carol be known as ada1 or ada2 and what would Bert be known as? Also in this situation, would zvol and dataset on Bert continue to work?
The term "kept Anna and Bert" is too vague of a description to answer this question, besides I now find myself
laughing too hard to type anymore. Did you find this as much -fun- as I did? o_O o_O o_O o_O
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
If I kept Anna and Bert and added Carol to SATA port 2, would Carol be known as ada1 or ada2 and what would Bert be known as? Also in this situation, would zvol and dataset on Bert continue to work?
Unknown whether Carol would be ada1 or ada2, but I'd guess ada1. Very generally speaking, disks are numbered in the order in which the OS sees them, and it's most likely that the SATA ports are scanned for drives in numerical order (assuming, of course, the the silkscreen on the motherboard matches the connections to the controller). Bert would continue to work just fine, though. FreeNAS (and more broadly, FreeBSD/ZFS) doesn't care which ports the member disks of a pool are connected to; the ZFS metadata on the disks tells the OS which pool they're part of.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Well Anna (my Ex) works at HGST so this story line seems to fit right in place, Bert is this girl form work I know (short for Beatrice) whom is a computer goddess, while Carol, yes another gal from work is not a computer goddess but she is a nice person. So Anna will always want to be the first but really even though she works for HGST, she's not a computer goddess like Bert and there would be a struggle between who is first. If Carol suddenly jumped into the picture then all hell breaks loose and at that point, who cares who is ada0, ada1, or ada2.

No, seriously the answer depends on the response times when all the drives are asked if they exist. Typically a drive which comes up as ada0 will always come up as ada0 but because this is a race of basically electrons there is a point in time where this may not be true. Gravity affects everything, including speeding electrons and when the lunar surface (moon) is closer to earth many things happen and one obvious thing that is very visible is the ocean tide will rise and then lower. This is not just a lunar caused event, it's also the Sun as well. This is true science here kiddies. So now you can see that gravity does impact our world (otherwise you would float off the planet) but it also affect the speed of objects, yes even electrons. Even though electrons have such little mass, gravity still affects it. Now this part will make sense to us old dogs when a cathode ray tube (CRT) was popular but when you shoot a stream of electrons towards the center of a CRT the beam will bend towards earth, Newtons First Law. Out in space this will bend much less. So now we know gravity affects electrons. So if you have the correct gravitational forces in place, one of the drives could post before anther one. Does that make any sense or did I confuse anyone.

Let me go over it another way, if you think I'm jerking your chain using some real science then you are correct but the postings before mine are correct.
 

BigDave

FreeNAS Enthusiast
Joined
Oct 6, 2013
Messages
2,479
Well Anna (my Ex) works at HGST so this story line seems to fit right in place, Bert is this girl form work I know (short for Beatrice) whom is a computer goddess, while Carol, yes another gal from work is not a computer goddess but she is a nice person. So Anna will always want to be the first but really even though she works for HGST, she's not a computer goddess like Bert and there would be a struggle between who is first. If Carol suddenly jumped into the picture then all hell breaks loose and at that point, who cares who is ada0, ada1, or ada2.

No, seriously the answer depends on the response times when all the drives are asked if they exist. Typically a drive which comes up as ada0 will always come up as ada0 but because this is a race of basically electrons there is a point in time where this may not be true. Gravity affects everything, including speeding electrons and when the lunar surface (moon) is closer to earth many things happen and one obvious thing that is very visible is the ocean tide will rise and then lower. This is not just a lunar caused event, it's also the Sun as well. This is true science here kiddies. So now you can see that gravity does impact our world (otherwise you would float off the planet) but it also affect the speed of objects, yes even electrons. Even though electrons have such little mass, gravity still affects it. Now this part will make sense to us old dogs when a cathode ray tube (CRT) was popular but when you shoot a stream of electrons towards the center of a CRT the beam will bend towards earth, Newtons First Law. Out in space this will bend much less. So now we know gravity affects electrons. So if you have the correct gravitational forces in place, one of the drives could post before anther one. Does that make any sense or did I confuse anyone.

Let me go over it another way, if you think I'm jerking your chain using some real science then you are correct but the postings before mine are correct.
Leave it to an electrical engineer to bring GRAVITY into this...
LMAO
I hope the -fun- doesn't end here...
 

depasseg

FreeNAS Replicant
Joined
Sep 16, 2014
Messages
2,874
Now some questions:
1. If I would remove Anna from my system, would Bert still be ada1 or would it be ada0? If it is known as ada0 would FreeNAS be able to seamlessly work with zvol and datasets on Bert?
2. If I kept Anna, removed Bert, and added another disk ('Carol') to the system to SATA port 2, would Carol then be known as ada1? (Or would FreeNAS somehow remember 'ada1' was already assigned to Bert once and call Carol 'ada2' instead?)
3. If I kept Anna and Bert and added Carol to SATA port 2, would Carol be known as ada1 or ada2 and what would Bert be known as? Also in this situation, would zvol and dataset on Bert continue to work?
The simple answer to all of your questions is that it is possible for any disk to get any name (not quite but close enough), so don't worry about ada1 etc.
FreeNAS doesn't care about the ada names and instead puts an identifier onto the disk that it reads to figure out the disk ID.
 

-fun-

Contributor
Joined
Oct 27, 2015
Messages
171
Wow, thank you all for the answers!!

So the very short answer is, whatever drive names are assigned by the OS during boot, FreeNAS will be able to work as expected. Easier than I thought. I do not hot swap drives so not additional complication here.

Btw. I wasn't up to making jokes, it just seemed convenient to have some handle to refer each drive ('Bert' instead of 'the drive that was connected to SATA port 5 in scenario 1 becoming ada1, was removed in scenario 2 and re added after adding another drive to SATA port 2 and then was named ada1 or possibly ada2 instead'). Didn't expect that this would trigger that much funny followup posts. :smile:
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Leave it to an electrical engineer to bring GRAVITY into this...
LMAO
I hope the -fun- doesn't end here...
Just caught me in one of those weird moods I get in.
 
Status
Not open for further replies.
Top