====== Disk Device files ======
===== IDE Disks =====
==== libata/pata driver ====
Veel moderne Linux kernels (> 2.6.26) gebruiken de "libata/pata" driver
i.p.v. de "ide_disk" driver.
De naamgeving van IDE disks is bij "libata/pata" SCSI gebaseerd:
^ Linux ide_disk versus libata/pata ^^
^ ide_disk ^ libata/pata ^
| /dev/hda | /dev/sda |
| /dev/hdc | /dev/sdb |
Zie ook: SATA disks.
==== ide_disk driver ====
Onderstaande beschrijving geldt voor Linux kernels met de "ide_disk" driver.
Bij IDE apparaten zijn de "device files" gerangschikt volgens hun
fysieke aansluiting:
^ Device file ^ Controller ^ Master/Slave ^
| /dev/hda | ide0 | master |
| /dev/hdb | ide0 | slave |
| /dev/hdc | ide1 | master |
| /dev/hdd | ide1 | slave |
\\
In onderstaand voorbeeld heeft het systeem twee IDE disks "hda" en "hdc".
Beide disks zijn "master".\\
Device "hdb" is een DVD-RW drive ingesteld als "slave".
(excerpt /var/log/syslog)
Apr 27 09:35:01 strato kernel: [ 4.125282] Probing IDE interface ide0...
Apr 27 09:35:01 strato kernel: [ 4.624105] hda: HDS722580VLAT20, ATA DISK drive
Apr 27 09:35:01 strato kernel: [ 5.084120] hdb: _NEC DVD_RW ND-4550A, ATAPI CD/DVD-ROM drive
Apr 27 09:35:01 strato kernel: [ 5.189295] Probing IDE interface ide1...
Apr 27 09:35:01 strato kernel: [ 5.604104] hdc: HDS722580VLAT20, ATA DISK drive
Apr 27 09:35:01 strato kernel: [ 6.105866] hda: 160836480 sectors (82348 MB) w/1794KiB Cache, CHS=16383/255/63
Apr 27 09:35:01 strato kernel: [ 6.131608] hda: hda1 hda2 hda3 hda4 < hda5 hda6 hda7 hda8 hda9 >
Apr 27 09:35:01 strato kernel: [ 6.224114] hdc: 160836480 sectors (82348 MB) w/1794KiB Cache, CHS=16383/255/63
Apr 27 09:35:01 strato kernel: [ 6.271805] hdc: hdc1 hdc2 hdc3 hdc4 < hdc5 hdc6 hdc7 hdc8 hdc9 >
Apr 27 09:35:01 strato kernel: [ 6.236029] hdb: ATAPI 48X DVD-ROM DVD-R-RAM CD-R/RW drive, 2048kB Cache
Apr 27 09:35:01 strato kernel: [ 6.247964] Uniform CD-ROM driver Revision: 3.20
===== SCSI Disks =====
SCSI apparaten hebben in een computersysteem 4-cijferige adressen,
"Targets" genaamd.\\
^ SCSI ^ Toelichting ^ Voorbeeld ^
| Target | SCSI adres in het systeem | 0:0:3:0 |
| Bus | Systeem bus | 0 |
| Controller | SCSI Controller op deze systeembus | 0 |
| ID | Adres op SCSI bus van deze controller | 3 |
| LUN | Logical Unit Number: SCSI bus subadres (optioneel) | 0 |
\\
De "device files" zijn opeenvolgend gerangschikt:
"/dev/sda", "/dev/sdb", "/dev/sdc", enz.
Onderstaand voorbeeld laat de detectie zien van SCSI disk "0:0:3:0".
(excerpt /var/log/syslog)
Apr 27 22:06:28 juno kernel: [ 2.314262] sym0: <860> rev 0x2 at pci 0000:00:0f.0 irq 18
Apr 27 22:06:28 juno kernel: [ 2.653944] sym0: Symbios NVRAM, ID 7, Fast-20, SE, parity checking
Apr 27 22:06:28 juno kernel: [ 2.654003] sym0: open drain IRQ line driver
Apr 27 22:06:28 juno kernel: [ 2.654050] sym0: using LOAD/STORE-based firmware.
Apr 27 22:06:28 juno kernel: [ 2.656011] sym0: SCSI BUS has been reset.
Apr 27 22:06:28 juno kernel: [ 2.660432] scsi0 : sym-2.2.3
Apr 27 22:06:28 juno kernel: [ 2.662343] target0:0:0: Multiple LUNs disabled in NVRAM
Apr 27 22:06:28 juno kernel: [ 5.933993] target0:0:1: Multiple LUNs disabled in NVRAM
Apr 27 22:06:28 juno kernel: [ 6.231383] target0:0:2: Multiple LUNs disabled in NVRAM
Apr 27 22:06:28 juno kernel: [ 6.526324] target0:0:3: Multiple LUNs disabled in NVRAM
Apr 27 22:06:28 juno kernel: [ 6.531361] scsi 0:0:3:0: Direct-Access QUANTUM ATLAS IV 9 WLS 0B0B PQ: 0 ANSI: 3
Apr 27 22:06:28 juno kernel: [ 6.531444] target0:0:3: Beginning Domain Validation
Apr 27 22:06:28 juno kernel: [ 6.531713] target0:0:3: asynchronous
Apr 27 22:06:28 juno kernel: [ 6.532212] target0:0:3: FAST-10 SCSI 10.0 MB/s ST (100 ns, offset 8)
Apr 27 22:06:28 juno kernel: [ 6.532212] target0:0:3: Domain Validation skipping write tests
Apr 27 22:06:28 juno kernel: [ 6.532212] target0:0:3: Ending Domain Validation
Apr 27 22:06:28 juno kernel: [ 6.532452] target0:0:4: Multiple LUNs disabled in NVRAM
Apr 27 22:06:28 juno kernel: [ 6.821185] target0:0:5: Multiple LUNs disabled in NVRAM
Apr 27 22:06:28 juno kernel: [ 7.116183] target0:0:6: Multiple LUNs disabled in NVRAM
Apr 27 22:06:28 juno kernel: [ 10.476606] sd 0:0:3:0: [sda] 17942584 512-byte hardware sectors (9187 MB)
Apr 27 22:06:28 juno kernel: [ 10.478465] sd 0:0:3:0: [sda] Write Protect is off
Apr 27 22:06:28 juno kernel: [ 10.478522] sd 0:0:3:0: [sda] Mode Sense: e3 00 10 08
Apr 27 22:06:28 juno kernel: [ 10.479993] sd 0:0:3:0: [sda] Write cache: enabled, read cache: enabled, supports DPO and FUA
Apr 27 22:06:28 juno kernel: [ 10.480625] sd 0:0:3:0: [sda] 17942584 512-byte hardware sectors (9187 MB)
Apr 27 22:06:28 juno kernel: [ 10.481800] sd 0:0:3:0: [sda] Write Protect is off
Apr 27 22:06:28 juno kernel: [ 10.481859] sd 0:0:3:0: [sda] Mode Sense: e3 00 10 08
Apr 27 22:06:28 juno kernel: [ 10.483282] sd 0:0:3:0: [sda] Write cache: enabled, read cache: enabled, supports DPO and FUA
Apr 27 22:06:28 juno kernel: [ 10.483359] sda: sda1 sda2 sda3 sda4 < sda5 sda6 >
===== SATA Disks =====
Bij SATA behandelt de kernel de disks alsof het SCSI disks zijn.\\
De rangschikking van de SCSI disk devices komt overeen met de rangschikking
van de SATA controllers:
(excerpt /var/log/syslog)
Apr 21 21:06:26 apollo kernel: [ 1.658228] scsi0 : sata_via
Apr 21 21:06:26 apollo kernel: [ 1.672166] scsi1 : sata_via
Apr 21 21:06:26 apollo kernel: [ 1.685785] ata1: SATA max UDMA/133 cmd 0xe000 ctl 0xe100 bmdma 0xe400 irq 20
Apr 21 21:06:26 apollo kernel: [ 1.699656] ata2: SATA max UDMA/133 cmd 0xe200 ctl 0xe300 bmdma 0xe408 irq 20
Apr 21 21:06:26 apollo kernel: [ 2.088358] ata1.00: ATA-8: Hitachi HDS721050CLA362, JP2OA3EA, max UDMA/133
Apr 21 21:06:26 apollo kernel: [ 2.102394] ata1.00: 976773168 sectors, multi 1: LBA48 NCQ (depth 0/32)
Apr 21 21:06:26 apollo kernel: [ 2.134136] ata1.00: configured for UDMA/133
Apr 21 21:06:26 apollo kernel: [ 2.526549] ata2.00: ATA-8: Hitachi HDS721050CLA362, JP2OA3MA, max UDMA/133
Apr 21 21:06:26 apollo kernel: [ 2.540005] ata2.00: 976773168 sectors, multi 1: LBA48 NCQ (depth 0/32)
Apr 21 21:06:26 apollo kernel: [ 2.570189] ata2.00: configured for UDMA/133
Apr 21 21:06:26 apollo kernel: [ 2.584114] scsi 0:0:0:0: Direct-Access ATA Hitachi HDS72105 JP2O PQ: 0 ANSI: 5
Apr 21 21:06:26 apollo kernel: [ 2.598730] scsi 1:0:0:0: Direct-Access ATA Hitachi HDS72105 JP2O PQ: 0 ANSI: 5
Apr 21 21:06:26 apollo kernel: [ 2.903584] sd 0:0:0:0: [sda] 976773168 512-byte hardware sectors (500108 MB)
Apr 21 21:06:26 apollo kernel: [ 3.000322] sda: sda1 sda2 sda3 sda4 < sda5 sda6 sda7 sda8 sda9 sda10 sda11 sda12 >
Apr 21 21:06:26 apollo kernel: [ 3.149530] sd 1:0:0:0: [sdb] 976773168 512-byte hardware sectors (500108 MB)
Apr 21 21:06:26 apollo kernel: [ 3.540398] sdb: sdb1 sdb2 sdb3 sdb4 < sdb5 sdb6 sdb7 sdb8 sdb9 sdb10 sdb11 sdb12 >
===== USB Disks =====
Ook USB disks worden als SCSI disks beschouwd.\\
Apparaten op de USB bus worden automatisch herkend zodra ze worden
aangekoppeld of worden aangezet (bijv. USB disk).\\
Het SCSI device (sda, sdb, enz.) wordt toegekend op het moment
dat de kernel het apparaat ziet.\\
SCSI devices van een apparaat liggen bij USB dus niet vast!
# dmesg
(excerpt van output)
[27468.840015] usb 4-5: new high speed USB device using ehci_hcd and address 26
[27468.974729] usb 4-5: configuration #1 chosen from 1 choice
[27468.981443] scsi3 : SCSI emulation for USB Mass Storage devices
[27468.994650] usb 4-5: New USB device found, idVendor=0471, idProduct=082b
[27468.996149] usb 4-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[27468.998477] usb 4-5: Product: USB Flash Drive
[27469.000758] usb 4-5: Manufacturer: Philips
[27469.003002] usb 4-5: SerialNumber: AA04012700012898
[27469.006962] usb-storage: device found at 26
[27469.006973] usb-storage: waiting for device to settle before scanning
[27474.004255] usb-storage: device scan complete
[27474.005731] scsi 3:0:0:0: Direct-Access Philips USB Flash Drive 1100 PQ: 0 ANSI: 0 CCS
[27474.055032] sd 3:0:0:0: [sdb] 1981440 512-byte hardware sectors (1014 MB)
[27474.058197] sd 3:0:0:0: [sdb] Write Protect is off
[27474.061390] sd 3:0:0:0: [sdb] Mode Sense: 43 00 00 00
[27474.061395] sd 3:0:0:0: [sdb] Assuming drive cache: write through
[27474.066527] sd 3:0:0:0: [sdb] 1981440 512-byte hardware sectors (1014 MB)
[27474.069064] sd 3:0:0:0: [sdb] Write Protect is off
[27474.071471] sd 3:0:0:0: [sdb] Mode Sense: 43 00 00 00
[27474.071475] sd 3:0:0:0: [sdb] Assuming drive cache: write through
[27474.073926] sdb: sdb1
[27474.316529] sd 3:0:0:0: [sdb] Attached SCSI removable disk
===== Welke disks heeft mijn systeem? =====
In het "proc" filesysteem vinden we in "/proc/partitions" alle
diskpartities, zoals door de kernel gevonden tijdens de opstart:
# cat /proc/partitions
major minor #blocks name
8 0 156290904 sda
8 1 8193149 sda1
8 2 8193150 sda2
8 16 156290904 sdb
8 17 8193149 sdb1
8 18 8193150 sdb2
In dit systeem zijn er dus twee disks "sda" en "sdb".\\
Elke disk heeft een aantal partities: sda1, sda2, enz.
((De overige partities zijn hierboven weggelaten.))
====== . ======
Copyright (c) 2013 Integrated Services; Tux4u.nl\\
Author: Marjan Waldorp; disk-device-files 2011-04-28; 2013-10-31