[pve-devel] restrict scsi-block to /dev/disk/

Alexandre DERUMIER aderumier at odiso.com
Mon Mar 12 10:49:09 CET 2012


sample for major 65:

brw-rw----  1 root disk     65, 160 Feb 18 16:26 sdaa
brw-rw----  1 root disk     65, 161 Feb 18 16:27 sdaa1
brw-rw----  1 root disk     65, 176 Feb 18 16:26 sdab
brw-rw----  1 root disk     65, 177 Feb 18 16:27 sdab1
brw-rw----  1 root disk     65, 192 Feb 18 16:27 sdac
brw-rw----  1 root disk     65, 193 Feb 18 16:27 sdac1
brw-rw----  1 root disk     65, 194 Feb 18 16:27 sdac2
brw-rw----  1 root disk     65, 197 Feb 18 16:27 sdac5
brw-rw----  1 root disk     65, 208 Feb 18 16:26 sdad
brw-rw----  1 root disk     65, 209 Feb 18 16:27 sdad1
brw-rw----  1 root disk     65, 224 Feb 18 16:27 sdae
brw-rw----  1 root disk     65, 225 Feb 18 16:27 sdae1
brw-rw----  1 root disk     65, 240 Feb 18 16:26 sdaf
brw-rw----  1 root disk     65, 241 Feb 18 16:27 sdaf1
brw-rw----  1 root disk     65, 242 Feb 18 16:27 sdaf2
brw-rw----  1 root disk     65, 256 Feb 18 16:27 sdjm
brw-rw----  1 root disk     65, 257 Feb 18 16:27 sdjm1
brw-rw----  1 root disk     65, 258 Feb 18 16:27 sdjm2
brw-rw----  1 root disk     65, 272 Feb 18 16:27 sdjn
brw-rw----  1 root disk     65, 273 Feb 18 16:27 sdjn1
brw-rw----  1 root disk     65, 274 Feb 18 16:27 sdjn2
brw-rw----  1 root disk     65, 288 Feb 18 16:27 sdjo
brw-rw----  1 root disk     65, 289 Feb 18 16:27 sdjo1
brw-rw----  1 root disk     65, 290 Feb 18 16:27 sdjo2
brw-rw----  1 root disk     65, 293 Feb 18 16:27 sdjo5
brw-rw----  1 root disk     65, 304 Feb 18 16:27 sdjp
brw-rw----  1 root disk     65, 305 Feb 18 16:27 sdjp1
brw-rw----  1 root disk     65, 306 Feb 18 16:27 sdjp2
brw-rw----  1 root disk     65, 309 Feb 18 16:27 sdjp5
brw-rw----  1 root disk     65, 320 Feb 18 16:27 sdjq
brw-rw----  1 root disk     65, 321 Feb 18 16:27 sdjq1
brw-rw----  1 root disk     65, 322 Feb 18 16:27 sdjq2
brw-rw----  1 root disk     65, 325 Feb 18 16:27 sdjq5
brw-rw----  1 root disk     65, 336 Feb 18 16:27 sdjr
brw-rw----  1 root disk     65, 337 Feb 18 16:27 sdjr1
brw-rw----  1 root disk     65, 338 Feb 18 16:27 sdjr2
brw-rw----  1 root disk     65, 341 Feb 18 16:27 sdjr5
brw-rw----  1 root disk     65, 352 Feb 18 16:27 sdjs
brw-rw----  1 root disk     65, 353 Feb 18 16:27 sdjs1
brw-rw----  1 root disk     65, 354 Feb 18 16:27 sdjs2
brw-rw----  1 root disk     65, 357 Feb 18 16:27 sdjs5
brw-rw----  1 root disk     65, 368 Feb 18 16:27 sdjt
brw-rw----  1 root disk     65, 369 Feb 18 16:27 sdjt1
brw-rw----  1 root disk     65, 370 Feb 18 16:27 sdjt2
brw-rw----  1 root disk     65, 373 Feb 18 16:27 sdjt5
brw-rw----  1 root disk     65, 384 Feb 18 16:27 sdju
brw-rw----  1 root disk     65, 385 Feb 18 16:27 sdju1
brw-rw----  1 root disk     65, 386 Feb 18 16:27 sdju2
brw-rw----  1 root disk     65, 389 Feb 18 16:27 sdju5
brw-rw----  1 root disk     65, 400 Feb 18 16:27 sdjv
brw-rw----  1 root disk     65, 401 Feb 18 16:27 sdjv1
brw-rw----  1 root disk     65, 416 Feb 18 16:27 sdjw
brw-rw----  1 root disk     65, 417 Feb 18 16:27 sdjw1
brw-rw----  1 root disk     65, 418 Feb 18 16:27 sdjw2
brw-rw----  1 root disk     65, 421 Feb 18 16:27 sdjw5
brw-rw----  1 root disk     65, 432 Feb 18 16:27 sdjx
brw-rw----  1 root disk     65, 433 Feb 18 16:27 sdjx1
brw-rw----  1 root disk     65, 434 Feb 18 16:27 sdjx2
brw-rw----  1 root disk     65, 437 Feb 18 16:27 sdjx5
brw-rw----  1 root disk     65, 448 Feb 18 16:27 sdjy
brw-rw----  1 root disk     65, 449 Feb 18 16:27 sdjy1
brw-rw----  1 root disk     65, 464 Feb 18 16:27 sdjz
brw-rw----  1 root disk     65, 465 Feb 18 16:27 sdjz1
brw-rw----  1 root disk     65, 466 Feb 18 16:27 sdjz2
brw-rw----  1 root disk     65, 469 Feb 18 16:27 sdjz5
brw-rw----  1 root disk     65, 480 Feb 18 16:27 sdka
brw-rw----  1 root disk     65, 481 Feb 18 16:27 sdka1
brw-rw----  1 root disk     65, 482 Feb 18 16:27 sdka2
brw-rw----  1 root disk     65, 485 Feb 18 16:27 sdka5
brw-rw----  1 root disk     65, 496 Feb 18 16:27 sdkb
brw-rw----  1 root disk     65, 497 Feb 18 16:27 sdkb1
brw-rw----  1 root disk     65, 498 Feb 18 16:27 sdkb2
brw-rw----  1 root disk     65, 501 Feb 18 16:27 sdkb5
brw-rw----  1 root disk     65,   0 Feb 18 16:27 sdq
brw-rw----  1 root disk     65,   1 Feb 18 16:27 sdq1
brw-rw----  1 root disk     65,   2 Feb 18 16:27 sdq2
brw-rw----  1 root disk     65,   5 Feb 18 16:27 sdq5
brw-rw----  1 root disk     65,  16 Feb 18 16:26 sdr
brw-rw----  1 root disk     65,  17 Feb 18 16:27 sdr1
brw-rw----  1 root disk     65,  18 Feb 18 16:27 sdr2
brw-rw----  1 root disk     65,  21 Feb 18 16:27 sdr5
brw-rw----  1 root disk     65,  32 Feb 18 16:26 sds
brw-rw----  1 root disk     65,  33 Feb 18 16:27 sds1
brw-rw----  1 root disk     65,  48 Feb 18 16:27 sdt
brw-rw----  1 root disk     65,  49 Feb 18 16:27 sdt1
brw-rw----  1 root disk     65, 512 Feb 18 16:28 sdti
brw-rw----  1 root disk     65, 528 Feb 18 16:28 sdtj
brw-rw----  1 root disk     65, 529 Feb 18 16:28 sdtj1
brw-rw----  1 root disk     65, 544 Feb 18 16:28 sdtk
brw-rw----  1 root disk     65, 545 Feb 18 16:28 sdtk1
brw-rw----  1 root disk     65, 546 Feb 18 16:28 sdtk2
brw-rw----  1 root disk     65, 549 Feb 18 16:28 sdtk5
brw-rw----  1 root disk     65, 560 Feb 18 16:28 sdtl
brw-rw----  1 root disk     65, 561 Feb 18 16:28 sdtl1
brw-rw----  1 root disk     65, 562 Feb 18 16:28 sdtl2
brw-rw----  1 root disk     65, 565 Feb 18 16:28 sdtl5
brw-rw----  1 root disk     65, 576 Feb 18 16:28 sdtm
brw-rw----  1 root disk     65, 592 Feb 18 16:28 sdtn
brw-rw----  1 root disk     65, 593 Feb 18 16:28 sdtn1
brw-rw----  1 root disk     65, 608 Feb 18 16:28 sdto
brw-rw----  1 root disk     65, 609 Feb 18 16:28 sdto1
brw-rw----  1 root disk     65, 610 Feb 18 16:28 sdto2
brw-rw----  1 root disk     65, 613 Feb 18 16:28 sdto5
brw-rw----  1 root disk     65, 624 Feb 18 16:28 sdtp
brw-rw----  1 root disk     65, 625 Feb 18 16:28 sdtp1
brw-rw----  1 root disk     65, 626 Feb 18 16:28 sdtp2
brw-rw----  1 root disk     65, 629 Feb 18 16:28 sdtp5
brw-rw----  1 root disk     65, 640 Feb 18 16:28 sdtq
brw-rw----  1 root disk     65, 656 Feb 18 16:28 sdtr
brw-rw----  1 root disk     65, 657 Feb 18 16:28 sdtr1
brw-rw----  1 root disk     65, 658 Feb 18 16:28 sdtr2
brw-rw----  1 root disk     65, 661 Feb 18 16:28 sdtr5
brw-rw----  1 root disk     65, 672 Feb 18 16:28 sdts
brw-rw----  1 root disk     65, 673 Feb 18 16:28 sdts1
brw-rw----  1 root disk     65, 674 Feb 18 16:28 sdts2
brw-rw----  1 root disk     65, 677 Feb 18 16:28 sdts5
brw-rw----  1 root disk     65, 688 Feb 18 16:28 sdtt
brw-rw----  1 root disk     65, 689 Feb 18 16:28 sdtt1
brw-rw----  1 root disk     65, 704 Feb 18 16:28 sdtu
brw-rw----  1 root disk     65, 720 Feb 18 16:28 sdtv
brw-rw----  1 root disk     65, 721 Feb 18 16:28 sdtv1
brw-rw----  1 root disk     65, 722 Feb 18 16:28 sdtv2
brw-rw----  1 root disk     65, 725 Feb 18 16:28 sdtv5
brw-rw----  1 root disk     65, 736 Feb 18 16:28 sdtw
brw-rw----  1 root disk     65, 737 Feb 18 16:28 sdtw1
brw-rw----  1 root disk     65, 738 Feb 18 16:28 sdtw2
brw-rw----  1 root disk     65, 741 Feb 18 16:28 sdtw5
brw-rw----  1 root disk     65, 752 Feb 18 16:28 sdtx
brw-rw----  1 root disk     65, 753 Feb 18 16:28 sdtx1
brw-rw----  1 root disk     65,  64 Feb 18 16:26 sdu
brw-rw----  1 root disk     65,  65 Feb 18 16:27 sdu1
brw-rw----  1 root disk     65,  80 Feb 18 16:26 sdv
brw-rw----  1 root disk     65,  81 Feb 18 16:27 sdv1
brw-rw----  1 root disk     65,  96 Feb 18 16:26 sdw
brw-rw----  1 root disk     65,  97 Feb 18 16:27 sdw1
brw-rw----  1 root disk     65,  98 Feb 18 16:27 sdw2
brw-rw----  1 root disk     65, 112 Feb 18 16:26 sdx
brw-rw----  1 root disk     65, 113 Feb 18 16:27 sdx1
brw-rw----  1 root disk     65, 128 Feb 18 16:26 sdy
brw-rw----  1 root disk     65, 129 Feb 18 16:27 sdy1
brw-rw----  1 root disk     65, 130 Feb 18 16:27 sdy2
brw-rw----  1 root disk     65, 144 Feb 18 16:26 sdz
brw-rw----  1 root disk     65, 145 Feb 18 16:27 sdz1
kvmtest:/dev# 


