LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   managing order and names for hd in a raid (https://www.linuxquestions.org/questions/linux-hardware-18/managing-order-and-names-for-hd-in-a-raid-653428/)

gettons1980 07-03-2008 05:47 PM

managing order and names for hd in a raid
 
Hi guys,

shortly, I have 2 sata disks attached to a motherboard and one on a promise pci sata controller.
Everything gone well, all disks recognized by red hat 5.2
I am going to create 3 raid 1 for swap /home and / and I would like to create such raids on two different controller of course :

1 disk on sata mobo controller
and
1 disk on pci sata controller


USUALLY Linux gives names in orders as he find them, and I could take the vol_id and try to boot with only one disk for 3 times to discover the vol_id .
But what if I have no access to this machine?

I mean, is there a way to find and to be sure that sda ( for example ) and sdb are the two on the mobo and sdc is the only one on the pci controller?

Is there a way to see where sd* is attached on my computer, throught which controller ?



Thanks in advance.

mostlyharmless 07-03-2008 06:15 PM

Look in /dev/disk/uuid and compare to the other entries in /dev/disk/something or other. (Sorry, I'm stuck on a Windows machine and can't remember the exact location.) One location will list the partitions and the device names, you should be able to identify them from there.

EDITED, looking up under google
"lspci" should probably help too, as should looking at dmesg

gettons1980 07-04-2008 03:23 AM

Quote:

Originally Posted by mostlyharmless (Post 3203377)
Look in /dev/disk/uuid and compare to the other entries in /dev/disk/something or other. (Sorry, I'm stuck on a Windows machine and can't remember the exact location.) One location will list the partitions and the device names, you should be able to identify them from there.

EDITED, looking up under google
"lspci" should probably help too, as should looking at dmesg



Sorry for my bad english, maybe I couldn't explain the right way.
Basically I have 3 sata hard disks ( sda,sdb,sdc ) : 2 attached on motherboard and 1 on pci controller.
How can I identify which one is attached to pci port ? ( in theory sdc, because usually Linux gives names in the order as if finds them at the boot, and I suppose the 2 hd on the mobo will be the first and second )
I wish to be sure of that because managing a raid and wish to make a raid 1 on two disks and 2 different controllers.


Thanks

mostlyharmless 07-05-2008 05:20 PM

Identifying disks
 
Well, here's how I would do it, using my machine as an example:

Go to /dev/disk/by-id and type

ls

You should see all of the disks. If I do that, for example I get (among other things):

Code:

ata-MAXTOR_STM3320620A_9QF3SLT2
ata-MAXTOR_STM3320620A_9QF3SLT2-part1
ata-MAXTOR_STM3320620A_9QF3SLT2-part2
ata-MAXTOR_STM3320620A_9QF3SLT2-part3

'ls -l' reveals

Code:

lrwxrwxrwx 1 root root  9 2008-07-05 07:45 ata-MAXTOR_STM3320620A_9QF3SLT2 -> ../../hda
lrwxrwxrwx 1 root root 10 2008-07-05 07:45 ata-MAXTOR_STM3320620A_9QF3SLT2-part1 -> ../../hda1
lrwxrwxrwx 1 root root 10 2008-07-05 07:45 ata-MAXTOR_STM3320620A_9QF3SLT2-part2 -> ../../hda2
lrwxrwxrwx 1 root root 10 2008-07-05 07:45 ata-MAXTOR_STM3320620A_9QF3SLT2-part3 -> ../../hda3

All of which show that this particular Maxtor disk (which you can externally identify on the physical label) as STM332062A etc. is attached to IDE as hda.

Going to /dev/disk/by-path and typing 'ls'

Code:

pci-0000:00:1f.1-ide-0:0
pci-0000:00:1f.1-ide-0:0-part1
pci-0000:00:1f.1-ide-0:0-part2
pci-0000:00:1f.1-ide-0:0-part3
pci-0000:00:1f.1-ide-1:0
pci-0000:00:1f.1-ide-1:1
pci-0000:02:03.0-ieee1394-0x0010b92100783ba2:1:0
pci-0000:02:03.0-ieee1394-0x0010b92100783ba2:1:0-part1
pci-0000:02:03.0-ieee1394-0x0010b92100783ba2:1:0-part2
pci-0000:02:03.0-ieee1394-0x0010b92100783ba2:1:0-part3

with 'ls -l'

Code:

lrwxrwxrwx 1 root root  9 2008-07-05 07:45 pci-0000:00:1f.1-ide-0:0 -> ../../hda
lrwxrwxrwx 1 root root 10 2008-07-05 07:45 pci-0000:00:1f.1-ide-0:0-part1 -> ../../hda1
lrwxrwxrwx 1 root root 10 2008-07-05 07:45 pci-0000:00:1f.1-ide-0:0-part2 -> ../../hda2
lrwxrwxrwx 1 root root 10 2008-07-05 07:45 pci-0000:00:1f.1-ide-0:0-part3 -> ../../hda3
lrwxrwxrwx 1 root root  9 2008-07-05 07:45 pci-0000:00:1f.1-ide-1:0 -> ../../hdc
lrwxrwxrwx 1 root root  9 2008-07-05 07:45 pci-0000:00:1f.1-ide-1:1 -> ../../hdd
lrwxrwxrwx 1 root root  9 2008-07-05 07:45 pci-0000:02:03.0-ieee1394-0x0010b92100783ba2:1:0 -> ../../sda
lrwxrwxrwx 1 root root 10 2008-07-05 07:45 pci-0000:02:03.0-ieee1394-0x0010b92100783ba2:1:0-part1 -> ../../sda1
lrwxrwxrwx 1 root root 10 2008-07-05 07:45 pci-0000:02:03.0-ieee1394-0x0010b92100783ba2:1:0-part2 -> ../../sda2
lrwxrwxrwx 1 root root 10 2008-07-05 07:45 pci-0000:02:03.0-ieee1394-0x0010b92100783ba2:1:0-part3 -> ../../sda3

Shows the External ieee1394 "Firewire" drive as sda, with each of its partitions.

Looking at /var/adm/dmesg shows (among a lot of other stuff)

Code:

Probing IDE interface ide0...
hdb: IOMEGA ZIP 250 ATAPI, ATAPI FLOPPY drive
hda: MAXTOR STM3320620A, ATA DISK drive
hda: host max PIO4 wanted PIO255(auto-tune) selected PIO4
hda: UDMA/100 mode selected
hdb: applying conservative PIO "downgrade"
hdb: host max PIO4 wanted PIO255(auto-tune) selected PIO2
hdb: UDMA/33 mode selected
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Probing IDE interface ide1...
hdd: DVD-ROM DDU1621, ATAPI CD/DVD-ROM drive
hdc: SONY DVD+RW DRU-120A, ATAPI CD/DVD-ROM drive
hdc: host max PIO4 wanted PIO255(auto-tune) selected PIO4
hdc: UDMA/33 mode selected
hdd: host max PIO4 wanted PIO255(auto-tune) selected PIO4
hdd: UDMA/33 mode selected
ide1 at 0x170-0x177,0x376 on irq 15
PDC20271: IDE controller (0x105a:0x6269 rev 0x02) at  PCI slot 0000:02:05.0
ACPI: PCI Interrupt 0000:02:05.0[A] -> GSI 17 (level, low) -> IRQ 16
PDC20271: PLL input clock is 16587 kHz
PDC20271: 100% native mode on irq 16
    ide2: BM-DMA at 0xac00-0xac07, BIOS settings: hde:pio, hdf:pio
    ide3: BM-DMA at 0xac08-0xac0f, BIOS settings: hdg:pio, hdh:pio
Probing IDE interface ide2...
hde: WDC WD1600JB-00REA0, ATA DISK drive
hde: host max PIO4 wanted PIO255(auto-tune) selected PIO4
hde: UDMA/100 mode selected
ide2 at 0x9c00-0x9c07,0xa002 on irq 16
Probing IDE interface ide3...
hdg: WDC WD1600AAJB-00PVA0, ATA DISK drive
hdg: host max PIO4 wanted PIO255(auto-tune) selected PIO4
hdg: UDMA/100 mode selected
ide3 at 0xa400-0xa407,0xa802 on irq 16
hda: max request size: 512KiB
hda: 625142448 sectors (320072 MB) w/16384KiB Cache, CHS=38913/255/63
hda: cache flushes supported
 hda: hda1 hda2 hda3
hde: max request size: 512KiB
hde: 312581808 sectors (160041 MB) w/8192KiB Cache, CHS=19457/255/63
hde: cache flushes supported
 hde: hde1 hde2 hde3
 hde: p3 exceeds device capacity
hdg: max request size: 512KiB
hdg: 312581808 sectors (160041 MB) w/8192KiB Cache, CHS=19457/255/63
hdg: cache flushes supported

So you can see each disk on each port. For example above, hda is the ide0 drive on the motherboard, hdb is a ZIP drive, hdc, hdd are CD drives, hde and hdg are ide1 drives on a board with a PDC-20271 chip (a Fasttrak firmware RAID board)

Hope that makes it clearer!


All times are GMT -5. The time now is 10:25 PM.