-1

Using Centos. Situation: I have multiple drives off of two RAID controllers. I also have multiple entries in the fstab, such as /dev/sdb, /dev/sdc, etc. What I need to know is how I can identify which drives or set of drives (in the case of RAID) correspond to an entry in the /etc/fstab file.

In other words, I want to be able to look at /etc/fstab, see an entry as /dev/sda, and find that specific disk drive' slot/bay/port/whatever on the actual server.

Seems like this should be a very very simple thing to do, but even my manager who is a sys admin can't really answer this, nor can I find any concrete answers on stackexchange.

Really appreciate the help, and I am happy to elaborate if needed.

EDIT: I imagine this might be able to be done using the hardware RAID controller, however since there are situations where one would have a bunch of single drives, I would instead prefer to know how I identify by using a standard and widely available linux tool, like gparted or something.

lobi
  • 1,021
  • 2
  • 14
  • 26
  • What specific OS and version are you using? – ewwhite Jun 01 '15 at 21:38
  • 2
    You might want to check out the answer here. http://serverfault.com/a/190700/984 Many of the tools described there will potentially be useful in your situation. – Zoredache Jun 02 '15 at 00:23
  • Using centos. Sorry I thought I already put that in... – lobi Jun 02 '15 at 16:37
  • Why was my question downvoted? Clearly this is a legitimate question. @Zoredache, that link you sent me provided me the information I was looking for! Specifically, I can use lshw -class disk, which will list both the serial ID and the logical name (/dev/X). If you want to reiterate this in an answer form I can mark you down as the answer – lobi Jun 02 '15 at 16:47
  • Since that answer provided the information, I'll mark this question as having that answer on that question – Zoredache Jun 02 '15 at 16:49

1 Answers1

1

FSTAB(5)
Instead of giving the device explicitly, one may indicate the filesystem that is to be mounted by its UUID or LABEL (cf. e2label(8) or xfs_admin(8)), writing LABEL= or UUID=, e.g., LABEL=Boot' orUUID=3e6be9de-8139-11d1-9106-a43f08d823a6'.

Otherwise, trust in udev to populate /dev/disk, but this will only tell you how things are right now, not how they were.

84104
  • 12,698
  • 6
  • 43
  • 75
  • This doesn't help because the LABEL is user defined. If you install more than one drive (and therefore, see more than one new /dev/X entry) then you won't be able to discern which drive is associated with which /dev/X entry. I'm not sure if the UUID is user defined or automagically populated, but if it is automagically populated in the fstab (or somewhere else) then I don't see how you can compare that to the physical drives in order to identify them. Can you elaborate on using udev? It is possible to use udev to identify physical drives in the server's bay/slot/port? – lobi Jun 02 '15 at 16:36