----- Mail original ----- 

De: "Alexandre DERUMIER" <aderumier at odiso.com> 
À: "Dietmar Maurer" <dietmar at proxmox.com> 
Cc: pve-devel at pve.proxmox.com 
Envoyé: Lundi 12 Mars 2012 10:43:52 
Objet: Re: [pve-devel] restrict scsi-block to /dev/disk/ 

I found these majors in doc : 

major : 8,65,66,67,68,69,70,71,128,129,130,131,132,133,134,135 

But they are more than 16 minors ? (kernel 2.6). 

Checking major isn't enough ? 

I can see 800 iscsi luns disk on my host 


----- Mail original ----- 

De: "Dietmar Maurer" <dietmar at proxmox.com> 
À: "Alexandre DERUMIER" <aderumier at odiso.com> 
Cc: pve-devel at pve.proxmox.com 
Envoyé: Lundi 12 Mars 2012 10:34:08 
Objet: RE: [pve-devel] restrict scsi-block to /dev/disk/ 

There are 16 minor numbers for each major ==> 16x16 = 256 SCSI disks 

Note: we need to check major and minor numbers 

> -----Original Message----- 
> From: Alexandre DERUMIER [mailto:aderumier at odiso.com] 
> Sent: Montag, 12. März 2012 09:11 
> To: Dietmar Maurer 
> Cc: pve-devel at pve.proxmox.com 
> Subject: Re: [pve-devel] restrict scsi-block to /dev/disk/ 
> 
> Ok, got it ! I'll read the doc to see how it's work. (I like to learn new things ;) 
> 
> currently with my iscsi I have these majors 
> 
> 
> 8 
> 65 
> 66 
> 67 
> 68 
> 69 
> 70 
> 71 
> 128 
> 129 
> 130 
> 131 
> 132 
> 133 
> 134 
> 135 
> 
> ----- Mail original ----- 
> 
> De: "Dietmar Maurer" <dietmar at proxmox.com> 
> À: "Alexandre DERUMIER" <aderumier at odiso.com> 
> Cc: pve-devel at pve.proxmox.com 
> Envoyé: Lundi 12 Mars 2012 08:56:52 
> Objet: RE: [pve-devel] restrict scsi-block to /dev/disk/ 
> 
> Each unix device has a major and minor number: 
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=Documenta 
> tion/devices.txt;h=00383186d8fb3e2c0fc4d5a12852844cb5b2721f;hb=fde7d904 
> 9e55ab85a390be7f415d74c9f62dd0f9 
> 
> see 'man fstat' for detailes on how toö get those numbers (st_dev field) 
> 
> alse see: 'man mknod' and 'man 2 mknod' 
> 
> - Dietmar 
> 
> 
> 
> > -----Original Message----- 
> > From: Alexandre DERUMIER [mailto:aderumier at odiso.com] 
> > Sent: Montag, 12. März 2012 08:44 
> > To: Dietmar Maurer 
> > Cc: pve-devel at pve.proxmox.com 
> > Subject: Re: [pve-devel] restrict scsi-block to /dev/disk/ 
> > 
> > I don't known what is major/minor ;) 
> > 
> > Could you provide an example ? 
> > 
> > ----- Mail original ----- 
> > 
> > De: "Dietmar Maurer" <dietmar at proxmox.com> 
> > À: "Alexandre DERUMIER" <aderumier at odiso.com> 
> > Cc: pve-devel at pve.proxmox.com 
> > Envoyé: Lundi 12 Mars 2012 08:26:46 
> > Objet: RE: [pve-devel] restrict scsi-block to /dev/disk/ 
> > 
> > > Why do you mean by major/minor device number ? 
> > > 
> > > 
> > > we can also try to test if 
> > > 
> > > /sys/block/sdXXX/device/scsi_device 
> > > 
> > > exist 
> > > 
> > > 
> > > /dev/disk/by-id/scsi-XXXX are symlink to /dev/sdX 
> > 
> > But testing major/minor requires one simple stat call - isn't that easier? 
> > 
> > - Dietmar 
> > 
> > 
> > 
> > -- 
> > 
> > -- 
> > 
> > 
> > 
> > 
> > Alexandre D erumier 
> > Ingénieur Système 
> > Fixe : 03 20 68 88 90 
> > Fax : 03 20 68 90 81 
> > 45 Bvd du Général Leclerc 59100 Roubaix - France 
> > 12 rue Marivaux 75002 Paris - France 
> > 
> 
> 
> 
> 
> -- 
> 
> -- 
> 
> 
> 
> 
> Alexandre D erumier 
> Ingénieur Système 
> Fixe : 03 20 68 88 90 
> Fax : 03 20 68 90 81 
> 45 Bvd du Général Leclerc 59100 Roubaix - France 
> 12 rue Marivaux 75002 Paris - France 
> 




-- 

-- 




Alexandre D erumier 
Ingénieur Système 
Fixe : 03 20 68 88 90 
Fax : 03 20 68 90 81 
45 Bvd du Général Leclerc 59100 Roubaix - France 
12 rue Marivaux 75002 Paris - France 

_______________________________________________ 
pve-devel mailing list 
pve-devel at pve.proxmox.com 
http://pve.proxmox.com/cgi-bin/mailman/listinfo/pve-devel 



-- 

-- 




	Alexandre D erumier 
Ingénieur Système 
Fixe : 03 20 68 88 90 
Fax : 03 20 68 90 81 
45 Bvd du Général Leclerc 59100 Roubaix - France 
12 rue Marivaux 75002 Paris - France 
	


More information about the pve-devel mailing list